refactor(multibyte): neo-casefolding without allocation

fixes #30400
This commit is contained in:
bfredl
2024-09-16 19:28:37 +02:00
parent 69553f7bf5
commit 2dfa6f6033
2 changed files with 9 additions and 14 deletions

View File

@@ -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)