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.
No random tests.
Is the version always 3 digits with dots? Can names contain digits? Etc... The format should be described better and a few tests with similar strings isn't enough.
The sample tests aren;t structured correctly, so they just print to stderr.
No random tests.
More random tests have been added now. Let me know if any other changes are still needed.
OK, I can see that happening. :]
That leaves
mostFrequent(['p','p','p','p'], 'asd')
and friends -"asd"
is not an int.And the input array element types all being changed to string? If it were specified in the description, it could be a feature instead of a bug. But it would need to be documented. I'd prefer not converting array elements myself.
Not finished yet! :] ( And Donald and I still want random tests as well! :] But get the specs and the fixed tests stable first. )
Looking good.
Now, those random tests ..
Thanks, updated.
I see now. Got carried away with edge cases.
Test.assertSimilar( mostFrequent( {a:1}, 1 ), [] )
And we were promised an array. That's not an array. Times four. :/
Please, fix the tests or fix the description. But this doesn't fit.
Also, I support Donald's request for random tests.
And I'd suggest
Test.assertDeepEquals
instead ofTest.assertSimilar
. ( That's undocumented, you couldn't really know that. But it's nicer, for arrays (and objects). )Test.assertSimilar( mostFrequent( [1,2,1], 2 ), ['1','2'] )
Wot ?!?
Where did those strings come from ?!?
I'd make that
and
(emphasis not needed in actual text)
Thanks, you're right. Not sure why I used
splice
.Loading more items...