From dc57ab7bdcfc808c68d3d99f644d4ae23f0a6ccb Mon Sep 17 00:00:00 2001 From: PoiScript Date: Tue, 5 Nov 2019 23:51:05 +0800 Subject: [PATCH] test: add table parsing and rendering test --- tests/parse.rs | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/tests/parse.rs b/tests/parse.rs index 33a6de8..974949e 100644 --- a/tests/parse.rs +++ b/tests/parse.rs @@ -89,3 +89,68 @@ paragraph 4

paragraph 3

paragraph 4

\ " ); + +test_suite!( + table1, + r#" +|-----+-----+-----| +| 0 | 1 | 2 | +|-----+-----+-----| +| 4 | 5 | 6 | +"#, + "
\ + \ + \ +
012
456
" +); + +test_suite!( + table2, + r#" +|-----+-----+-----| +| 0 | 1 | 2 | +| 4 | 5 | 6 | +|-----+-----+-----| +"#, + "
\ + \ + \ +
012
456
" +); + +test_suite!( + table3, + r#" +|-----+-----+-----| +|-----+-----+-----| +| 0 | 1 | 2 | +| 4 | 5 | 6 | +"#, + "
\ + \ + \ +
012
456
" +); + +test_suite!( + table4, + r#" +| 0 | 1 | 2 | +| 4 | 5 | 6 | +|-----+-----+-----| +|-----+-----+-----| +"#, + "
\ + \ + \ +
012
456
" +); + +test_suite!( + table5, + r#" +|-----+-----+-----| +|-----+-----+-----| +"#, + "
" +);