diff --git a/test/unit/lib/redmine/unified_diff_test.rb b/test/unit/lib/redmine/unified_diff_test.rb index 87e9d072f..53138b4cf 100644 --- a/test/unit/lib/redmine/unified_diff_test.rb +++ b/test/unit/lib/redmine/unified_diff_test.rb @@ -92,12 +92,12 @@ class Redmine::UnifiedDiffTest < ActiveSupport::TestCase 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 @@ + @@ -1,4 +1,4 @@ Semicolons were mysteriously appearing in code diffs in the repository - + ``` -void DoSomething(std::auto_ptr myObj) +void DoSomething(const MyClass& myObj) - + ``` DIFF diff = Redmine::UnifiedDiff.new(raw, :type => 'sbs') assert_equal 1, diff.size @@ -385,7 +385,7 @@ class Redmine::UnifiedDiffTest < ActiveSupport::TestCase end def test_keep_similar_git_footer_line - raw = <<~'DIFF' + raw = <<~DIFF diff --git a/test1.txt b/test1.txt --- a/test1.txt +++ b/test1.txt @@ -395,22 +395,22 @@ class Redmine::UnifiedDiffTest < ActiveSupport::TestCase $ cd git_utf8_repository_hg -- -Next line has white space after '-' - -- + --\s --- -- $ touch test.txt $ hg add test.txt - $ hg commit -m `echo -e "U+1F603\U1F603"` -u `echo -e "U+1F603\U1F603"` + $ hg commit -m `echo -e "U+1F603\\U1F603"` -u `echo -e "U+1F603\\U1F603"` diff --git a/test2.txt b/test2.txt --- a/test2.txt +++ b/test2.txt @@ -5,9 +5,4 @@ $ hg add test.txt - $ hg commit -m `echo -e "U+1F603\U1F603"` -u `echo -e "U+1F603\U1F603"` + $ hg commit -m `echo -e "U+1F603\\U1F603"` -u `echo -e "U+1F603\\U1F603"` $ hg bookmark master -- -Next line has white space after '-' - -- + --\s --- -- $ hg push ../git_utf8_repository @@ -425,12 +425,12 @@ class Redmine::UnifiedDiffTest < ActiveSupport::TestCase end def test_git_footer_line - raw = <<~'DIFF' + raw = <<~DIFF From 1ed13eda266a3e0a5a8624e79ae28874ebcdeb5c Mon Sep 17 00:00:00 2001 From: test Date: Thu, 30 Apr 2020 11:40:20 +0900 Subject: [PATCH] add 'rpm -q git' and its result - + --- test.txt | 2 ++ 1 file changed, 2 insertions(+) @@ -440,14 +440,14 @@ class Redmine::UnifiedDiffTest < ActiveSupport::TestCase --- a/test.txt +++ b/test.txt @@ -6,3 +6,5 @@ $ hg add test.txt - $ hg commit -m `echo -e "U+1F603\U1F603"` -u `echo -e "U+1F603\U1F603"` + $ hg commit -m `echo -e "U+1F603\\U1F603"` -u `echo -e "U+1F603\\U1F603"` $ hg bookmark master $ hg push ../git_utf8_repository +$ rpm -q git +git-1.8.3.1-21.el7_7.x86_64 - -- + --\s 1.8.3.1 - + DIFF lines = raw.split("\n") lines << ""