Clock: Add deriving Eq to stub to make it testable#891
Clock: Add deriving Eq to stub to make it testable#891sshine merged 1 commit intoexercism:masterfrom sshine:clock-test-stub
deriving Eq to stub to make it testable#891Conversation
Clock is the last remaining exercise that has the .meta/DONT-TEST-STUB file because the type in the src/Clock.hs stub is not compatible with the test suite. Other examples of exercises that were revised so that testing the stub became possible are listed in #466. The difference is that those all had `data` definitions, whereas Clock is ideally solved with a 'newtype' and an appropriate alias. The DONT-TEST-STUB mechanism was added by @petertseng in #464 and in particular the commits - 1d91ceb (Travis code) - 342b932 (Clock-specific) The change made in this commit argues that since the example solution has `deriving Eq`, adding this to the stub *will* make the exercise a bit easier, but it still won't give away the central piece. The motivation behind removing DONT-TEST-STUB in Clock is that with this single effort, we can say that all stubs can be compiled and tested. To motivate further, I will cite @rbasso in #466: > I think that this is the way to go. We have to sacrifice a little > flexibility in designing exercises, but we gain a more coherent > user-experience and automatic testing of stubs. 👍 This bumps the exercise's version from 2.4.0.9 to 2.4.0.10.
|
Additionally, I have two notes for reference:
|
petertseng
left a comment
There was a problem hiding this comment.
wow, we must have completely forgotten to do this when doing #695 . The DONT-TEST-STUB file mentions the Num instance, but #695 has told us that the Num instance is a bad idea. Adding deriving Eq to the stub to make it testable is eminently reasonable and should have been done a long time ago, so this PR is just doing what we forgot to do back then.
|
@iHiD: I'm a bit unsure why this happens: Could it be related to my recent permission changes in relation to the exercism/v3 repository? |
|
I would like to note for the record that I am also not authorised, but that I assume this problem will be solved for the entire Haskell maintainer team at once, so perhaps I need not have mentioned it. |
|
Should be fixed for this repo now. It's currently broken everywhere. |

Clock is the last remaining exercise that has the .meta/DONT-TEST-STUB file because the type in the src/Clock.hs stub is not compatible with the test suite.
Other examples of exercises that were revised so that testing the stub became possible are listed in #466. The difference is that those all had
datadefinitions, whereas Clock is ideally solved with a 'newtype' and an appropriate alias.The DONT-TEST-STUB mechanism was added by @petertseng in #464 and in particular the commits
The change made in this commit argues that since the example solution has
deriving Eq, adding this to the stub will make the exercise a bit easier, but it still won't give away the central piece.The motivation behind removing DONT-TEST-STUB in Clock is that with this single effort, we can say that all stubs can be compiled and tested. To motivate further, I will cite @rbasso in #466:
This bumps the exercise's version from 2.4.0.9 to 2.4.0.10.