blob: 15b44da9121cb0b760606d78921e9399a06aca3f [file] [log] [blame]
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
var strings = [
"Cocoa",
"Cappuccino",
"Matcha",
"Cocoa\u0080",
"𠮷野家", // Japanese Beef-bowl shop name including surrogate-pairs.
"📱",
];
for (let lhs of strings) {
for (let rhs of strings) {
let expected = $vm.make16BitStringIfPossible(lhs).localeCompare($vm.make16BitStringIfPossible(rhs));
let result = lhs.localeCompare(rhs);
shouldBe(result, expected);
}
}