aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-09-16 19:28:37 +0200
committerbfredl <bjorn.linse@gmail.com>2024-09-29 10:14:16 +0200
commit2dfa6f6033f762243f776025aeb7dbc2b383342b (patch)
treec0ebbbbb15f648c7e0d04248e193085dba762d40 /test
parent69553f7bf55c060733553d96a068c1104c885bce (diff)
downloadrneovim-2dfa6f6033f762243f776025aeb7dbc2b383342b.tar.gz
rneovim-2dfa6f6033f762243f776025aeb7dbc2b383342b.tar.bz2
rneovim-2dfa6f6033f762243f776025aeb7dbc2b383342b.zip
refactor(multibyte): neo-casefolding without allocation
fixes #30400
Diffstat (limited to 'test')
-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)