Preparing to censor [blintzes waffles you assert butter assert syrup waffles the equals chocolate whatever may equals codewars hotcakes blintzes honey be blintzes in are crepes honey are hotcakes hotcakes i chocolate they pancakes ran]
The messages of it block are misleading... The given input is a string, so using repr or f'Preparing to censor "{e}"' is the way to do it
None is not a string and should not be passed to censor.
P.S. "check if args are int/str/... and do the wrong thing (mask the error returning a valid value)" is a very bad idea and a duplicate af hundreds of terrible kata.
.. and that could have been in the description, because I won't be the only one who's never seen that before.
Retired, moot, etc, .. for next time: descriptions should be self-contained. Even outside links are not a replacement for ( domain specific ) knowledge that's not widely known. You really don't have to explain AND or OR, but things like XNOR or XAND should probably be specified in the description itself.
The point is moot now, but 10 000 random tests is (a) overkill, (b) f*cks up the result window ( some browsers may have serious difficulty handling that ) and (c) still no guarantee every possible input will be tested. Randomised testing over the entire input domain would have been a much better solution than fully random testing.
But it's retired anyway. Something to keep in mind for next time!
Fixed, thanks!
The messages of
it
block are misleading... The given input is a string, so usingrepr
orf'Preparing to censor "{e}"'
is the way to do itGood kata!
Fixed as well, thanks!
There is also
test.assert_equals(censor(),'')
without args.Alright fixed, thanks!
@Progolderner . just remove
test.assert_equals(censor(None),'')
and you are good.Could you please elaborate on this please?
None
is not a string and should not be passed tocensor
.P.S. "check if args are int/str/... and do the wrong thing (mask the error returning a valid value)" is a very bad idea and a duplicate af hundreds of terrible kata.
.. and that could have been in the description, because I won't be the only one who's never seen that before.
Retired, moot, etc, .. for next time: descriptions should be self-contained. Even outside links are not a replacement for ( domain specific ) knowledge that's not widely known. You really don't have to explain
AND
orOR
, but things likeXNOR
orXAND
should probably be specified in the description itself.The point is moot now, but
10 000
random tests is (a) overkill, (b) f*cks up the result window ( some browsers may have serious difficulty handling that ) and (c) still no guarantee every possible input will be tested. Randomised testing over the entire input domain would have been a much better solution than fully random testing.But it's retired anyway. Something to keep in mind for next time!
Fixed! It now it testing against a different solution.
Done! It has now been made to look more neat at readable!
Loading more items...