Skip to content

Commit d95b98c

Browse files
robertodecurnexothatbrian
authored andcommitted
Adding tests covering diff over patch files
Updating test repos to include a patch file
1 parent e50e969 commit d95b98c

10 files changed

+16
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
0000000000000000000000000000000000000000 6094405a5209406708ffe737077841b45c63fe25 Scott Chacon <schacon@gmail.com> 1417622944 -0300 push
2+
6094405a5209406708ffe737077841b45c63fe25 1c04149973fb98fe8437fde044eb44cf5eb6ddda Scott Chacon <schacon@gmail.com> 1417623204 -0300 push
Binary file not shown.

tests/files/working/dot_git/objects/1c/04149973fb98fe8437fde044eb44cf5eb6ddda

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
x��]j�0��S�V�+A(}�
2+
=�j�N �e�=~ ��4��0��u�b>��
3+
(,����$*�E�p�> fˤ��՚��n�0rt`"��� �r�5DI~V?ǽu�nU�h�����u��K�S�����E��6XJ�������qw��C�g�x,�vr�yy�y;Sa
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1c04149973fb98fe8437fde044eb44cf5eb6ddda

tests/units/test_diff.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ def test_diff_tags
2222
assert_equal(64, d.insertions)
2323
end
2424

25+
# Patch files on diff outputs used to be parsed as
26+
# part of the diff adding invalid modificaction
27+
# to the diff results.
28+
def test_diff_patch
29+
d = @git.diff('diff_over_patches~2', 'diff_over_patches')
30+
assert_equal(1, d.count)
31+
end
32+
2533
def test_diff_path
2634
d = @git.diff('gitsearch1', 'v2.5').path('scott/')
2735
assert_equal(d.from, 'gitsearch1')

tests/units/test_logger.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_logger
2020

2121
logc = File.read(log.path)
2222
assert(/INFO -- : git branch '-a'/.match(logc))
23-
assert(/DEBUG -- : \* git_grep/.match(logc))
23+
assert(/DEBUG -- : diff_over_patches/.match(logc))
2424

2525
log = Tempfile.new('logfile')
2626
log.close
@@ -32,7 +32,7 @@ def test_logger
3232

3333
logc = File.read(log.path)
3434
assert(/INFO -- : git branch '-a'/.match(logc))
35-
assert(!/DEBUG -- : \* git_grep/.match(logc))
35+
assert(!/DEBUG -- : diff_over_patches/.match(logc))
3636
end
3737

3838
end

0 commit comments

Comments
 (0)