PDF: add \\(double backslashes) handling of FPDF ANSI test in unit lib test (#61, #117).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5342 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-04-06 04:28:19 +00:00
parent 73a248530a
commit 470ff0c6e5
1 changed files with 13 additions and 0 deletions

View 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