summaryrefslogtreecommitdiff
path: root/tests/typ/compiler/string.typ
diff options
context:
space:
mode:
Diffstat (limited to 'tests/typ/compiler/string.typ')
-rw-r--r--tests/typ/compiler/string.typ8
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🏑")