Skip to content

Commit 02a1b82

Browse files
committed
Check is_nil on every document constructor
Codecov still reported the last line of the is_nil match: its Group, CustomLayout and BreakParent alternatives share the line with the new ones, and no test passed them. The test now checks every constructor. Signed-off-by: Roland Peelen <roland@magic.dev>
1 parent 589db13 commit 02a1b82

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

‎tests/syntax_tests/res_test.ml‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,8 +668,21 @@ module Multiline_item_spacing_test = struct
668668
assert (Doc.will_break Doc.break_parent);
669669
assert (Doc.will_break (Doc.comment Doc.hard_line));
670670
assert (not (Doc.will_break (Doc.comment a)));
671-
assert (not (Doc.is_nil separator));
672-
assert (not (Doc.is_nil (Doc.comment a)));
671+
assert (Doc.is_nil Doc.nil);
672+
[
673+
a;
674+
Doc.line_suffix a;
675+
Doc.concat [a; b];
676+
Doc.indent a;
677+
Doc.trailing_comma;
678+
Doc.line;
679+
Doc.group a;
680+
Doc.custom_layout [a];
681+
Doc.break_parent;
682+
separator;
683+
Doc.comment a;
684+
]
685+
|> List.iter (fun doc -> assert (not (Doc.is_nil doc)));
673686
check "an empty custom layout prints nothing" ~expected:""
674687
(print (Doc.custom_layout []))
675688

0 commit comments

Comments
 (0)