Merged r8876 from trunk.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.3-stable@9110 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-03-05 12:43:41 +00:00
parent 4930b3e8bf
commit 90c6a8579b
2 changed files with 48 additions and 24 deletions
@@ -91,6 +91,29 @@ class Redmine::UnifiedDiffTest < ActiveSupport::TestCase
end
def test_partials_with_html_entities
raw = <<-DIFF
--- test.orig.txt Wed Feb 15 16:10:39 2012
+++ test.new.txt Wed Feb 15 16:11:25 2012
@@ -1,5 +1,5 @@
Semicolons were mysteriously appearing in code diffs in the repository
-void DoSomething(std::auto_ptr<MyClass> myObj)
+void DoSomething(const MyClass& myObj)
DIFF
diff = Redmine::UnifiedDiff.new(raw, :type => 'sbs')
assert_equal 1, diff.size
assert_equal 'void DoSomething(<span>std::auto_ptr&lt;MyClass&gt;</span> myObj)', diff.first[2].html_line_left
assert_equal 'void DoSomething(<span>const MyClass&amp;</span> myObj)', diff.first[2].html_line_right
diff = Redmine::UnifiedDiff.new(raw, :type => 'inline')
assert_equal 1, diff.size
assert_equal 'void DoSomething(<span>std::auto_ptr&lt;MyClass&gt;</span> myObj)', diff.first[2].html_line
assert_equal 'void DoSomething(<span>const MyClass&amp;</span> myObj)', diff.first[3].html_line
end
def test_line_starting_with_dashes
diff = Redmine::UnifiedDiff.new(<<-DIFF
--- old.txt Wed Nov 11 14:24:58 2009