Skip to content

Commit c0b8bd4

Browse files
panglesdjonludlam
authored andcommitted
adding a test for varying number of cells
Signed-off-by: Paul-Elliot <[email protected]>
1 parent 476bd99 commit c0b8bd4

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

test/test_tables.ml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,5 +681,65 @@ let%expect_test _ =
681681
(warnings
682682
( "File \"f.ml\", line 3, characters 11-18:\
683683
\n'{[...]}' (code block) is not allowed in '{t ...}' (table)."))) |}]
684+
685+
let more_cells_later =
686+
test
687+
{|
688+
{t
689+
| x | y |
690+
|---|---|
691+
| x | y | z |
692+
}
693+
|};
694+
[%expect
695+
{|
696+
((output
697+
(((f.ml (2 6) (6 7))
698+
(table (syntax light)
699+
(data
700+
((row
701+
((header
702+
(((f.ml (3 9) (3 10)) (paragraph (((f.ml (3 9) (3 10)) (word x)))))))
703+
(header
704+
(((f.ml (3 13) (3 14))
705+
(paragraph (((f.ml (3 13) (3 14)) (word y)))))))))
706+
(row
707+
((data
708+
(((f.ml (5 9) (5 10)) (paragraph (((f.ml (5 9) (5 10)) (word x)))))))
709+
(data
710+
(((f.ml (5 13) (5 14))
711+
(paragraph (((f.ml (5 13) (5 14)) (word y)))))))
712+
(data
713+
(((f.ml (5 17) (5 18))
714+
(paragraph (((f.ml (5 17) (5 18)) (word z)))))))))))
715+
(align (center center))))))
716+
(warnings ())) |}]
717+
718+
let less_cells_later =
719+
test
720+
{|
721+
{t
722+
| x | y |
723+
|---|---|
724+
x
725+
}
726+
|};
727+
[%expect
728+
{|
729+
((output
730+
(((f.ml (2 6) (6 7))
731+
(table (syntax light)
732+
(data
733+
((row
734+
((header
735+
(((f.ml (3 9) (3 10)) (paragraph (((f.ml (3 9) (3 10)) (word x)))))))
736+
(header
737+
(((f.ml (3 13) (3 14))
738+
(paragraph (((f.ml (3 13) (3 14)) (word y)))))))))
739+
(row
740+
((data
741+
(((f.ml (5 7) (5 8)) (paragraph (((f.ml (5 7) (5 8)) (word x)))))))))))
742+
(align (center center))))))
743+
(warnings ())) |}]
684744
end in
685745
()

0 commit comments

Comments
 (0)