fix tests

This commit is contained in:
2025-12-05 23:21:07 -06:00
parent 744f64b83b
commit ea510d609f
75 changed files with 2098 additions and 2164 deletions

39
tests/kim.cm Normal file
View File

@@ -0,0 +1,39 @@
var kim = use("kim");
var blob = use('blob')
return {
ascii_basic: function() {
var input = "Hello, World!";
var encoded = kim.encode(input);
var decoded = kim.decode(encoded);
if (input != decoded) throw "ASCII encoding/decoding failed"
},
unicode_multilingual: function() {
var input = "Hello, 世界! 🌍 Привет мир";
var encoded = kim.encode(input);
var decoded = kim.decode(encoded);
if (input != decoded) throw "Unicode multilingual encoding/decoding failed"
},
empty_string: function() {
var input = " ";
var encoded = kim.encode(input);
var decoded = kim.decode(encoded);
if (input != decoded) throw "Empty string encoding/decoding failed"
},
mixed_unicode_ranges: function() {
var input = "αβγδε АБВГД 你好 😀😎🎉 ∑∏∫";
var encoded = kim.encode(input);
var decoded = kim.decode(encoded);
if (input != decoded) throw "Mixed Unicode ranges encoding/decoding failed"
},
high_codepoints: function() {
var input = "🌍🌎🌏🗺️🧭";
var encoded = kim.encode(input);
var decoded = kim.decode(encoded);
if (input != decoded) throw "High codepoints encoding/decoding failed"
}
}