diff options
Diffstat (limited to 'tests/typ/compiler/string.typ')
| -rw-r--r-- | tests/typ/compiler/string.typ | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/typ/compiler/string.typ b/tests/typ/compiler/string.typ index 9a4b4146..c4c1669e 100644 --- a/tests/typ/compiler/string.typ +++ b/tests/typ/compiler/string.typ @@ -29,6 +29,10 @@ #test("Hey: π³οΈβπ there!".at(5), "π³οΈβπ") --- +// Test `at`'s 'default' parameter. +#test("z", "Hello".at(5, default: "z")) + +--- // Error: 2-14 string index 2 is not a character boundary #"π³οΈβπ".at(2) @@ -37,6 +41,10 @@ #"Hello".at(5) --- +// Error: 25-32 expected string, found dictionary +#"Hello".at(5, default: (a: 10)) + +--- // Test the `slice` method. #test("abc".slice(1, 2), "b") #test("abcπ‘def".slice(2, 7), "cπ‘") |
