The example test is a bad/unhelpful example.
The actual test (for java) is written incorrectly, you switched up the two sides of the Assert, resulting in "Expected [WRONG], but got [CORRECT]" printouts.
Javascript test does JSON.strigify for actual and expected, as Javascript doesn't have any native way to test equality of hashes/dictionaries/objects.
This is going to make error message fairly weird, in a way that ruby/python versions of this kata don't suffer, but they test the same logic, I see a bunch of javascript solutions passing, and I'm not sure there's any reasonable way to make javascript error message more sensible.
for the Javascript version, I get all the regular tests running okay, i.e:
Test Passed: Value == {"":2,"r":2}
however when I try to submit, the same tests are failed, i.e:
Expected {"":2,"r":2} instead got "{"*":2,"r":2}"
Could it be something wrong with the way the output is evaluated?
yes, now it's all good: testing(PhoneDir.phone(dr, "1-908-512-2222"), "Phone => 1-908-512-2222, Name => Peter O'Brien, Address => High Street CC-47209");
It just probably took some time for all of the tests to update.
Duplicate issue.
No random tests.
Expected and actual results are flipped
Example tests still has expected and actual results flipped.
Swapped them, thanks for noticing this.
The example test is a bad/unhelpful example.
The actual test (for java) is written incorrectly, you switched up the two sides of the Assert, resulting in "Expected [WRONG], but got [CORRECT]" printouts.
Kind of duplicates of http://www.codewars.com/kata/555624b601231dc7a400017a
thank you for reporting, corrected them.
Errors inside example testcases (code) - try to run...
I realized my mistake, was returning String instead of Hash map. Sorry for bothering you.
Javascript test does
JSON.strigify
for actual and expected, as Javascript doesn't have any native way to test equality of hashes/dictionaries/objects.This is going to make error message fairly weird, in a way that ruby/python versions of this kata don't suffer, but they test the same logic, I see a bunch of javascript solutions passing, and I'm not sure there's any reasonable way to make javascript error message more sensible.
Are you sure your solution is correct?
for the Javascript version, I get all the regular tests running okay, i.e:
Test Passed: Value == {"":2,"r":2}
however when I try to submit, the same tests are failed, i.e:
Expected {"":2,"r":2} instead got "{"*":2,"r":2}"
Could it be something wrong with the way the output is evaluated?
I thank you very much for your help!
yes, now it's all good: testing(PhoneDir.phone(dr, "1-908-512-2222"), "Phone => 1-908-512-2222, Name => Peter O'Brien, Address => High Street CC-47209");
It just probably took some time for all of the tests to update.
Maybe it was not updated. I just verified "Your Test Cases" and I can read:
Do you see now the same as I do?
Loading more items...