blob: c7d43ec7ea9853a4c4c267a6819e63c7d4e33dc2 [file] [log] [blame]
40 columns |
### Tests for how a line comment in a record literal causes newlines to be kept.
>>> Preserve newlines if record contains a line comment.
record = (
// yeah
a,b,c,d,
e,f,g,h
);
<<<
record = (
// yeah
a, b, c, d,
e, f, g, h,
);
>>> Don't preserve newlines if line comment is inside an element.
record = (
1, 2, 3,
f(
arg // c
),
);
<<<
record = (
1,
2,
3,
f(
arg, // c
),
);
>>> Wrap between elements when newlines are preserved if they don't fit.
record = (
element1, element2, element3, element4, element5,
element6, element7,
// comment
element8, element9, element10, element11,
);
<<<
record = (
element1,
element2,
element3,
element4,
element5,
element6, element7,
// comment
element8,
element9,
element10,
element11,
);