]> source.dussan.org Git - redmine.git/commitdiff
PDF: add \\(double backslashes) handling of FPDF ANSI test in unit lib test (#61...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 6 Apr 2011 04:28:19 +0000 (04:28 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 6 Apr 2011 04:28:19 +0000 (04:28 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5342 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/lib/redmine/export/pdf_test.rb

index 14e4f96eee97e61b5b70f977ed4f8c3ab0912b94..a6ff6589a246df691e8d9cd1696352a9b884cf40 100644 (file)
@@ -31,4 +31,17 @@ class PdfTest < ActiveSupport::TestCase
     assert_equal '\\\\abcd\\\\abcd\\\\',
                  pdf.fix_text_encoding('\\abcd\\abcd\\')
   end
+
+  def test_fix_text_encoding_double_backslash_ascii
+    set_language_if_valid 'ja'
+    pdf = Redmine::Export::PDF::IFPDF.new('ja')
+    assert pdf
+    assert_equal '\\\\\\\\abcd', pdf.fix_text_encoding('\\\\abcd')
+    assert_equal 'abcd\\\\\\\\', pdf.fix_text_encoding('abcd\\\\')
+    assert_equal 'ab\\\\\\\\cd', pdf.fix_text_encoding('ab\\\\cd')
+    assert_equal 'ab\\\\\\\\cd\\\\de', pdf.fix_text_encoding('ab\\\\cd\\de')
+    assert_equal '\\\\\\\\abcd\\\\\\\\', pdf.fix_text_encoding('\\\\abcd\\\\')
+    assert_equal '\\\\\\\\abcd\\\\\\\\abcd\\\\\\\\',
+                 pdf.fix_text_encoding('\\\\abcd\\\\abcd\\\\')
+  end
 end