Comments (5)
Mm hm, good catch. First, breaking code is never a worry, that's what testVersion is for. We could remove the test case, but I like it because the .yml cites Project Euler. PE does like to use 64 bits. Changing the result type sounds better. You know, I think we could even be devious here and use a type conversion. We'd move the test program to int64 but instead of comparing the solver's return value directly, convert the type inferred result to int64. That would let people be sloppy (like I was!) and possibly get nitpicked later.
Huh. Ideally we'd run CI on multiple architectures. I don't think Travis offers this. Their Go page states "Travis CI VMs are 64 bit..."
from go.
Yeah, I'm pretty sure Travis is linux/64-bit only.
from go.
I don't think the devious approach would work. The product would overflow during calculation in the user code and then extended to int64 upon return. So correct user code would still be unable to return a correct value.
I'll make a PR for a full conversion to int64 + TestVersion later today.
from go.
Aha. I got travis to test with 32bit ints: https://travis-ci.org/exercism/xgo/builds/57178825
It verifies that largest-series-product does indeed fail and also shows that prime-factors has a similar problem.
Update: Huh. And prime-factors is harder to fix in the way I've been arguing for largest-series-product. There, the big number is an argument rather than a return value. I'm not seeing an easy way to type-infer the argument with table driven tests. I can think of a few awkward ways, but I don't think it's worth it.
from go.
As of #161 and #162, these problems are int64, and as of #163 we have CI testing both 32 and 64 bit builds.
from go.
Related Issues (20)
- Fails HOT 2
- Improve test output for the Clock exercise
- Enable test runner v3 UI for all concept exercises
- Ensure package names are unique
- Adding concurrency concepts to the syllabus HOT 3
- Community contributions are paused for this repo
- Outdated information in the 'Randomness' section HOT 1
- ErrStop and ErrInvalidBase not defined in the test file. HOT 1
- Booking up for Beauty: Better explanations for tasks HOT 1
- Update go version to 1.21 in go.mod across all or subset of problems? HOT 1
- Remove check for short test in benchmarks
- Hello world: Error: not in workspace HOT 1
- Building a training set of tags for go HOT 22
- Bug: instructions for kindergarten_garden do not match requirements HOT 2
- Define more test cases for resistor color HOT 1
- Expanding test cases for Vehicle Purchase exercise in the Go track HOT 1
- Need for speed exercise CanFinish tests do not validate start with distance travelled HOT 1
- Inaccurate information for the "Runes" Concept HOT 1
- First Class Functions: task 5 misleading test? HOT 1
- Duplicated link in `parallel-letter-frequency` documentation. HOT 1
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 go.