test/test_topbuilder.rb in review-2.2.0 vs test/test_topbuilder.rb in review-2.3.0
- old
+ new
@@ -145,13 +145,18 @@
assert_equal %Q|test ◆→コメント←◆ test2|, actual
end
def test_inline_in_table
actual = compile_block("//table{\n★1☆\t▲2☆\n------------\n★3☆\t▲4☆<>&\n//}\n")
- assert_equal %Q|★★1☆☆\t★▲2☆☆\n★3☆\t▲4☆<>&\n◆→終了:表←◆\n\n|, actual
+ assert_equal %Q|◆→開始:表←◆\n★★1☆☆\t★▲2☆☆\n★3☆\t▲4☆<>&\n◆→終了:表←◆\n\n|, actual
end
+ def test_dlist_beforeulol
+ actual = compile_block(" : foo\n foo.\n\npara\n\n : foo\n foo.\n\n 1. bar\n\n : foo\n foo.\n\n * bar\n")
+ assert_equal %Q|★foo☆\n\tfoo.\n\t\n\npara\n\n★foo☆\n\tfoo.\n\t\n\n1\tbar\n\n★foo☆\n\tfoo.\n\t\n\n●\tbar\n\n|, actual
+ end
+
def test_paragraph
actual = compile_block("foo\nbar\n")
assert_equal %Q|foobar\n|, actual
end
@@ -206,9 +211,29 @@
def @chapter.bibpaper(id)
Book::BibpaperIndex::Item.new("samplebib",1,"sample bib")
end
assert_equal %Q|[1]|, compile_inline("@<bib>{samplebib}")
+ end
+
+ def test_table
+ actual = compile_block("//table{\naaa\tbbb\n------------\nccc\tddd<>&\n//}\n")
+ assert_equal %Q|◆→開始:表←◆\n★aaa☆\t★bbb☆\nccc\tddd<>&\n◆→終了:表←◆\n\n|,
+ actual
+ end
+
+ def test_inline_table
+ def @chapter.table(id)
+ Book::TableIndex::Item.new("sampletable",1)
+ end
+ actual = compile_block("@<table>{sampletest}\n")
+ assert_equal %Q|表1.1\n|, actual
+ end
+
+ def test_emtable
+ actual = compile_block("//emtable[foo]{\naaa\tbbb\n------------\nccc\tddd<>&\n//}\n//emtable{\naaa\tbbb\n------------\nccc\tddd<>&\n//}\n")
+ assert_equal %Q|◆→開始:表←◆\nfoo\n\n★aaa☆\t★bbb☆\nccc\tddd<>&\n◆→終了:表←◆\n\n◆→開始:表←◆\n★aaa☆\t★bbb☆\nccc\tddd<>&\n◆→終了:表←◆\n\n|,
+ actual
end
def test_major_blocks
actual = compile_block("//note{\nA\n\nB\n//}\n//note[caption]{\nA\n//}")
expected = %Q(◆→開始:ノート←◆\nA\nB\n◆→終了:ノート←◆\n\n◆→開始:ノート←◆\n■caption\nA\n◆→終了:ノート←◆\n\n)