Skip to content

complex-numbers: improve error message for failing test - #1298

Merged
FridaTveit merged 1 commit into
exercism:masterfrom
jackattack24:complexEqual
Feb 9, 2018
Merged

FridaTveit merged 1 commit into
exercism:masterfrom
jackattack24:complexEqual

Conversation

@jackattack24

Copy link
Copy Markdown
Contributor

Fix #1284

I added a message to assertDoublesEqual to display which part of the complex number was being tested when the error occurred. The output produced is (assuming testing the real part of the number):

java.lang.AssertionError: While testing real part of number, expected:<9.0> but was:<6.0>

I'm not sure if this is the best solution though, considering the tests that call assertDoublesEqual directly.


Reviewer Resources:

Track Policies

@sjwarner-bp sjwarner-bp left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks more useful to me! We can see what @FridaTveit thinks, incase this output isn't as verbose as we expect 🙂

@FridaTveit FridaTveit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks @jackattack24! 🙂

@FridaTveit
FridaTveit merged commit e458c40 into exercism:master Feb 9, 2018
@jackattack24
jackattack24 deleted the complexEqual branch February 9, 2018 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants