Skip to content

Commit

Permalink
Add negative test cases for various git artifacts.
Browse files Browse the repository at this point in the history
  • Loading branch information
christhekeele committed Apr 11, 2021
1 parent 8993f10 commit 8d1ebab
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/check_merge_conflict_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,32 @@ def test_does_not_care_when_not_in_a_merge(tmpdir):
f.write_binary(b'problem\n=======\n')
assert main([str(f.realpath())]) == 0

f = tmpdir.join('README.md')
f.write_binary(b'problem\n======= \n')
assert main([str(f.realpath())]) == 0

f = tmpdir.join('README.md')
f.write_binary(b'problem\n|||||||\n')
assert main([str(f.realpath()), '--assume-in-merge']) == 0

f = tmpdir.join('README.md')
f.write_binary(b'problem\n||||||| \n')
assert main([str(f.realpath()), '--assume-in-merge']) == 0


def test_care_when_assumed_merge(tmpdir):
f = tmpdir.join('README.md')
f.write_binary(b'problem\n=======\n')
assert main([str(f.realpath()), '--assume-in-merge']) == 1

f = tmpdir.join('README.md')
f.write_binary(b'problem\n======= \n')
assert main([str(f.realpath()), '--assume-in-merge']) == 1

f = tmpdir.join('README.md')
f.write_binary(b'problem\n|||||||\n')
assert main([str(f.realpath()), '--assume-in-merge']) == 1

f = tmpdir.join('README.md')
f.write_binary(b'problem\n||||||| \n')
assert main([str(f.realpath()), '--assume-in-merge']) == 1

0 comments on commit 8d1ebab

Please sign in to comment.