summaryrefslogtreecommitdiffstats
path: root/test/unit/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-09-02 10:24:56 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-09-02 10:24:56 +0000
commit8b72710d7ee3c0a5bf0ab20c5fc774482ae47930 (patch)
tree43bff31bd26505672549a6a92b85e829e925613c /test/unit/lib
parent265baa1b2c5d0bcf37e12f1df0b3339c793b46e7 (diff)
downloadredmine-8b72710d7ee3c0a5bf0ab20c5fc774482ae47930.tar.gz
redmine-8b72710d7ee3c0a5bf0ab20c5fc774482ae47930.zip
Fixed: New multi-line macros regexp is too eager (#11736).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10276 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/lib')
-rw-r--r--test/unit/lib/redmine/wiki_formatting/macros_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/wiki_formatting/macros_test.rb b/test/unit/lib/redmine/wiki_formatting/macros_test.rb
index 901184909..75376652a 100644
--- a/test/unit/lib/redmine/wiki_formatting/macros_test.rb
+++ b/test/unit/lib/redmine/wiki_formatting/macros_test.rb
@@ -273,4 +273,23 @@ EXPECTED
text = '{{macro(2)}} !{{macro(2)}} {{hello_world(foo)}}'
assert_equal '<p>{{macro(2)}} {{macro(2)}} Hello world! Object: NilClass, Arguments: foo and no block of text.</p>', textilizable(text)
end
+
+ def test_macros_with_text_should_not_mangle_following_macros
+ text = <<-RAW
+{{hello_world
+Line of text
+}}
+
+{{hello_world
+Another line of text
+}}
+RAW
+
+ expected = <<-EXPECTED
+<p>Hello world! Object: NilClass, Called with no argument and a 12 bytes long block of text.</p>
+<p>Hello world! Object: NilClass, Called with no argument and a 20 bytes long block of text.</p>
+EXPECTED
+
+ assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(text).gsub(%r{[\r\n\t]}, '')
+ end
end