17,9 → 17,11 |
}, |
{ |
feature: 'new jsx.string.unicode.WideString()', |
description: 'Return new instance', |
description: 'Return new empty instance', |
code: function () { |
assert(new WideString() instanceof WideString); |
var s = new WideString(); |
assert(s instanceof WideString); |
assertArrayEquals([], s.getChars()); |
} |
}, |
{ |
31,6 → 33,13 |
} |
}, |
{ |
feature: 'new jsx.string.unicode.WideString("")', |
description: 'Return new empty instance', |
code: function () { |
assertArrayEquals([], new WideString("").getChars()); |
} |
}, |
{ |
feature: 'new jsx.string.unicode.WideString("x")', |
description: 'Convert to <code>WideString("x")</code>', |
code: function () { |
44,7 → 53,19 |
assertArrayEquals(["4", "2"], new WideString(42).getChars()); |
} |
}, |
|
{ |
feature: 'new jsx.string.unicode.WideString(string).getChars()', |
description: 'Return the correct value', |
code: function () { |
assertArrayEquals([], new WideString().getChars()); |
assertArrayEquals([], new WideString("").getChars()); |
assertArrayEquals(["x"], new WideString("x").getChars()); |
assertArrayEquals(["x", "\uD834\uDD1E"], new WideString("x\uD834\uDD1E").getChars()); |
assertArrayEquals(["x", "\uD834\uDD1E", "y"], new WideString("x\uD834\uDD1Ey").getChars()); |
} |
}, |
{ |
feature: 'new jsx.string.unicode.WideString(string).chars', |
description: 'Getter works', |
code: function () { |
53,6 → 74,25 |
}, |
|
{ |
feature: 'new jsx.string.unicode.WideString(string).getLength()', |
description: 'Return the correct value', |
code: function () { |
assert(new WideString().getLength() === 0); |
assert(new WideString("").getLength() === 0); |
assert(new WideString("x").getLength() === 1); |
assert(new WideString("x\uD834\uDD1E").getLength() === 2); |
assert(new WideString("x\uD834\uDD1Ey").getLength() === 3); |
} |
}, |
{ |
feature: 'new jsx.string.unicode.WideString(string).length', |
description: 'Inherited getter works', |
code: function () { |
assert(new WideString("x").length === 1); |
} |
}, |
|
{ |
feature: 'jsx.string.unicode.WideString.fromCharCode(0x110000)', |
description: 'throw <code>jsx.InvalidArgumentError</code>', |
code: function () { |
75,7 → 115,7 |
}, |
{ |
feature: 'jsx.string.unicode.WideString.fromCharCode(0x1D11E)', |
description: 'return <code>"\\uD834\\uDD1E"</code>', |
description: 'Return <code>"\\uD834\\uDD1E"</code>', |
code: function () { |
var chars = WideString.fromCharCode(0x1D11E).getChars(); |
assertArrayEquals(["\uD834\uDD1E"], chars); |