Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0d9f149

Browse files
committed
Added test to verify binary diffs are working as well.
Related togitpython-developers#74
1 parent17f5d13 commit0d9f149

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

‎git/test/fixtures/diff_patch_binary

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
diff --git a/rps b/rps
2+
index f4567df37451b230b1381b1bc9c2bcad76e08a3c..736bd596a36924d30b480942e9475ce0d734fa0d 100755
3+
Binary files a/rps and b/rps differ

‎git/test/fixtures/diff_raw_binary

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:100755 100755 f4567df37451b230b1381b1bc9c2bcad76e08a3c 736bd596a36924d30b480942e9475ce0d734fa0d Mrps

‎git/test/test_diff.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,16 @@ def test_diff_with_rename(self):
6565
assertdiff.rename_to=='that'
6666
assertlen(list(diffs.iter_change_type('R')))==1
6767

68+
deftest_binary_diff(self):
69+
formethod,file_namein ((Diff._index_from_patch_format,'diff_patch_binary'),
70+
(Diff._index_from_raw_format,'diff_raw_binary')):
71+
res=method(None,StringProcessAdapter(fixture(file_name)).stdout)
72+
assertlen(res)==1
73+
assertlen(list(res.iter_change_type('M')))==1
74+
ifres[0].diff:
75+
assertres[0].diff=="Binary files a/rps and b/rps differ\n","in patch mode, we get a diff text"
76+
# end for each method to test
77+
6878
deftest_diff_patch_format(self):
6979
# test all of the 'old' format diffs for completness - it should at least
7080
# be able to deal with it

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp