Skip to content

Clock exercise improvements #166

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

Closed
kytrinyx opened this issue Jan 6, 2016 · 4 comments
Closed

Clock exercise improvements #166

kytrinyx opened this issue Jan 6, 2016 · 4 comments

Comments

@kytrinyx
Copy link
Member

kytrinyx commented Jan 6, 2016

I've been reviewing a lot of submissions for the Go implementation of Clock, and I'm seeing a few interesting edge cases:

  1. Sometimes there's mutation happening in the display method instead of the add, so you might have two copies of clock that are identical, add 1440 minutes to one, 2880 minutes to the other, and now they display the same value, but are not equal.
  2. They only account for one adjustment in either direction, meaning that if someone said add 1,000,000 minutes, then the clock would not end up with a valid display time.

I think that we should have test cases that go much father outside of the valid values, and I also think that we should test equality after adding values.

@kytrinyx
Copy link
Member Author

kytrinyx commented Apr 7, 2016

The canonical test data was improved in this PR: #210

The clock.json is here: https://github.com/exercism/x-common/blob/master/clock.json

kotp added a commit to exercism/ruby that referenced this issue Apr 8, 2016
This has the non-comparitive tests implemented from the changes
implemented in the canonical changes introduced by @kytrinyx
references #282
references exercism/problem-specifications#166
kotp added a commit to exercism/ruby that referenced this issue Apr 9, 2016
kotp added a commit to exercism/ruby that referenced this issue Apr 11, 2016
@kotp
Copy link
Member

kotp commented Apr 14, 2016

The json file has places where we modify by more than a day... but the problem comes when there is a unique situation where a parenthesised note shows up. Though it may be interesting that 1500 minutes is 25 hours, we really don't need to have that in the file that is meant to simplify the generation of tests.

It complicates what we need to do in order to make valid test "titles" in some languages, or in using specific styles.

kotp added a commit to exercism/ruby that referenced this issue Apr 14, 2016
kotp added a commit to exercism/ruby that referenced this issue Apr 14, 2016
Generated from x-common clock data

Now generates tests from data in x-common.

The template file is skinny, the generator a little fatter.

fixes #282
references exercism/problem-specifications#166
kotp added a commit to exercism/ruby that referenced this issue Apr 15, 2016
Generated from x-common clock data

Now generates tests from data in x-common.

The template file is skinny, the generator a little fatter.

fixes #282
references exercism/problem-specifications#166
kotp added a commit to exercism/ruby that referenced this issue Apr 15, 2016
Generated from x-common clock data

Now generates tests from data in x-common.

The template file is skinny, the generator a little fatter.

fixes #282
references exercism/problem-specifications#166
kotp added a commit to exercism/ruby that referenced this issue Apr 16, 2016
Generated from x-common clock data

Now generates tests from data in x-common.

The template file is skinny, the generator a little fatter.

fixes #282
references exercism/problem-specifications#166
kotp added a commit to exercism/ruby that referenced this issue Apr 16, 2016
Generated from x-common clock data

Now generates tests from data in x-common.

The template file is skinny, the generator a little fatter.

fixes #282
references exercism/problem-specifications#166
kotp added a commit to exercism/ruby that referenced this issue Apr 16, 2016
Now generates tests from data in x-common.

The template file is skinny, the generator a little fatter.

fixes #282
references exercism/problem-specifications#166
kotp added a commit to exercism/ruby that referenced this issue Apr 16, 2016
Now generates tests from data in x-common.

The template file is skinny, the generator a little fatter.

fixes #282
references exercism/problem-specifications#166
@kytrinyx
Copy link
Member Author

Agreed--I'm fine with ditching the parentheses in the descriptions.

emcoding pushed a commit that referenced this issue Nov 19, 2018
@petertseng
Copy link
Member

it's not useful (there is no action for us to take) to leave this issue open.

However, individuals interested in how tracks should keep up-to-date with problem-specifications should look at #524 .

Note that the situation has gotten a lot better since the days of this issue, since the JSON file has a version now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants