Comments (5)
That's weird (and frustrating).
I think the tests are expecting the type to be Integer
not Long
Is there a way to write the tests so that it would accept either? It seems to me that the underlying type is not important in this case so long as the code produces the correct results.
from java.
The quickest fix I can think of is
assertEquals(expectedOutput - PrimeFactors.getForNumber(input), 0);
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.
from java.
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?
from java.
Yeah, let's just use longs everywhere.
Otherwise we could explicit add casts to long for both sides of the assert.
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.
from java.
Given that the last test requires a Long input, I also prefer going with longs everywhere.
from java.
Related Issues (20)
- Add document to describe the representation process for mentors
- Check if ``Bird Watcher`` current test suite is complete/correct HOT 2
- #48in24: Add approaches to Parallel Letter Frequency
- #48in24: Add approaches to Bank Account HOT 5
- #48in24: Add approaches to Knapsack HOT 2
- #48in24: Add analyzer feedback for Parallel Letter Frequency HOT 5
- #48in24: Add analyzer feedback for Bank Account
- #48in24: Add analyzer feedback for Knapsack
- Wizards and Warriors exercise reformat
- Add GitHub Actions workflow step to add summary for test-runner results HOT 2
- Karls Language introduces multiple concepts HOT 3
- Find a way to always have reference documentation updated HOT 3
- Make class names the exercise names if makes sense HOT 4
- Inconsistency between Need for Speed task 6 analyzer feedback and instructions HOT 1
- Collatz Conjecture: Test case should be added to check for more than one method call HOT 2
- Mentoring signup url broken HOT 1
- game-of-life: implement practice exercise HOT 3
- need-for-speed: Niptpick: Tests allow for a batteryDrain that's larger than the available battery. HOT 3
- [Java track] Tests for exercise `rational-numbers` are flaky
- Secret Handshake - Signal Enum class should be editable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java.