fix tests
This commit is contained in:
39
tests/kim.cm
Normal file
39
tests/kim.cm
Normal 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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user