summaryrefslogtreecommitdiff
path: root/testing/asserts_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'testing/asserts_test.ts')
-rw-r--r--testing/asserts_test.ts26
1 files changed, 25 insertions, 1 deletions
diff --git a/testing/asserts_test.ts b/testing/asserts_test.ts
index 6227543e5..ccec2af09 100644
--- a/testing/asserts_test.ts
+++ b/testing/asserts_test.ts
@@ -7,7 +7,9 @@ import {
assertStrContains,
assertArrayContains,
assertMatch,
- assertEquals
+ assertEquals,
+ unimplemented,
+ unreachable
} from "./asserts.ts";
import { test } from "./mod.ts";
// import { assertEquals as prettyAssertEqual } from "./pretty.ts";
@@ -112,3 +114,25 @@ test(function testingAssertStringMatchingThrows() {
}
assert(didThrow);
});
+
+test(function testingAssertsUnimplemented() {
+ let didThrow = false;
+ try {
+ unimplemented();
+ } catch (e) {
+ assert(e.message === "unimplemented");
+ didThrow = true;
+ }
+ assert(didThrow);
+});
+
+test(function testingAssertsUnreachable() {
+ let didThrow = false;
+ try {
+ unreachable();
+ } catch (e) {
+ assert(e.message === "unreachable");
+ didThrow = true;
+ }
+ assert(didThrow);
+});