Giter Site home page Giter Site logo

Meetup - 5th Monday about go HOT 4 CLOSED

exercism avatar exercism commented on August 15, 2024
Meetup - 5th Monday

from go.

Comments (4)

pminten avatar pminten commented on August 15, 2024

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.

soniakeys avatar soniakeys commented on August 15, 2024

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,

  1. 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.
  2. 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 additional ok value, or an additional error value.
  3. Untried, but I think we could use quick.Value to generate an invalid WeekSchedule value and test that the solver's MeetupDay function returns an error for unspecified values of WeekSchedule.
  4. We could do 3 and still not support the fifth week.
  5. We could leave the basic exercise about as it is, but add bonus requirements (using build tags, as done with another exercise or two.)
  6. This seems a good candidate for standard test cases in x-common.

from go.

kytrinyx avatar kytrinyx commented on August 15, 2024

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.

soniakeys avatar soniakeys commented on August 15, 2024

Closed with PR exercism/problem-specifications#124

from go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.