summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorevie <50974538+mi2ebi@users.noreply.github.com>2025-02-25 06:01:01 -0800
committerGitHub <noreply@github.com>2025-02-25 14:01:01 +0000
commitd11ad80dee669c5e2285ca8df8ebc99abc031ccd (patch)
treeca18c5b71671990314a5c9a6275ccb5fe995ebe1 /tests
parentbad343748b834cdc155c5fe76cd944e74f4665cf (diff)
Add `#str.normalize(form)` (#5631)
Co-authored-by: +merlan #flirora <uruwi@protonmail.com> Co-authored-by: Laurenz <laurmaedje@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/suite/foundations/str.typ7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/suite/foundations/str.typ b/tests/suite/foundations/str.typ
index 56756416..66fb912c 100644
--- a/tests/suite/foundations/str.typ
+++ b/tests/suite/foundations/str.typ
@@ -86,6 +86,13 @@
// Error: 2-28 0x110000 is not a valid codepoint
#str.from-unicode(0x110000) // 0x10ffff is the highest valid code point
+--- str-normalize ---
+// Test the `normalize` method.
+#test("e\u{0301}".normalize(form: "nfc"), "é")
+#test("é".normalize(form: "nfd"), "e\u{0301}")
+#test("ſ\u{0301}".normalize(form: "nfkc"), "ś")
+#test("ſ\u{0301}".normalize(form: "nfkd"), "s\u{0301}")
+
--- string-len ---
// Test the `len` method.
#test("Hello World!".len(), 12)