Ad
  • Default User Avatar

    In fact the array used in 2d test is the same as in first test. As you spliced array on first test then when 2d tests occurs array is modified.

    ( Description said :

    Create a function named "rotate" that takes an array and returns a new one ...

    It means (implicitly) array arguments should stay uncahnged.
    Hope it helps.

  • Custom User Avatar

    Here's what I'm looking at. http://imgur.com/gallery/jVKsTmm/new

    As you can see I didn't modify the array at all before logging it. It's not a huge deal, I can always just skip the kata, I just wanted to help out in case this is, in fact, a broken test.

  • Default User Avatar

    Actually there's no test with [1,2,3,4] as argument. I'm afraid you've modified the array argument before logging it out.

  • Custom User Avatar

    I think I may have run into a bug in this kata. This is what I get for input and the subsequent failure message.

    Arguments: [ 1, 2, 3, 4 ], 2
    Expected: [4,5,1,2,3], instead got: [3,4,1,2]

    How'd the array get bigger? Am I missing something obvious here? Or is this just a bad unit test?