remove the "3 holes" tests and specify that at most 1 field will be missing for one song
Going along with the backstory, it's not possible for an audiofile to have "" as its duration unless something is wildly wrong (ignoring the fact that the song duration is stored as MM:SS string), and songs should never have empty names either unless you want to greatly inconvenience yourself. The only realistic edge case here is missing artist, and even then it should be represented as None instead of ""; everything else are pointless tests which are present just for the sake of being present.
the random tests should generate empty inputs from time to time (currently, it's always at least 1 song)
there is a hole in the logic, currently: on one hand you tests inputs with "3 holes": ('','',''). This suggests that any number of fields could be empty. On the other hand, your tests only provide inputs with 0,1 or 3 holes (3 holes appearing only in the fixed tests). So, your ordering specification is actually relying on the fact that no fields with 2 holes will ever exist while it's not specified. So I see several possible courses of action about that:
remove the "3 holes" tests and specify that at most 1 field will be missing for one song
make your random holes generator wilder, provide a compelte specification for ordering, then tests for all kind of edge cases (fixed+sample tests)
whatever the option you chose (above), you should add to the sample tests 1 or 2 tests with some empty fields.
Elegant solution! It is exactly what was floating around in my mind, though I couldn't catch it - so mine is less appealing.
roflmao this is identical to mine, evein in spacing (the only dif is that u called a variable "char" while I called it "c"). Good job, I guess xd
I created similar kata this summer. You can check it, if you interested.
It is called "Concat arguments"
It happens. You can watch some lectures about lambda calculus. Some of them can even be understood by mortals :)
Sorry, can't wrap my tiny little brain around this.
Yeap XD
Is
ADDICTION
just likeADDITION
, except you cant stop? :DAs far as I can see, everything is fine.
Approved :)
Okay, updated tests and description
I believe so, yes. A correct approach won't see any difference anyway.
Do you think it would benefit from not having any empty fields?
Going along with the backstory, it's not possible for an audiofile to have
""
as its duration unless something is wildly wrong (ignoring the fact that the song duration is stored asMM:SS
string), and songs should never have empty names either unless you want to greatly inconvenience yourself. The only realistic edge case here is missing artist, and even then it should be represented asNone
instead of""
; everything else are pointless tests which are present just for the sake of being present.looks handled
looks handled
Hi,
('','','')
. This suggests that any number of fields could be empty. On the other hand, your tests only provide inputs with 0,1 or 3 holes (3 holes appearing only in the fixed tests). So, your ordering specification is actually relying on the fact that no fields with 2 holes will ever exist while it's not specified. So I see several possible courses of action about that:Cheers
Loading more items...