Ad
  • Custom User Avatar

    I thought the random tests could generate cases where the only solution was finding two identical indices. I was wrong there. But the random tests don't entirely disallow it.

    Would

        forAll genArgs $ \(list, target) -> do
          let (i,j) = twoSum list target
          i `shouldNotBe` j
          list !! i + list !! j `shouldBe` target
    

    be an idea?

    Having one fixed test seems thin ( it would be possible to hardcode for that. if you know the tests already ).

  • Custom User Avatar

    In this test case:

    let (i, j) = twoSum [2, 2, 3] 4 in (min i j, max i j) `shouldBe` (0, 1)
    

    Answer could be (0, 0), but it is wrong

  • Custom User Avatar

    How does this test "should find two different items", ie i /= j ?

  • Default User Avatar

    didn't know they had python back then!

  • Custom User Avatar
  • Custom User Avatar

    Thanks! Update fixed tests, move last test case to root edge cases.

  • Custom User Avatar

    still to handle:

    • fixed tests are passing the very same way if the user assumes that .. is the "parent dir" or the "root dir" => needs more fixed tests with different work_dir arguments.

    -> about that one: the tests you used aren't enough: you're testing only edge cases ending with .. => add regular example ending in .. too. (like the one I posted below, actually)

    • the last current 'basic case' should rather be in the 'edge cases'

    • home is only tested in the fixed tests (edit: hummmmm wait... this isn't an edge case, actually. That was because I first misunderstood the absolute path thing. Forget that one.)

  • Custom User Avatar

    'kay. Closing here, to make better identification of what's left to resolve.

  • Custom User Avatar

    ah ok. x)

    I agree about the pita aspect, but it can be pedagogical, imo: the main part is to find how to manage "elegantly" the different pitas... x)

    so what about that module? I have the tool to completely forbid it... :o

  • Custom User Avatar

    Thanks, rewrite part of description and add tests.

  • Custom User Avatar

    Can you show me the proper way to hide os.path module funtions?

  • Custom User Avatar

    not clear enough. Please rephrase that part of the description.

  • Custom User Avatar

    never 8 kyu, without the module. Don't behave like ZED, plz...

  • Custom User Avatar

    I wrote it:

    File path is never empty and can starts with slash (means that it already starts from root).

  • Default User Avatar

    Don't use os.path functions. This module is disabled.

    No, they aren't. On the other hand this would be a nice little 8-7kyu os.path exercise without such a pointless restriction.

  • Loading more items...