summaryrefslogtreecommitdiff
path: root/testing/asserts_test.ts
diff options
context:
space:
mode:
authorVincent LE GOFF <g_n_s@hotmail.fr>2019-03-06 22:39:50 +0100
committerRyan Dahl <ry@tinyclouds.org>2019-03-06 16:39:50 -0500
commite36edfdb3fd4709358a5f499f13cfe3d53c2b4f7 (patch)
tree1baef3f876a5e75288c3ec9056cdb93dd6b5787f /testing/asserts_test.ts
parentd29957ad17956016c35a04f5f1f98565e58e8a2e (diff)
Testing refactor (denoland/deno_std#240)
Original: https://github.com/denoland/deno_std/commit/e1d5c00279132aa639030c6c6d9b4e308bd4775e
Diffstat (limited to 'testing/asserts_test.ts')
-rw-r--r--testing/asserts_test.ts28
1 files changed, 25 insertions, 3 deletions
diff --git a/testing/asserts_test.ts b/testing/asserts_test.ts
index f4256d8f5..9dc70ad29 100644
--- a/testing/asserts_test.ts
+++ b/testing/asserts_test.ts
@@ -1,12 +1,34 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { assertStrContains, assertMatch } from "./asserts.ts";
-import { test, assert } from "./mod.ts";
-// import { assertEqual as prettyAssertEqual } from "./pretty.ts";
+import { assert, equal, assertStrContains, assertMatch } from "./asserts.ts";
+import { test } from "./mod.ts";
+// import { assertEq as prettyAssertEqual } from "./pretty.ts";
// import "./format_test.ts";
// import "./diff_test.ts";
// import "./pretty_test.ts";
+test(function testingEqual() {
+ assert(equal("world", "world"));
+ assert(!equal("hello", "world"));
+ assert(equal(5, 5));
+ assert(!equal(5, 6));
+ assert(equal(NaN, NaN));
+ assert(equal({ hello: "world" }, { hello: "world" }));
+ assert(!equal({ world: "hello" }, { hello: "world" }));
+ assert(
+ equal(
+ { hello: "world", hi: { there: "everyone" } },
+ { hello: "world", hi: { there: "everyone" } }
+ )
+ );
+ assert(
+ !equal(
+ { hello: "world", hi: { there: "everyone" } },
+ { hello: "world", hi: { there: "everyone else" } }
+ )
+ );
+});
+
test(function testingAssertStringContains() {
assertStrContains("Denosaurus", "saur");
assertStrContains("Denosaurus", "Deno");