diff options
| author | Erik Bünnig <github@epbuennig.me> | 2023-05-30 18:11:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-30 18:11:30 +0200 |
| commit | b805c5f10080912cbfb1fd2fd2733c48a92ce4f9 (patch) | |
| tree | a97a4aca4d2ba05056bac0f9e9ae9075bccfeb52 /tests | |
| parent | 789a54f9e5fcebf4a3b3945d36ce3db7674b0fbc (diff) | |
Unicode code point conversion (#1068) (#1132)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/typ/compute/construct.typ | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/typ/compute/construct.typ b/tests/typ/compute/construct.typ index aea15b53..f094b6b2 100644 --- a/tests/typ/compute/construct.typ +++ b/tests/typ/compute/construct.typ @@ -83,6 +83,27 @@ #str(1.23, base: 2) --- +// Test the unicode function. +#test(str.from-unicode(97), "a") +#test(str.to-unicode("a"), 97) + +--- +// Error: 19-22 expected integer, found content +#str.from-unicode([a]) + +--- +// Error: 17-21 expected exactly one character +#str.to-unicode("ab") + +--- +// Error: 19-21 0xffffffffffffffff is not a valid codepoint +#str.from-unicode(-1) // negative values are not valid + +--- +// Error: 19-27 0x110000 is not a valid codepoint +#str.from-unicode(0x110000) // 0x10ffff is the highest valid code point + +--- #assert(range(2, 5) == (2, 3, 4)) --- |
