diff options
author | Casper Beyer <caspervonb@pm.me> | 2020-06-10 23:54:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-10 11:54:54 -0400 |
commit | be8bacaaa4258089e5a0cf4f1d8f53db8e534d4b (patch) | |
tree | 46a0729ad95cbb5b6f7aab4c6008adde257c2451 /cli/tests/unit/buffer_test.ts | |
parent | 54c3f8e27fa1f38a3e2d65c2b297c415062d01c8 (diff) |
fix: Remove try-catch from Buffer.readFrom, readFromSync (#6161)
Diffstat (limited to 'cli/tests/unit/buffer_test.ts')
-rw-r--r-- | cli/tests/unit/buffer_test.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/tests/unit/buffer_test.ts b/cli/tests/unit/buffer_test.ts index a5a0147ab..23e655a05 100644 --- a/cli/tests/unit/buffer_test.ts +++ b/cli/tests/unit/buffer_test.ts @@ -7,6 +7,8 @@ import { assertEquals, assert, assertStringContains, + assertThrows, + assertThrowsAsync, unitTest, } from "./test_util.ts"; @@ -202,6 +204,9 @@ unitTest(async function bufferReadFrom(): Promise<void> { const fub = new Uint8Array(testString.length); await empty(b, s, fub); } + assertThrowsAsync(async function () { + await new Buffer().readFrom(null!); + }); }); unitTest(async function bufferReadFromSync(): Promise<void> { @@ -221,6 +226,9 @@ unitTest(async function bufferReadFromSync(): Promise<void> { const fub = new Uint8Array(testString.length); await empty(b, s, fub); } + assertThrows(function () { + new Buffer().readFromSync(null!); + }); }); unitTest(async function bufferTestGrow(): Promise<void> { |