diff options
author | Alexandre Szymocha <alexandre@szymocha.com> | 2019-12-28 14:48:36 +0100 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2019-12-28 08:48:36 -0500 |
commit | 4d4908dde31316462acae5caec8dfcbbf7a244bd (patch) | |
tree | c3c2f4da8c65f3a3e790849b18730d969b868fe3 /cli/js/files_test.ts | |
parent | 954a0c64e77aca31d2627562d432f164c68a50dc (diff) |
Fix: allow reading into a 0-length array (#3329)
Diffstat (limited to 'cli/js/files_test.ts')
-rw-r--r-- | cli/js/files_test.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cli/js/files_test.ts b/cli/js/files_test.ts index 2eaa3b9be..cb33f6947 100644 --- a/cli/js/files_test.ts +++ b/cli/js/files_test.ts @@ -118,6 +118,10 @@ testPerm( const filename = tempDir + "hello.txt"; const file = await Deno.open(filename, "w+"); + // reading into an empty buffer should return 0 immediately + const bytesRead = await file.read(new Uint8Array(0)); + assert(bytesRead === 0); + // reading file into null buffer should throw an error let err; try { |