remove dynamic equality
This commit is contained in:
@@ -5,7 +5,7 @@ var test1 = "Hello";
|
||||
log.console("ASCII length test:");
|
||||
log.console(" Characters:", utf8.length(test1));
|
||||
log.console(" Bytes:", utf8.byte_length(test1));
|
||||
log.console(" Match:", utf8.length(test1) === utf8.byte_length(test1) ? "PASS" : "FAIL");
|
||||
log.console(" Match:", utf8.length(test1) == utf8.byte_length(test1) ? "PASS" : "FAIL");
|
||||
|
||||
var test2 = "Hello 世界";
|
||||
log.console("\nMixed ASCII/Unicode length test:");
|
||||
@@ -19,14 +19,14 @@ var codepoints = utf8.codepoints(test3);
|
||||
log.console("\nCodepoints test:");
|
||||
log.console(" String:", test3);
|
||||
log.console(" Codepoints:", codepoints);
|
||||
log.console(" A=65:", codepoints[0] === 65 ? "PASS" : "FAIL");
|
||||
log.console(" 😀=128512:", codepoints[1] === 128512 ? "PASS" : "FAIL");
|
||||
log.console(" B=66:", codepoints[2] === 66 ? "PASS" : "FAIL");
|
||||
log.console(" A=65:", codepoints[0] == 65 ? "PASS" : "FAIL");
|
||||
log.console(" 😀=128512:", codepoints[1] == 128512 ? "PASS" : "FAIL");
|
||||
log.console(" B=66:", codepoints[2] == 66 ? "PASS" : "FAIL");
|
||||
|
||||
// Test from_codepoints
|
||||
var reconstructed = utf8.from_codepoints(codepoints);
|
||||
log.console(" Reconstructed:", reconstructed);
|
||||
log.console(" Match:", test3 === reconstructed ? "PASS" : "FAIL");
|
||||
log.console(" Match:", test3 == reconstructed ? "PASS" : "FAIL");
|
||||
|
||||
// Test encode/decode
|
||||
var test4 = "UTF-8 encoding: 你好世界 🌍";
|
||||
@@ -35,7 +35,7 @@ var decoded = utf8.decode(encoded);
|
||||
log.console("\nEncode/decode test:");
|
||||
log.console(" Original:", test4);
|
||||
log.console(" Decoded:", decoded);
|
||||
log.console(" Match:", test4 === decoded ? "PASS" : "FAIL");
|
||||
log.console(" Match:", test4 == decoded ? "PASS" : "FAIL");
|
||||
|
||||
// Test validation
|
||||
log.console("\nValidation tests:");
|
||||
|
||||
Reference in New Issue
Block a user