From 5c4189a3b8aa80e05088a4b01ecd5eccdd1540fb Mon Sep 17 00:00:00 2001 From: "Kevin (Kun) \"Kassimo\" Qian" Date: Tue, 26 Mar 2019 19:47:17 -0700 Subject: Do not close file on invalid seek mode (#2004) --- js/files_test.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'js/files_test.ts') diff --git a/js/files_test.ts b/js/files_test.ts index 7e5bbf5f0..0decd9f00 100644 --- a/js/files_test.ts +++ b/js/files_test.ts @@ -198,4 +198,10 @@ testPerm({ read: true }, async function seekMode() { assert(!!err); assertEquals(err.kind, Deno.ErrorKind.InvalidSeekMode); assertEquals(err.name, "InvalidSeekMode"); + + // We should still be able to read the file + // since it is still open. + let buf = new Uint8Array(1); + await file.read(buf); // "H" + assertEquals(new TextDecoder().decode(buf), "H"); }); -- cgit v1.2.3