Skip to content

Commit

Permalink
tests to warn when a table is unclosed
Browse files Browse the repository at this point in the history
  • Loading branch information
lubegasimon committed Nov 30, 2023
1 parent 3a5f9af commit f7fa297
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/parser/test/test_tables.ml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ let%expect_test _ =
(align "no alignment")))))
(warnings ())) |}]

let unclosed_table =
test "{table {tr {td}}";
[%expect
{|
((output
(((f.ml (1 0) (1 16))
(table (syntax heavy) (grid ((row ((data ()))))) (align "no alignment")))))
(warnings
( "File \"f.ml\", line 1, characters 16-16:\
\nUnclosed table '{t ...' or '{table ...'\
\nSuggestion: try to add '}' at the end of table content."))) |}]

let complex_table =
test
{|
Expand Down Expand Up @@ -190,6 +202,18 @@ let%expect_test _ =
(table (syntax light) (grid ()) (align "no alignment")))))
(warnings ())) |}]

let unclosed_table =
test "{t ";
[%expect
{|
((output
(((f.ml (1 0) (1 3))
(table (syntax light) (grid ()) (align "no alignment")))))
(warnings
( "File \"f.ml\", line 1, characters 2-3:\
\nUnclosed table '{t ...' or '{table ...'\
\nSuggestion: try to add '}' at the end of table content."))) |}]

let simple =
test {|
{t
Expand Down

0 comments on commit f7fa297

Please sign in to comment.