test/test_topbuilder.rb in review-2.4.0 vs test/test_topbuilder.rb in review-2.5.0

- old
+ new

@@ -146,11 +146,11 @@ 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 + assert_equal %Q(★foo☆\n\tfoo.\n\npara\n\n★foo☆\n\tfoo.\n\n1\tbar\n\n★foo☆\n\tfoo.\n\n●\tbar\n\n), actual end def test_paragraph actual = compile_block("foo\nbar\n") assert_equal %Q(foobar\n), actual @@ -164,10 +164,15 @@ def test_flushright actual = compile_block("//flushright{\nfoo\nbar\n\nbuz\n//}\n") assert_equal %Q(◆→開始:右寄せ←◆\nfoobar\nbuz\n◆→終了:右寄せ←◆\n\n), actual end + def test_blankline + actual = compile_block("//blankline\nfoo\n") + assert_equal %Q(\nfoo\n), actual + end + def test_noindent actual = compile_block("//noindent\nfoo\nbar\n\nfoo2\nbar2\n") assert_equal %Q(◆→DTP連絡:次の1行インデントなし←◆\nfoobar\nfoo2bar2\n), actual end @@ -288,9 +293,26 @@ end def test_texequation actual = compile_block("//texequation{\n\\sin\n1^{2}\n//}\n") assert_equal %Q(◆→開始:TeX式←◆\n\\sin\n1^{2}\n◆→終了:TeX式←◆\n\n), actual + end + + def test_inline_unknown + e = assert_raises(ReVIEW::ApplicationError) { compile_block "@<img>{n}\n" } + assert_equal ':1: error: unknown image: n', e.message + e = assert_raises(ReVIEW::ApplicationError) { compile_block "@<fn>{n}\n" } + assert_equal ':1: error: unknown footnote: n', e.message + e = assert_raises(ReVIEW::ApplicationError) { compile_block "@<hd>{n}\n" } + assert_equal ':1: error: unknown headline: n', e.message + %w[list table column].each do |name| + e = assert_raises(ReVIEW::ApplicationError) { compile_block "@<#{name}>{n}\n" } + assert_equal ":1: error: unknown #{name}: n", e.message + end + %w[chap chapref title].each do |name| + e = assert_raises(ReVIEW::ApplicationError) { compile_block "@<#{name}>{n}\n" } + assert_equal ':1: error: key not found: "n"', e.message + end end def test_inline_raw0 assert_equal 'normal', compile_inline('@<raw>{normal}') end