diff options
| author | Martin Haug <mhaug@live.de> | 2023-01-30 21:04:34 +0100 |
|---|---|---|
| committer | Martin Haug <mhaug@live.de> | 2023-01-30 21:04:34 +0100 |
| commit | 0287b98ef31172c6da4d5a4c76d8d88d1d5c9049 (patch) | |
| tree | 000bd243993a5212ce52c08374cf20cd0f61bcf9 /tests/typ/compiler | |
| parent | 1ea0a933254d866e00acb9034bba39a5f4790682 (diff) | |
Add calc module
Diffstat (limited to 'tests/typ/compiler')
| -rw-r--r-- | tests/typ/compiler/array.typ | 4 | ||||
| -rw-r--r-- | tests/typ/compiler/break-continue.typ | 4 | ||||
| -rw-r--r-- | tests/typ/compiler/spread.typ | 10 | ||||
| -rw-r--r-- | tests/typ/compiler/string.typ | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/tests/typ/compiler/array.typ b/tests/typ/compiler/array.typ index 3d4d6106..2fea8632 100644 --- a/tests/typ/compiler/array.typ +++ b/tests/typ/compiler/array.typ @@ -148,8 +148,8 @@ --- // Test the `filter` method. -#test(().filter(even), ()) -#test((1, 2, 3, 4).filter(even), (2, 4)) +#test(().filter(calc.even), ()) +#test((1, 2, 3, 4).filter(calc.even), (2, 4)) #test((7, 3, 2, 5, 1).filter(x => x < 5), (3, 2, 1)) --- diff --git a/tests/typ/compiler/break-continue.typ b/tests/typ/compiler/break-continue.typ index 566234a7..e1041551 100644 --- a/tests/typ/compiler/break-continue.typ +++ b/tests/typ/compiler/break-continue.typ @@ -41,7 +41,7 @@ #while x < 8 { i += 1 - if mod(i, 3) == 0 { + if calc.mod(i, 3) == 0 { continue } x += i @@ -55,7 +55,7 @@ #let x = for i in range(5) { "a" - if mod(i, 3) == 0 { + if calc.mod(i, 3) == 0 { "_" continue } diff --git a/tests/typ/compiler/spread.typ b/tests/typ/compiler/spread.typ index ce3d8cea..e5724739 100644 --- a/tests/typ/compiler/spread.typ +++ b/tests/typ/compiler/spread.typ @@ -37,9 +37,9 @@ // Test spreading array and dictionary. #{ let more = (3, -3, 6, 10) - test(min(1, 2, ..more), -3) - test(max(..more, 9), 10) - test(max(..more, 11), 11) + test(calc.min(1, 2, ..more), -3) + test(calc.max(..more, 9), 10) + test(calc.max(..more, 11), 11) } #{ @@ -56,8 +56,8 @@ #f(..for x in () []) --- -// Error: 8-14 cannot spread string -#min(.."nope") +// Error: 13-19 cannot spread string +#calc.min(.."nope") --- // Error: 10-14 expected identifier, found boolean diff --git a/tests/typ/compiler/string.typ b/tests/typ/compiler/string.typ index 57699074..d96213b6 100644 --- a/tests/typ/compiler/string.typ +++ b/tests/typ/compiler/string.typ @@ -88,7 +88,7 @@ let caps = match.captures time += 60 * int(caps.at(0)) + int(caps.at(1)) } - str(int(time / 60)) + ":" + str(mod(time, 60)) + str(int(time / 60)) + ":" + str(calc.mod(time, 60)) } #test(timesum(""), "0:0") |
