diff options
| author | Leedehai <18319900+Leedehai@users.noreply.github.com> | 2024-04-03 05:01:50 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-03 09:01:50 +0000 |
| commit | 0619ae98a86ee5179663aad4ef0575e6b4a284cc (patch) | |
| tree | fc2e86ee3b38c42503ab0d628c1dd79d9fd626ff /tests | |
| parent | 0b9878ed318d23e96a853ef025ea6b036673c2a8 (diff) | |
Fix newline parsing behavior in code mode (#3780)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/typ/bugs/newline-mode.typ | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/typ/bugs/newline-mode.typ b/tests/typ/bugs/newline-mode.typ index 30545eee..04333cc5 100644 --- a/tests/typ/bugs/newline-mode.typ +++ b/tests/typ/bugs/newline-mode.typ @@ -22,3 +22,63 @@ else { ("1", "2") } + +--- +// Ref: false +#test({ + "hi 1" + + .clusters() +}, ("h", "i", " ", "1")) + +--- +// Ref: false +#test({ + "hi 2"// comment + .clusters() +}, ("h", "i", " ", "2")) + +--- +// Ref: false +#test({ + "hi 3"/* comment */ + .clusters() +}, ("h", "i", " ", "3")) + +--- +// Ref: false +#test({ + "hi 4" + // comment + .clusters() +}, ("h", "i", " ", "4")) + +--- +// Ref: false +#test({ + "hi 5" + /*comment*/.clusters() +}, ("h", "i", " ", "5")) + +--- +// Ref: false +#test({ + "hi 6" + // comment + + + /* comment */ + .clusters() +}, ("h", "i", " ", "6")) + +--- +// Ref: false +#test({ + let foo(x) = { + if x < 0 { "negative" } + // comment + else { "non-negative" } + } + + foo(1) +}, "non-negative") |
