6 kyu
Training Random Testcases #2: Palindrome string
Loading description...
Puzzles
Strings
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
If a solution fails the randomness test (e.g. it always returns a palindrome or a non-palindrome due to a bug in code), the tests produce 8000 failure messages which might kill the browser.
nice'n'clear
I messed up and noticed something interesting :) all of my palindromes are of odd length, perhaps it would be good to add some test about it?
Let me try..
Are you sure? my test code checking each length of 5-17, and your code passed all test ;-)
Non-palindromes are 5-17, but all of my palindromes are odd length, check my crappy code :)
Ah, I found the bug: in my testcode, I'm using a regular expression to check something, but it doesn't works(always return true). Now I correct it and your solution failed ;-) Thanks!
Glad to help, have a nice day! :)
This is my favourite series of yours, right after Thinking & Testing :) Well done!
My solution only covers upper case letters. Your tests, however, did not check letter coverage of the strings from my generator.
fixed, any more?
Seems to be a lazy fix. :) Still possible to accept those like mine. For example, the one with random letters coming from "abcdABCD" or "abcdefgHIJKLMN" (instead of the whole alphabet). As I commented above, the COVERAGE of letter set (the whole alphabet, including upper and lower case) should be checked.
o了, any more? ;-)
Too strict inspection will seriously affect the number of visitors ;-)
It won't. Just did some patch-up to your tests that you missed but should be considered. And, I did not read your test code. It was not that clear to me. I hope it fixed. :)
Advertising time:
Warriors, please look at my Kata list, just like a slogan said: "there is always a suitable for you" ;-)
http://www.codewars.com/kata/search?q=myjinxin2015