Skip to content

saddle-points: unhelpful error message #778

Closed

Description

@FridaTveit

When running the saddle-points tests you don't get a very descriptive error message (unless I'm doing something wrong). The error message I get is something along the lines of:

expected:<MatrixCoordinate@1f> but was:<MatrixCoordinate@0

Which isn't much help in finding out what you've done wrong.

To improve this we could iterate over the sets and compare each point with a more detailed error message e.g.

"Expected row to be " + expected.getRow() + " and it was " + actual.getRow() + ". Expected column to be " + expected.getCol() + " and it was " + actual.getCol() + ".";

What do you think @exercism/java?

Activity

  1. Smarticles101 commented on Sep 24, 2017

    @Smarticles101
    Member

    Great idea. Another possible fix would be to implement a toString method for MatrixCoordinate

  2. FridaTveit commented on Sep 25, 2017

    @FridaTveit
    ContributorAuthor

    Great idea, that would be much neater and gives a very clear error message! I'll open a PR to implement toString for MatrixCoordinate :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions