test/test_latexbuilder.rb in review-1.1.0 vs test/test_latexbuilder.rb in review-1.2.0

- old
+ new

@@ -1,10 +1,11 @@ # -*- coding: utf-8 -*- require 'test_helper' require 'review/compiler' require 'review/book' require 'review/latexbuilder' +require 'review/i18n' class LATEXBuidlerTest < Test::Unit::TestCase include ReVIEW def setup @@ -12,11 +13,10 @@ @param = { "secnolevel" => 2, # for IDGXMLBuilder, EPUBBuilder "toclevel" => 2, "inencoding" => "UTF-8", "outencoding" => "UTF-8", - "subdirmode" => nil, "stylesheet" => nil, # for EPUBBuilder } ReVIEW.book.param = @param @compiler = ReVIEW::Compiler.new(@builder) @chapter = Book::Chapter.new(nil, 1, 'chap1', nil, StringIO.new) @@ -194,10 +194,15 @@ ret = @builder.compile_inline("test @<hd>{chap1|test} test2") assert_equal %Q|test 「1.1.1 te\\textunderscore{}st」 test2|, ret end + def test_inline_ruby_comma + ret = @builder.compile_inline("@<ruby>{foo\\, bar\\, buz,フー・バー・バズ}") + assert_equal "\\ruby{foo, bar, buz}{フー・バー・バズ}", ret + end + def test_inline_uchar ret = @builder.compile_inline("test @<uchar>{2460} test2") assert_equal %Q|test \\UTF{2460} test2|, ret end @@ -389,11 +394,11 @@ def @chapter.bibpaper(id) Book::BibpaperIndex::Item.new("samplebib",1,"sample bib") end @builder.bibpaper(["a", "b"], "samplebib", "sample bib @<b>{bold}") - assert_equal %Q|[1] sample bib \\textbf{bold}\n\\label{bib:samplebib}\n\nab\n|, @builder.raw_result + assert_equal %Q|[1] sample bib \\textbf{bold}\n\\label{bib:samplebib}\n\nab\n\n|, @builder.raw_result end def test_bibpaper_without_body def @chapter.bibpaper(id) Book::BibpaperIndex::Item.new("samplebib",1,"sample bib") @@ -567,9 +572,25 @@ \\end{itemize} \\end{itemize} EOS ul_helper(src, expect) + end + + def test_ol + src =<<-EOS + 3. AAA + 3. BBB +EOS + + expect =<<-EOS + +\\begin{enumerate} +\\item AAA +\\item BBB +\\end{enumerate} +EOS + ol_helper(src, expect) end def test_ol_with_bracket src =<<-EOS 1. AAA