Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✅ Test merge command #22

Merged
merged 6 commits into from
Oct 10, 2020
Merged

✅ Test merge command #22

merged 6 commits into from
Oct 10, 2020

Conversation

AndreasSko
Copy link
Owner

@AndreasSko AndreasSko commented Oct 9, 2020

The test will check, if merging against an empty file results in no loss of data. It also tests solving conflicts by choosing all left or all right and checking its result. Windows is not tested, as it does not support psuedoterminals.

Other changes:

  • Move ID change logic to model: This allows us to reuse the code within model and at the same time simplify the logic in IDChanges.
  • Change UniqueKey & activate Equals methods for some models.
  • Add method Database{}.Equals(), so we are able to compare two Database structs, which simplifies testing.

@coveralls
Copy link

coveralls commented Oct 9, 2020

Coverage Status

Coverage increased (+0.5%) to 81.355% when pulling 986897a on merge_cmd_testing into 9894659 on master.

@AndreasSko AndreasSko force-pushed the merge_cmd_testing branch 4 times, most recently from 2174294 to 1311ac7 Compare October 10, 2020 09:44
This enables to send the output to different files,
which we can later use to test the commands.
For this the terminal.Stdio struct is used.
@AndreasSko AndreasSko force-pushed the merge_cmd_testing branch 2 times, most recently from 9a41107 to fa29a13 Compare October 10, 2020 10:21
@AndreasSko AndreasSko changed the title Merge cmd testing Test merge command Oct 10, 2020
@AndreasSko AndreasSko changed the title Test merge command ✅ Test merge command Oct 10, 2020
@AndreasSko AndreasSko marked this pull request as ready for review October 10, 2020 10:25
This allows us to reuse the code within model and
at the same time simplify the logic in IDChanges.
* UniqueKey for BlockRange contains the
UserMarkID
now, as there could be multiple BlockRanges that
are similar except of the UserMarkID. As the
UniqueKey is used in the Equals function of
UserMarkBlockRange, changed it there to strip
the UserMarkID again (in that case, they BRs are
already joined, so we should ignore the UserMarkID).
* Added TagID and Position to UniqueKey of TagMap
* Enabled Equals() for BlockRange, Location, and
TagMap
This method might be helpful to test the result of
a merge.
The test will check, if merging against an empty file
results in no loss of data. It also tests solving
conflicts by choosing all left or all right and checking
its result.

Windows is not tested, as it does not support
psuedoterminals.
@AndreasSko AndreasSko merged commit 9431546 into master Oct 10, 2020
@AndreasSko AndreasSko deleted the merge_cmd_testing branch October 10, 2020 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants