mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-15 04:23:12 +03:00
fb0bbc00cb
* 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;
|
|
}
|