summaryrefslogtreecommitdiff
path: root/cli/tests/unit/stat_test.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-03-15 21:35:13 -0400
committerGitHub <noreply@github.com>2023-03-16 02:35:13 +0100
commit48a0b7f98f568bb5c3a15b487459569e38e4c671 (patch)
treed7a7aba5da5a019874b1c8cd534eb2b22b86b1a9 /cli/tests/unit/stat_test.ts
parent92c3ac30346fddc138a5d83cb67c87ac23e69dae (diff)
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 <dsherret@gmail.com>
Diffstat (limited to 'cli/tests/unit/stat_test.ts')
-rw-r--r--cli/tests/unit/stat_test.ts20
1 files changed, 10 insertions, 10 deletions
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);
},
);