From db09f6704095152ea4b4ae3f43aefcb7e5bd5e86 Mon Sep 17 00:00:00 2001 From: lubegasimon Date: Thu, 30 Nov 2023 17:28:17 +0300 Subject: [PATCH] tests to warn when a table is unclosed --- test/xref2/github_issue_1043.t/run.t | 17 +++++++++++++++++ .../unclosed_heavy_table.mli | 9 +++++++++ .../unclosed_light_table.mli | 7 +++++++ 3 files changed, 33 insertions(+) create mode 100644 test/xref2/github_issue_1043.t/run.t create mode 100644 test/xref2/github_issue_1043.t/unclosed_heavy_table.mli create mode 100644 test/xref2/github_issue_1043.t/unclosed_light_table.mli diff --git a/test/xref2/github_issue_1043.t/run.t b/test/xref2/github_issue_1043.t/run.t new file mode 100644 index 0000000000..236bf3f748 --- /dev/null +++ b/test/xref2/github_issue_1043.t/run.t @@ -0,0 +1,17 @@ +#Repro for github issue 1043 (unclosed table) + +Warns when a table is unclosed. + $ ocamlc -bin-annot -c unclosed_light_table.mli + + $ odoc compile unclosed_light_table.cmti + File "unclosed_light_table.mli", line 7, characters 1-1: + Warning: Unclosed table '{t ...' or '{table ...' + Suggestion: try to add '}' at the end of table content. + + $ ocamlc -bin-annot -c unclosed_heavy_table.mli + + $ odoc compile unclosed_heavy_table.cmti + File "unclosed_heavy_table.mli", line 9, characters 1-1: + Warning: Unclosed table '{t ...' or '{table ...' + Suggestion: try to add '}' at the end of table content. + diff --git a/test/xref2/github_issue_1043.t/unclosed_heavy_table.mli b/test/xref2/github_issue_1043.t/unclosed_heavy_table.mli new file mode 100644 index 0000000000..3a2ecfbbe8 --- /dev/null +++ b/test/xref2/github_issue_1043.t/unclosed_heavy_table.mli @@ -0,0 +1,9 @@ +(** {table + {tr + {th Header 1} + } + {tr + {td Cell 1} + } + + *) \ No newline at end of file diff --git a/test/xref2/github_issue_1043.t/unclosed_light_table.mli b/test/xref2/github_issue_1043.t/unclosed_light_table.mli new file mode 100644 index 0000000000..92b1e57a0a --- /dev/null +++ b/test/xref2/github_issue_1043.t/unclosed_light_table.mli @@ -0,0 +1,7 @@ + +(** {t + | Header 1 | + | :------: | + | centered | + + *) \ No newline at end of file