diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-29 13:37:25 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-29 14:18:13 +0100 |
| commit | 0efe669278a5e1c3f2985eba2f3360e91159c54a (patch) | |
| tree | 502712857c48f0decb5e698257c0a96d358a436e /tests/typ/code/methods.typ | |
| parent | 836692e73cff0356e409a9ba5b4887b86809d4ca (diff) | |
Reorganize library and tests
Diffstat (limited to 'tests/typ/code/methods.typ')
| -rw-r--r-- | tests/typ/code/methods.typ | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/tests/typ/code/methods.typ b/tests/typ/code/methods.typ deleted file mode 100644 index f5db8ca0..00000000 --- a/tests/typ/code/methods.typ +++ /dev/null @@ -1,50 +0,0 @@ -// Test method calls. -// Ref: false - ---- -// Test whitespace around dot. -#test( "Hi there" . split() , ("Hi", "there")) - ---- -// Test mutating indexed value. -{ - let matrix = (((1,), (2,)), ((3,), (4,))) - matrix(1)(0).push(5) - test(matrix, (((1,), (2,)), ((3, 5), (4,)))) -} - ---- -// Test multiline chain in code block. -{ - let rewritten = "Hello. This is a sentence. And one more." - .split(".") - .map(s => s.trim()) - .filter(s => s != "") - .map(s => s + "!") - .join("\n ") - - test(rewritten, "Hello!\n This is a sentence!\n And one more!") -} - ---- -// Error: 2:3-2:16 type array has no method `fun` -#let numbers = () -{ numbers.fun() } - ---- -// Error: 2:3-2:44 cannot mutate a temporary value -#let numbers = (1, 2, 3) -{ numbers.map(v => v / 2).sorted().map(str).remove(4) } - ---- -// Error: 2:3-2:19 cannot mutate a temporary value -#let numbers = (1, 2, 3) -{ numbers.sorted() = 1 } - ---- -// Error: 3-6 cannot mutate a constant -{ box = 1 } - ---- -// Error: 3-6 cannot mutate a constant -{ box.push(1) } |
