Retired

Imperial fractions (retired)

Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • Voile Avatar

    The current sample test is incorrect:

    test.assert_equals(imperial_units(426, 1), "1ft 4 1/2in")
    

    That's about 16.77 inches, so it should be 1ft 5in.

  • Voile Avatar

    Sample tests is different from actual tests, which is a bad idea.

    The edge cases are also either missing or only exists in sample tests, such as missing ft, in or fractional in, and carrying.

  • Voile Avatar

    Needs random tests.

    • marmotteNZ Avatar

      THX. Please let me know what you mean with 'random' (sorry for the dumb question - my first try here). I woudl not think I need to test for the inputs being something else than positive numbers / integer do I ?

    • Voile Avatar

      Random tests means tests with inputs randomly generated at runtime, typically 100 tests per run.

      You should definitely check out the existing katas on how random tests are done ;-)

    • donaldsebleung Avatar

      @marmotteNZ you may find this useful (though it's in JS, not Python)

      EDIT: Additionally, since you mentioned that this Kata was your "first try", you may want to read "Creating your first Kata" carefully in order to better understand what the CW community expects of Kata authors, cheers :-)