Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I'm trying to accomplish this kata in its crystal version, but the test gives me the error Vector undefined.

    I guess it should be rewritten using Array.

  • Custom User Avatar

    I think I don't quite understand how exclusive disjuncion should work, in the tests I get:
    Testing for [false, false, true, true] and true
    Expected: true
    got: false
    I thought I should do:
    (false ⊻ false) ⊻ true) ⊻ true)
    that is:
    ( false ) ⊻ true) ⊻ true)
    ( true ) ⊻ true) = false
    I guess I must have misinterpreted the explanation, can anybody explain it to me?

  • Custom User Avatar

    Hi guys, need a little help here, I'm caching the result but even with that still getting timeout, any hint???

  • Custom User Avatar

    Ok, I added random tests (only in the Crystal version, so far, if anybody is willing to port it to js go ahead).

    I there some way to display the randomly generated json when a test fails? that way whoever is trying to solve the problem can have a failing test case to keep working.

  • Custom User Avatar

    you're right, sorry

  • Custom User Avatar

    Very nice kata, you could add to the details that any other letter should just be ignored

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I'm about to try this kata, but just looking at the examples the folowing questions arise, that might be answered with simple examples, like this:

    can number be "234"? (ie start with a number greater than 1)
    can number be "134"? (ie skip digits)
    can number be "1223"? (ie repeat numbers)

    I guess, specially after reading this discussion, that the answer is yes to all of them, but adding these simple examples would make it more explicit. It's very frustrating when you fail a test not because you couldn't code it properly but because you didn't understood the problem.

  • Custom User Avatar

    Thanks for the explanation, if I understood correctly I should also include my own working solution and execute it with the randomly generated json, that would be my "expected" result. Am I right? The only thing that doesn't convince me about random tests is that the same solution might pass or fail the test depending on a random generated case.

  • Custom User Avatar

    I didn't know about random tests. Couldn't be the case that some test might fail or pass depending on the random values? Wouldn't like that scenerio. Do you have any example of random test?

  • Custom User Avatar

    You're right, fixed. Now I sort the results on the test, any order should be ok.

  • Custom User Avatar

    I guess I assumed that a function called deepCompare should be able to correctly compare anything, but anyway, to be more specific I added it to the kata's description. Thanks!

  • Custom User Avatar

    you are right, thanks.

    the first bug is easy to fix, but the second is not that trivial. you solution is quite clever, I guess another solution would be to have a list of all meaningful regexp chars and escape them with ''

  • Custom User Avatar

    thanks!

    BTW, and a little bit out of topic, I never understood the purpose of random generated data for unit tests. I mean, the idea of unit tests it's to be predictable, what good is a unit tests that 'sometimes' might fail? Just asking out of curiosity

  • Loading more items...