Comments (4)
There's a bit of an issue with the example version of meetup in various test suites that they only test for valid inputs. In the Elixir version this didn't turn out to be a problem due to it deferring to Erlang's stdlib and Erlang throwing an error on invalid input. For go this will be somewhat more difficult and it's likely to break any user submission.
I've looked through the biggest tracks (ruby, clojure, haskell, javascript) and none of them actually tests for failures. In fact in the Haskell and Go tracks it's downright impossible to signal a failure with the current required API.
So I'd like to ask, do we consider dealing with input to be a required element of the meetup exercise?
from go.
Interesting. The Go test program requires the solver to define a WeekSchedule
type and then define six identifiers of type WeekSchedule for the first..fourth, teenth, and last weeks. There is currently no requirement to define an identifier for the fifth or any other week (pre-teenth? next to last?) The test program calls the solver's function with these identifiers but has no good way to generate any ... oh wait, testing/quick.Value. You know, I'd never used testing/quick before. So, some ideas,
- I think it's okay the way it is. The readme doesn't mention fifth week as a case that needs to be supported. The Go test program specifies six cases which are defined for all months. There is no error handling requirement. It leaves the exercise more purely one of puzzling out the date arithmetic.
- The test program could be changed to do fifth week too. To handle months without the day in the fifth week, the test program would need to specify that
MeetupDay
return a specified value such as 0 or -1, the value of a specified identifier (letting the solver pick the exact value), an additionalok
value, or an additional error value. - Untried, but I think we could use quick.Value to generate an invalid
WeekSchedule
value and test that the solver'sMeetupDay
function returns an error for unspecified values of WeekSchedule. - We could do 3 and still not support the fifth week.
- We could leave the basic exercise about as it is, but add bonus requirements (using build tags, as done with another exercise or two.)
- This seems a good candidate for standard test cases in x-common.
from go.
As someone mentioned in the original issue:
You can't regularly schedule a meetup on the fifth week of every month because February usually doesn't have a fifth week at all (and no month ever has a full fifth week). It's nonsense to even support "fifth" as an input in the first place. I think that first-fourth, last, teenth are the only scheduling inputs that should be supported.
So it seems like this is basically an irrelevant edge case.
It is interesting in terms of the x-common standard cases though.
from go.
Closed with PR exercism/problem-specifications#124
from go.
Related Issues (20)
- 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 4
- Duplicated link in `parallel-letter-frequency` documentation. HOT 1
- Minor correction to instruction text for animal-magic instructions.md HOT 2
- TDD and the Golang track HOT 2
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.