summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-12-13 15:13:27 +1100
committerdaurnimator <quae@daurnimator.com>2017-12-13 15:13:27 +1100
commit3e7c102eefbaae9e6bc839b11bba79aee1c5e040 (patch)
treec811b42cc9ffb08a0bf8a93d6141324d707f4953 /tests
parentd1d2a636ea67c2e30a34660eeb6c7da544646bea (diff)
downloadfengari-3e7c102eefbaae9e6bc839b11bba79aee1c5e040.tar.gz
fengari-3e7c102eefbaae9e6bc839b11bba79aee1c5e040.tar.bz2
fengari-3e7c102eefbaae9e6bc839b11bba79aee1c5e040.zip
Introduce defs.string_of to create string from bytes
Diffstat (limited to 'tests')
-rw-r--r--tests/defs.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/defs.js b/tests/defs.js
index 8c0098a..1a935d6 100644
--- a/tests/defs.js
+++ b/tests/defs.js
@@ -6,37 +6,37 @@ const unicode_tests = [
{
description: "Convert normal ascii string",
literal: "foo",
- byte_array: ["f".charCodeAt(0), "o".charCodeAt(0), "o".charCodeAt(0)]
+ byte_array: defs.string_of("f".charCodeAt(0), "o".charCodeAt(0), "o".charCodeAt(0))
},
{
description: "Convert ascii string containing null byte",
literal: "fo\0o",
- byte_array: ["f".charCodeAt(0), "o".charCodeAt(0), 0, "o".charCodeAt(0)]
+ byte_array: defs.string_of("f".charCodeAt(0), "o".charCodeAt(0), 0, "o".charCodeAt(0))
},
{
description: "Convert string with BMP unicode chars",
literal: "Café",
- byte_array: [67, 97, 102, 195, 169]
+ byte_array: defs.string_of(67, 97, 102, 195, 169)
},
{
description: "Convert string with codepoint in PUA (U+E000 to U+F8FF)",
literal: "",
- byte_array: [239, 163, 191]
+ byte_array: defs.string_of(239, 163, 191)
},
{
description: "Convert string with surrogate pair",
literal: "❤️🍾",
- byte_array: [226, 157, 164, 239, 184, 143, 240, 159, 141, 190]
+ byte_array: defs.string_of(226, 157, 164, 239, 184, 143, 240, 159, 141, 190)
},
{
description: "Convert string with broken surrogate pair",
literal: "\uD800a",
- byte_array: [237, 160, 128, 97]
+ byte_array: defs.string_of(237, 160, 128, 97)
},
{
description: "Convert string with broken surrogate pair at end of string",
literal: "\uD823",
- byte_array: [237, 160, 163]
+ byte_array: defs.string_of(237, 160, 163)
}
];