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

add assertAmountsEqual() as a testHelper #2442

Closed
Chris-Hibbert opened this issue Feb 16, 2021 · 0 comments · Fixed by #2453
Closed

add assertAmountsEqual() as a testHelper #2442

Chris-Hibbert opened this issue Feb 16, 2021 · 0 comments · Fixed by #2453
Assignees
Labels
enhancement New feature or request

Comments

@Chris-Hibbert
Copy link
Contributor

What is the Problem Being Solved?

t.truthy(math.isEqual(amount1, amount2)) provides no helpful debugging info. The replacement I've been using: t.deepEquals(amount1, amount2) works for natMath amounts, but is a bad habit because it would fail for sets.

Description of the Design

Add a helper (in zoeTestHelpers) that just compares the brands and values, and prints something helpful on failure.

Also, use the new helper in assertPayoutAmount(), etc., which currently use t.deepEqual().

Security Considerations

more reliable test results.

Test Plan

replace some uses in tests. Observe no change in test results.

@Chris-Hibbert Chris-Hibbert added enhancement New feature or request Beta labels Feb 16, 2021
@Chris-Hibbert Chris-Hibbert added this to the Beta Launch milestone Feb 16, 2021
@Chris-Hibbert Chris-Hibbert self-assigned this Feb 16, 2021
@rowgraus rowgraus removed this from the Beta Initial Launch milestone Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants