Fixes diff parser for when lines starting with multiple dashes are removed (#4186).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3028 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -33,6 +33,32 @@ class Redmine::UnifiedDiffTest < ActiveSupport::TestCase
|
||||
diff = Redmine::UnifiedDiff.new(read_diff_fixture('subversion.diff'), :max_lines => 20)
|
||||
assert_equal 2, diff.size
|
||||
end
|
||||
|
||||
def test_line_starting_with_dashes
|
||||
diff = Redmine::UnifiedDiff.new(<<-DIFF
|
||||
--- old.txt Wed Nov 11 14:24:58 2009
|
||||
+++ new.txt Wed Nov 11 14:25:02 2009
|
||||
@@ -1,8 +1,4 @@
|
||||
-Lines that starts with dashes:
|
||||
-
|
||||
-------------------------
|
||||
--- file.c
|
||||
-------------------------
|
||||
+A line that starts with dashes:
|
||||
|
||||
and removed.
|
||||
|
||||
@@ -23,4 +19,4 @@
|
||||
|
||||
|
||||
|
||||
-Another chunk of change
|
||||
+Another chunk of changes
|
||||
|
||||
DIFF
|
||||
)
|
||||
assert_equal 1, diff.size
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
||||
Reference in New Issue
Block a user