Ad
  • Default User Avatar

    Test.assertEquals(highAndLow("-1 -1 0"), "0 -1"); // First failure.
    Oh ok. I made wrong conclusion by error message.

  • Custom User Avatar

    The rules didn't change, you just failed different test cases. The "Expected" is what your code should have returned, but it incorrectly returned the "Actual" values instead.

    I don't know which programming language you are using, but here is an example of a few test cases from the final test.

    Test.assertEquals(highAndLow("1 -1"), "1 -1");
    Test.assertEquals(highAndLow("1 1"), "1 1"); // Second failure.
    Test.assertEquals(highAndLow("-1 -1"), "-1 -1");
    Test.assertEquals(highAndLow("1 -1 0"), "1 -1");
    Test.assertEquals(highAndLow("1 1 0"), "1 0");
    Test.assertEquals(highAndLow("-1 -1 0"), "0 -1"); // First failure.
    
  • Default User Avatar

    When sample test passes nicely, got this at actual test:
    Failed asserting that two strings are equal
    Expected: '0 -1'
    Actual : '-1 -1'

    After rearranging code got this at sample test:
    Failed asserting that two strings are equal
    Expected: '1 1'
    Actual : '0 1'

    Why it changes the rules how to represent results with equal min and max?