aboutsummaryrefslogtreecommitdiff
path: root/test/unit/mbyte_spec.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-09-29 11:03:36 +0200
committerGitHub <noreply@github.com>2024-09-29 11:03:36 +0200
commit610e9666af0ef16f3677b23a5c341c8817c89965 (patch)
treec0ebbbbb15f648c7e0d04248e193085dba762d40 /test/unit/mbyte_spec.lua
parent69553f7bf55c060733553d96a068c1104c885bce (diff)
parent2dfa6f6033f762243f776025aeb7dbc2b383342b (diff)
downloadrneovim-610e9666af0ef16f3677b23a5c341c8817c89965.tar.gz
rneovim-610e9666af0ef16f3677b23a5c341c8817c89965.tar.bz2
rneovim-610e9666af0ef16f3677b23a5c341c8817c89965.zip
Merge pull request #30401 from bfredl/casefold2
refactor(multibyte): neo-casefolding without allocation
Diffstat (limited to 'test/unit/mbyte_spec.lua')
-rw-r--r--test/unit/mbyte_spec.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/unit/mbyte_spec.lua b/test/unit/mbyte_spec.lua
index e0c0244989..0a322ce651 100644
--- a/test/unit/mbyte_spec.lua
+++ b/test/unit/mbyte_spec.lua
@@ -351,6 +351,12 @@ describe('mbyte', function()
describe('utf_fold', function()
itp('does not crash with surrogates #30527', function()
eq(0xDDFB, lib.utf_fold(0xDDFB))
+ eq(0xd800, lib.utf_fold(0xd800)) -- high surrogate, invalid as a character
+ end)
+
+ itp("doesn't crash on invalid codepoints", function()
+ eq(9000000, lib.utf_fold(9000000))
+ eq(0, lib.utf_fold(0))
end)
end)
end)