Ad
  • Custom User Avatar

    Great points, I'll get on it

  • Custom User Avatar

    I think tests are still wrong.

    For example. From your tests:

    consolidate([ 4, 8 ], [ 5, 6 ], [ 9, 11 ], [ 2, 5 ] ])
    Result lengths should match. [Expected 1 got 2]
    expected result: [9,11]
    

    In the kata description you say that the result of this test should be: [[2,8],[9,11]]

    I think you need to decide if two contiguous time intervals must be consolidated in one or not.

    Another example:

    consolidate( [ [ -2, 0 ],
    [ 0, 0 ],
    [ 4, 11 ],
    [ 22, 500 ],
    [ 1, 11 ],
    [ -1, -1 ],
    [ 7, 8 ],
    [ 500, 500 ] ]));
    

    I think the result should be: [ [ -2, 11 ], [ 22, 500 ] ]

    But your tests say that: Result lengths should match. [Expected 1 got 2]
    expected result: [22,500]

    My guess is that your solution is wrong.

  • Custom User Avatar

    I updated the test scripts, they are now more flexible, verbose and and easy to add scenarios to. I'm going to need collaborators to add meaningful scenarios.

  • Custom User Avatar

    Excelent points, I haven't had time to properly write my tests.
    It's something I plan to do sometime during the day. Any help or suggestion is really appreciated. (This is my first time writing a Kata)

    As for the time slots, order shouldn't matter. I'll have to make the tests more permissive.

  • Custom User Avatar

    Hmmm. Are you sure your test cases are okay? I pass the example test case, but apparently not the real ones. And the only feedback I get is Set A.

    When I look at the data sent in and what my code produces, it seems correct.

    Are there any restrictions on the order of the resulting time slots? I return mine in natural order, but maybe the test cases expect something else?