mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
test: adapt test-fs-write to V8 internal changes
PR-URL: https://github.com/nodejs/node/pull/49639 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
1 file changed
+19
-6
@@ -35,13 +35,23 @@ const fn4 = tmpdir.resolve('write4.txt');
|
||||
const expected = 'ümlaut.';
|
||||
const constants = fs.constants;
|
||||
|
||||
const { externalizeString, isOneByteString } = global;
|
||||
const {
|
||||
createExternalizableString,
|
||||
externalizeString,
|
||||
isOneByteString,
|
||||
} = global;
|
||||
|
||||
// Account for extra globals exposed by --expose_externalize_string.
|
||||
common.allowGlobals(externalizeString, isOneByteString, global.x);
|
||||
common.allowGlobals(
|
||||
createExternalizableString,
|
||||
externalizeString,
|
||||
isOneByteString,
|
||||
global.x,
|
||||
);
|
||||
|
||||
{
|
||||
const expected = 'ümlaut sechzig'; // Must be a unique string.
|
||||
// Must be a unique string.
|
||||
const expected = createExternalizableString('ümlaut sechzig');
|
||||
externalizeString(expected);
|
||||
assert.strictEqual(isOneByteString(expected), true);
|
||||
const fd = fs.openSync(fn, 'w');
|
||||
@@ -51,7 +61,8 @@ common.allowGlobals(externalizeString, isOneByteString, global.x);
|
||||
}
|
||||
|
||||
{
|
||||
const expected = 'ümlaut neunzig'; // Must be a unique string.
|
||||
// Must be a unique string.
|
||||
const expected = createExternalizableString('ümlaut neunzig');
|
||||
externalizeString(expected);
|
||||
assert.strictEqual(isOneByteString(expected), true);
|
||||
const fd = fs.openSync(fn, 'w');
|
||||
@@ -61,7 +72,8 @@ common.allowGlobals(externalizeString, isOneByteString, global.x);
|
||||
}
|
||||
|
||||
{
|
||||
const expected = 'Zhōngwén 1'; // Must be a unique string.
|
||||
// Must be a unique string.
|
||||
const expected = createExternalizableString('Zhōngwén 1');
|
||||
externalizeString(expected);
|
||||
assert.strictEqual(isOneByteString(expected), false);
|
||||
const fd = fs.openSync(fn, 'w');
|
||||
@@ -71,7 +83,8 @@ common.allowGlobals(externalizeString, isOneByteString, global.x);
|
||||
}
|
||||
|
||||
{
|
||||
const expected = 'Zhōngwén 2'; // Must be a unique string.
|
||||
// Must be a unique string.
|
||||
const expected = createExternalizableString('Zhōngwén 2');
|
||||
externalizeString(expected);
|
||||
assert.strictEqual(isOneByteString(expected), false);
|
||||
const fd = fs.openSync(fn, 'w');
|
||||
|
||||
Reference in new issue
Block a user