From 3e6ea6284178df0be4982d9775f47b47b14c6139 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Wed, 29 Apr 2020 22:00:31 +0200 Subject: BREAKING: Include limited metadata in 'DirEntry' objects (#4941) This change is to prevent needed a separate stat syscall for each file when using readdir. For consistency, this PR also modifies std's `WalkEntry` interface to extend `DirEntry` with an additional `path` field. --- cli/js/tests/read_dir_test.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'cli/js/tests/read_dir_test.ts') diff --git a/cli/js/tests/read_dir_test.ts b/cli/js/tests/read_dir_test.ts index 2c7f42103..f1c7ea121 100644 --- a/cli/js/tests/read_dir_test.ts +++ b/cli/js/tests/read_dir_test.ts @@ -4,19 +4,14 @@ import { unitTest, assert, assertEquals } from "./test_util.ts"; function assertSameContent(files: Deno.DirEntry[]): void { let counter = 0; - for (const file of files) { - if (file.name === "subdir") { - assert(file.isDirectory); - counter++; - } - - if (file.name === "002_hello.ts") { - assertEquals(file.mode!, Deno.statSync(`cli/tests/${file.name}`).mode!); + for (const entry of files) { + if (entry.name === "subdir") { + assert(entry.isDirectory); counter++; } } - assertEquals(counter, 2); + assertEquals(counter, 1); } unitTest({ perms: { read: true } }, function readdirSyncSuccess(): void { -- cgit v1.2.3