From 10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 14:41:41 +0200 Subject: Merging upstream version 1.70.0+dfsg2. Signed-off-by: Daniel Baumann --- vendor/wasm-bindgen/tests/headless/strings.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 vendor/wasm-bindgen/tests/headless/strings.js (limited to 'vendor/wasm-bindgen/tests/headless/strings.js') diff --git a/vendor/wasm-bindgen/tests/headless/strings.js b/vendor/wasm-bindgen/tests/headless/strings.js new file mode 100644 index 000000000..866bad653 --- /dev/null +++ b/vendor/wasm-bindgen/tests/headless/strings.js @@ -0,0 +1,21 @@ +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'); + + test('\uFEFFbar'); +} + +export function identity(s) { + return s; +} -- cgit v1.2.3