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.
Haskell tests appear to be broken. My solution failed on the randomized tests:
Falsifiable (after 7 tests and 4 shrinks):
"aa\71319a"
expected: "a2a"
but got: "aa\71319a"
Is \71319 supposed to be a character?
Okay so I tried your code and it seems that for the test case (-y+11)(-55y-6) your answer is y^2-5y-66, which is wrong.
The answer should be 55y^2-599y-66.
I think maybe it's caused by the "-y" in the first bracket which doesn't have a number coefficient?
By the way my test case doesn't include (y-11)(y+6).
Please check your code again and let me know if there are any further problems.
I think it's because the sympy module is not supported in codewars.
I didn't explicitly add any code in my test cases to disallow any modules.
Approved! :D
@anter69
I have added a few new fixed test cases, but your code still seems to work though.
If your solution originally returns the wrong answer, then how can it still work now?
I think your original solution is correct, but thanks for the suggestions anyway :)
Thanks a lot for the feedback!
I will change it as soon as possible.
Sorry I didn't know that it was a duplicate.
I will just unpublish it then.
Yay done now :D
Everything should be alright now.
Okk noted changing it now
Thanks @XRFXLP for editing and improving my kata test suite.
Finally now I can understand FArekkusu's earlier request about wrapping the referrence solution.
Sorry for being rude earlier, but I must say FArekkusu did not explain his requests clearly.
And for reading the documentation, I did read it but the docs are very vague on how to handle reference solutions inside the test suite.
Anyway thanks for the help and sorry for the inconvenience caused.
@FArekkusu it would be better if you can explain clearly what issues you want me to fix the next time, I am still a newbie :)
Yea as I said I tried to follow FArekkusu's advice to wrap the reference solution inside a
describe
orit
block,but both did not work and threw errors.
the other issues about appropriate
describe
andit
blocks have been fixed I guess, unless FArekkusu have some other demands to my test suiteOk an "it" has been put around each individual random test
Ahh so that's what he was talking about.
Thanks @dfhwze
Please be more specific next time @FArekkusu.
And just for clarification, the issues on importing the solution and sample tests have been fixed.
What do you mean? I have literally put the line
@test.describe("Example Tests")
on top of the sample test method.What now? I changed the method in the
assert_equals()
fromquadratic_builder
tosolution.quadratic_builder
and I have addedimport solution
in the beginning.If what you want is for me to put an
it
block for every test case I have,I think you haven't noticed that I have 41 tests, not just a few.
Why do I have to waste time to seperate individual test cases when I can just group them together?
Loading more items...