From 48a0b7f98f568bb5c3a15b487459569e38e4c671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 15 Mar 2023 21:35:13 -0400 Subject: feat(fs): support FileInfo.dev on Windows (#18073) This commit adds support for retrieving `dev` information when stating files on Windows. Additionally `Deno.FileInfo` interfaces was changed to always return 0 for fields that we don't retrieve information for on Windows. Closes https://github.com/denoland/deno/issues/18053 --------- Co-authored-by: David Sherret --- cli/tests/unit/stat_test.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'cli/tests/unit') diff --git a/cli/tests/unit/stat_test.ts b/cli/tests/unit/stat_test.ts index 50149cae6..572e54e25 100644 --- a/cli/tests/unit/stat_test.ts +++ b/cli/tests/unit/stat_test.ts @@ -291,22 +291,22 @@ Deno.test( ignore: Deno.build.os !== "windows", permissions: { read: true, write: true }, }, - function statNoUnixFields() { + function statUnixFieldsOnWindows() { const enc = new TextEncoder(); const data = enc.encode("Hello"); const tempDir = Deno.makeTempDirSync(); const filename = tempDir + "/test.txt"; Deno.writeFileSync(filename, data, { mode: 0o666 }); const s = Deno.statSync(filename); - assert(s.dev === null); - assert(s.ino === null); - assert(s.mode === null); - assert(s.nlink === null); - assert(s.uid === null); - assert(s.gid === null); - assert(s.rdev === null); - assert(s.blksize === null); - assert(s.blocks === null); + assert(s.dev !== 0); + assert(s.ino === 0); + assert(s.mode === 0); + assert(s.nlink === 0); + assert(s.uid === 0); + assert(s.gid === 0); + assert(s.rdev === 0); + assert(s.blksize === 0); + assert(s.blocks === 0); }, ); -- cgit v1.2.3