Add a debug assert and more tests

This commit is contained in:
Alex Crichton
2019-05-13 08:12:32 -07:00
parent 0c681ee2ba
commit 15defcfd3a
6 changed files with 61 additions and 1 deletions

15
tests/headless/strings.js Normal file
View File

@ -0,0 +1,15 @@
export function test_string_roundtrip(f) {
const test = expected => {
const actual = f(expected);
if (actual === expected)
return;
throw new Error(`string roundtrip "${actual}" != "${expected}"`);
};
test('');
test('a');
test('💖');
test('a longer string');
test('a longer 💖 string');
}