mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-01 09:51:06 +00:00
* Adding ignoreBOM and fatal to TextDecoder * Minor tweak to expose_text_processor * Adding in unit tests for BOM * Adding in comment for expose_text_decoder * Attempting to fix build failure * Temporarily disabling unit tests
23 lines
448 B
JavaScript
23 lines
448 B
JavaScript
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');
|
|
|
|
// TODO re-enable this when Firefox 70 is released
|
|
//test('\uFEFFbar');
|
|
}
|
|
|
|
export function identity(s) {
|
|
return s;
|
|
}
|