mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
Enable node:vfs by default. --no-experimental-vfs disables node:vfs exposure and --vfs-load. Assisted-by: pi Signed-off-by: Matteo Collina <hello@matteocollina.com> PR-URL: https://github.com/nodejs/node/pull/66318 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it>
25 lines
664 B
JavaScript
25 lines
664 B
JavaScript
// Flags: --disable-warning=ExperimentalWarning
|
|
'use strict';
|
|
|
|
// VFS stats must have non-zero, unique ino and a distinctive dev.
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const vfs = require('node:vfs');
|
|
|
|
const myVfs = vfs.create();
|
|
myVfs.writeFileSync('/f1.txt', 'a');
|
|
myVfs.writeFileSync('/f2.txt', 'b');
|
|
|
|
const s1 = myVfs.statSync('/f1.txt');
|
|
const s2 = myVfs.statSync('/f2.txt');
|
|
|
|
// Dev should be distinctive VFS value (4085 = 0xVF5)
|
|
assert.strictEqual(s1.dev, 4085);
|
|
assert.strictEqual(s2.dev, 4085);
|
|
|
|
// Ino should be unique per call
|
|
assert.notStrictEqual(s1.ino, 0);
|
|
assert.notStrictEqual(s2.ino, 0);
|
|
assert.notStrictEqual(s1.ino, s2.ino);
|