Skip to content
This repository has been archived by the owner on Dec 25, 2024. It is now read-only.

Add more tests to increase coverage. #14

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

sofiia-tesliuk
Copy link
Contributor

@sofiia-tesliuk sofiia-tesliuk commented Oct 29, 2020

Increased coverage from 70% to 87%.
A lot of test files have been replaced to new ones with more understandable names.

patchutils.go Show resolved Hide resolved
patchutils_test.go Outdated Show resolved Hide resolved
newSource: "source_1_b/file_1.txt",
newDiffFile: "f1_b_c.diff",
resultFile: "f1_a_c.diff",
oldSource: "mixed_old_source/f7.txt",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like the same test case as the one from line 98. Also it seems you're not using the new test file mi_f6_os_od.diff anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Um.. yes, actually
mixedModeFileTests used for testing MixedMode and MixedModeFile, while mixedModePathFileTests tests MixedModePath, which includes call to MixedModeFile and MixedMode.
It might be better to totally remove mixedModeFileTests and just test everything with mixedModePathFileTests?
But in that case we won't see directly which of inner function is failing, except from error messages.

* Move check if diff is out of content source to process of unchanged/deleted lines;

* Used cmp.Equal in tests;

* Add test case with f6;

* allow processing empty diff files in MixedModePath;

* check number of read diff files instead of handling error on read;

* changed NewFileDiffReader to NewMultiFileDiffReader;

* add missing colon;

* add type to the nil assigment;

* corrected calculation of StartLines and NumberOfLines in convertChunksToFileDiff;
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants