Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for deep Map equality with asserts#equal #3236

Merged
merged 5 commits into from
Oct 30, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Adds test cases for Map equality, including failing test case
  • Loading branch information
jamesseanwright committed Oct 29, 2019
commit 7405f2cdb3ccab7b3ad32c498be03a12f6b11048
6 changes: 6 additions & 0 deletions std/testing/asserts_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ test(function testingEqual(): void {
assert(!equal(new Set([1, 2]), new Set([3, 2, 1])));
assert(!equal(new Set([1, 2, 3]), new Set([4, 5, 6])));
assert(equal(new Set("denosaurus"), new Set("denosaurussss")));
assert(equal(new Map(), new Map()));
assert(equal(new Map([["foo", "bar"], ["baz", "baz"]]), new Map([["foo", "bar"], ["baz", "baz"]])));
assert(equal(new Map([["foo", new Map([["bar", "baz"]])]]), new Map([["foo", new Map([["bar", "baz"]])]])));
assert(equal(new Map([["foo", { bar: 'baz' }]]), new Map([["foo", { bar: 'baz' }]])));
assert(!equal(new Map([["foo", "bar"]]), new Map([["bar", "baz"]])));
assert(!equal(new Map([["foo", new Map([["bar", "baz"]])]]), new Map([["foo", new Map([["bar", "qux"]])]])));
});

test(function testingNotEquals(): void {
Expand Down