In the TypeScript translation of the kata, running the kata fails because of the first two lines in the sample tests (the reference directives). However, if I replace
You do realise that Array + Array casts both of 'em to Strings, don't you? And String also happens to have indexOf, and V0 just happens to come before V0+ ..
You'd have a most interesting bug when V0- is introduced beforeV0.
I believe this is actually an issue with the test cases themselves, as some people have pointed out already.
The test case in question uses the parameters [1, 7] and [1, 8], which should return 0 but the test case wrongly expects 1.
Thanks, fixed.
In the TypeScript translation of the kata, running the kata fails because of the first two lines in the sample tests (the reference directives). However, if I replace
with the following:
it works as intended. Not sure if this only fails for me, but this fix should work.
You're welcome! :]
Yes, you're right. I thought the debug output looked strange. I should have used concat instead, thanks!
You do realise that
Array + Array
casts both of 'em toString
s, don't you? AndString
also happens to haveindexOf
, andV0
just happens to come beforeV0+
..You'd have a most interesting bug when
V0-
is introduced beforeV0
.I believe this is actually an issue with the test cases themselves, as some people have pointed out already.
The test case in question uses the parameters [1, 7] and [1, 8], which should return 0 but the test case wrongly expects 1.
Hey! I've added a Clojure translation for this kata a while back. Would be great if someone could review it!