comparison test/unit/lib/redmine/unified_diff_test.rb @ 929:5f33065ddc4b redmine-1.3

Update to Redmine SVN rev 9414 on 1.3-stable branch
author Chris Cannam
date Wed, 27 Jun 2012 14:54:18 +0100
parents cbb26bc654de
children 433d4f72a19b
comparison
equal deleted inserted replaced
909:cbb26bc654de 929:5f33065ddc4b
89 assert_equal [37, -1], diff[8].offsets 89 assert_equal [37, -1], diff[8].offsets
90 assert_equal [0, -38], diff[10].offsets 90 assert_equal [0, -38], diff[10].offsets
91 91
92 end 92 end
93 93
94 def test_partials_with_html_entities
95 raw = <<-DIFF
96 --- test.orig.txt Wed Feb 15 16:10:39 2012
97 +++ test.new.txt Wed Feb 15 16:11:25 2012
98 @@ -1,5 +1,5 @@
99 Semicolons were mysteriously appearing in code diffs in the repository
100
101 -void DoSomething(std::auto_ptr<MyClass> myObj)
102 +void DoSomething(const MyClass& myObj)
103
104 DIFF
105
106 diff = Redmine::UnifiedDiff.new(raw, :type => 'sbs')
107 assert_equal 1, diff.size
108 assert_equal 'void DoSomething(<span>std::auto_ptr&lt;MyClass&gt;</span> myObj)', diff.first[2].html_line_left
109 assert_equal 'void DoSomething(<span>const MyClass&amp;</span> myObj)', diff.first[2].html_line_right
110
111 diff = Redmine::UnifiedDiff.new(raw, :type => 'inline')
112 assert_equal 1, diff.size
113 assert_equal 'void DoSomething(<span>std::auto_ptr&lt;MyClass&gt;</span> myObj)', diff.first[2].html_line
114 assert_equal 'void DoSomething(<span>const MyClass&amp;</span> myObj)', diff.first[3].html_line
115 end
116
94 def test_line_starting_with_dashes 117 def test_line_starting_with_dashes
95 diff = Redmine::UnifiedDiff.new(<<-DIFF 118 diff = Redmine::UnifiedDiff.new(<<-DIFF
96 --- old.txt Wed Nov 11 14:24:58 2009 119 --- old.txt Wed Nov 11 14:24:58 2009
97 +++ new.txt Wed Nov 11 14:25:02 2009 120 +++ new.txt Wed Nov 11 14:25:02 2009
98 @@ -1,8 +1,4 @@ 121 @@ -1,8 +1,4 @@