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.
eval seems to be disabled in the full tests suite only, and that's not specified...
I should search how to do it and then add some random tests as well.
I will make it clear, thank you
Thank you for your suggestions. I wiil add some notes and do some modifications.
I would suggst to specify in the description:
Test cases should be more extensive (as already commented), and should include test cases that test the cases mentioned above.
Operator precedence is unspecified.
( Standard JS, and possibly maths, is
AND
>OR
. but you're free to specify right-to-left or whatever tickles your fancy. would be fun to do something different than usual actually. )Use a recursive random generator for the
searchValue
. It's slightly advanced, but it's not difficult.Marking the suggestion as resolved; lack of random tests is really an issue.
This comment is hidden because it contains spoiler information about the solution
Issues:
Suggestion:
Random tests could be implemented; although, it will not be an easy task to do.
One-word search queries would be pretty easy. Generate a random word string for the text, and randomly pick or not pick one word from the string. However, multi-word random tests would be harder to accomplish.
One way could be to use a fixed boolean search pattern, such as
'({} AND {}) OR {}'
, and fill it with randomly generated words. You could then check using your own algorithm, and compare to the user's.There are probably multiple other better ways for implementing random tests. Anyone else have any ideas?