-
-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java prime-factors problems with tests #49
Comments
That's weird (and frustrating). I think the tests are expecting the type to be |
The quickest fix I can think of is
Otherwise we could explicit add casts to long for both sides of the assert. A bit hacky, but working. Maybe JUnit has something better to offer, though I'm not aware of it. |
Also, the last test passes in a Long. While its factors are all within the Integer range, it's probably best to just convert the whole test to use all longs? |
Yeah, let's just use longs everywhere.
That might not be a bad idea, actually. The downside is it might look like we think it's a good practice, whereas it would probably be best to avoid in the real world. |
Given that the last test requires a Long input, I also prefer going with longs everywhere. |
Aside from test case 0, I get all the tests failing with messages like:
The lists match and the values have the same orders. Initially I was using a LinkedList and thought that was the problem, but changing to ArrayList didn't solve the problem.
Oddly enough, test 0 pass (empty list), probably because the initalizer is
instead of
as the others are.
I'm using IntellijIdea 14.1 , running as JUnit tests. Attached the code for my solver:
The text was updated successfully, but these errors were encountered: