Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport for deep `Map` equality with `asserts#equal` #3236
Conversation
std/testing/asserts.ts
Outdated
messages.push(c(`${createSign(result.type)}${result.value}`)); | ||
} | ||
); | ||
diffResult.forEach((result: DiffResult<string>): void => { |
This comment has been minimized.
This comment has been minimized.
jamesseanwright
Oct 29, 2019
Author
Contributor
Strangely, this unrelated block seems to have been changed when formatting this module. Shall I revert this? I appreciate it's a bit misleading given it isn't directly related to my changes.
This comment has been minimized.
This comment has been minimized.
jamesseanwright
Oct 29, 2019
•
Author
Contributor
Disregard. This was a symptom of my using deno fmt
directly slaps self on wrist.
This comment has been minimized.
This comment has been minimized.
CLAassistant
commented
Oct 29, 2019
•
This comment has been minimized.
This comment has been minimized.
Noticed the lint check is failing. I'll take a look shortly. |
This comment has been minimized.
This comment has been minimized.
Looks like I've fixed it. |
LGTM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
jamesseanwright commentedOct 29, 2019
As per #3235, here is my fix for supporting for deeply comparing
Map
instances in theasserts
module'sequal
function. Much like the conditional branches forSet
comparisons, this logic has been inlined withinequal
itself.I've also included a set of test cases (simple equality, nested
Map
s , arrays and objects asMap
values etc.)