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.
It's passing a
List
, just as the description ofconcat
requires, and expecting aList
. The actual testing is done on anArray
.If you are unsure, it might help to
console.log
the input.I can't find the exact reference ( there are a lot of tests .. ), but it's only a test header ( I think ). You should be able to take the description at its word, so when
List.repeat
is passed aList
, you have to repeat thatList
, and not some array. If it were passed anArray
, you'd have to repeat that. This may be somewhat complicated by the fact I can't directly test onList
s, so I have to convert them back toArray
s for testing.If you have questions about specific tests, please tell me where to find that test.
That is the expected behaviour ( the error message could have been clearer ). Why are you evaluating the fold function over an empty list?
Note that you have mangled the test line by not quoting it as code. The full line is
Test.assertDeepEquals( List.empty.foldr( () => _|_ , Math.E ), Math.E );
but MarkDown uses_
as<i>
.If you want a clearer error message, change
_|_
to{ throw new Error("I must never be evaluated"); }