Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Python: Random tests are vulnerable to input modification
This comment is hidden because it contains spoiler information about the solution
python new test framework is required. updated in this fork
I think the rangom tests violate the given assumptions: 'there will always be a rank 1 in the given input ranks are of type string
rank numbers are incremented, and not skippped (1.1 could be followed by 1.2, not 1.3)'
Random test:
['2', '2.1', '2.1.1.1', '2.1.1.1.2', '2.1.1.2', '3', '4']
^ no ^ skipping 2.1.1 here
rank 1 here
@danarters
,This kata seems familiar but I couldn't find a duplicate after a quick search. Here are a few suggestions in the mean time!
Typo in the description:
skippped -> skipped
It looks like you accidentally reversed the order of the arguments in the tests. It just messes up the error message
{actual} should equal {expected}
.test.assert_equals(expected, actual)
should betest.assert_equals(actual, expected)
(Optional) The
Example Test Cases
seem a bit over-complicated. You don't really need to shuffle those lists every time they are run. They could be easily simplified:(Optional) There is also a fair bit of repetition in your main
Test Cases
. It could be cleaned up quite easily.Thanks!