diff options
| author | Laurenz <laurmaedje@gmail.com> | 2024-04-13 10:39:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-13 08:39:45 +0000 |
| commit | 020294fca9a7065d4b9cf4e677f606ebaaa29b00 (patch) | |
| tree | c0027ad22046e2726c22298461327823d6b88d53 /tests/suite/syntax/newlines.typ | |
| parent | 72dd79210602ecc799726fc096b078afbb47f299 (diff) | |
Better test runner (#3922)
Diffstat (limited to 'tests/suite/syntax/newlines.typ')
| -rw-r--r-- | tests/suite/syntax/newlines.typ | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/tests/suite/syntax/newlines.typ b/tests/suite/syntax/newlines.typ new file mode 100644 index 00000000..eef45619 --- /dev/null +++ b/tests/suite/syntax/newlines.typ @@ -0,0 +1,77 @@ +// Test newline continuations. + +--- newline-continuation-code --- +#{ + "hello" + .clusters() + if false { + + } + else { + ("1", "2") + } +} + +--- newline-continuation-markup --- +#"hello" + .codepoints() + +#if false { + +} +else { + ("1", "2") +} + +--- newline-continuation-method-blank --- +#test({ + "hi 1" + + .clusters() +}, ("h", "i", " ", "1")) + +--- newline-continuation-method-line-comment-after --- +#test({ + "hi 2"// comment + .clusters() +}, ("h", "i", " ", "2")) + +--- newline-continuation-method-block-comment-after --- +#test({ + "hi 3"/* comment */ + .clusters() +}, ("h", "i", " ", "3")) + +--- newline-continuation-method-line-comment-between --- +#test({ + "hi 4" + // comment + .clusters() +}, ("h", "i", " ", "4")) + +--- newline-continuation-method-block-comment-between --- +#test({ + "hi 5" + /*comment*/.clusters() +}, ("h", "i", " ", "5")) + +--- newline-continuation-method-comments-and-blanks --- +#test({ + "hi 6" + // comment + + + /* comment */ + .clusters() +}, ("h", "i", " ", "6")) + +--- newline-continuation-if-else-comment --- +#test({ + let foo(x) = { + if x < 0 { "negative" } + // comment + else { "non-negative" } + } + + foo(1) +}, "non-negative") |
