summaryrefslogtreecommitdiff
path: root/tests/typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-02-17 10:29:55 +0100
committerLaurenz <laurmaedje@gmail.com>2023-02-17 10:53:47 +0100
commitdd5f07eb9110cc5e19dcb4441743a323128426fc (patch)
tree010384b8c8ab7a129df65bc0c802a1ac039beebb /tests/typ
parent585f6564874d16a8f81a6c29e73091a008ccd484 (diff)
Add `clusters` and `codepoints` methods
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/compiler/string.typ7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/typ/compiler/string.typ b/tests/typ/compiler/string.typ
index 017e1cdd..7692b41f 100644
--- a/tests/typ/compiler/string.typ
+++ b/tests/typ/compiler/string.typ
@@ -46,6 +46,13 @@
#"🏳️‍🌈".slice(0, -1)
---
+// Test the `clusters` and `codepoints` methods.
+#test("abc".clusters(), ("a", "b", "c"))
+#test("abc".clusters(), ("a", "b", "c"))
+#test("🏳️‍🌈!".clusters(), ("🏳️‍🌈", "!"))
+#test("🏳️‍🌈!".codepoints(), ("🏳", "\u{fe0f}", "\u{200d}", "🌈", "!"))
+
+---
// Test the `contains` method.
#test("abc".contains("b"), true)
#test("b" in "abc", true)