-
-
Notifications
You must be signed in to change notification settings - Fork 9
leap: add new exercise; travis: test each exercise #8
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
Conversation
This is possible because exercism#5 (Ceylon icon) caused the img dir to no longer be empty.
There is no change in functionality here, but it's a semantics thing
Closes exercism#4 trivially because we have no exercises! Affirm that problems is safe to remove: exercism/DEPRECATED.x-api#137
| test | ||
| parameters(`value cases`) | ||
| shared void testLeapYear(Integer year, Boolean isLeap) { | ||
| assert(leapYear(year) == isLeap); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try assertEquals instead of this plain assert(a == b), see if it gives richer info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current failure message:
Assertion failed
violated leapYear(year) == isLeap
With assertEquals: assertion failed: expected <true> but was <false>
I like assertEquals message better.
By exercism#1: > If the test filenames contain the word "test" (case insensitive) then the `"test_pattern"` key can be deleted. Indeed, the first added exercise, leap, has `LeapTest.ceylon` as its name.
Possible now that there is an exercise, meaning the exercises dir is no longer empty.
|
In the absence of any other reviewers, I am forced to merge my own PR. |
In various tracks, I sometimes see contributors forget to do this, and
perhaps one cause is that the requirement isn't mentioned here (various
tracks link to this document to explain how to port an exercise to their
track).
Luckily, this gets caught by configlet (assuming the track is running
Travis CI and hasn't removed configlet), but it would be good to let
contributors to know of this up front.
Decision: This text explcitly mentions the `"exercises"` key, rather
than the deprecated `"problems"` key.
The following procedure:
gem install trackler --ignore-dependencies
# substitute your Ruby version for $RUBY_VERSION
grep -L exercises ~/.gem/ruby/$RUBY_VERSION/gems/trackler-2.0.6.10/tracks/*/config.json
says that only two tracks lack the `exercises` key: Ceylon and PL/SQL
* a PR exercism/plsql#16 is open for PL/SQL
* a PR exercism/ceylon#8 has already been
merged in Ceylon and will go out in the next Trackler update.
Therefore, it almost certainly safe to use the `exercises` key!
One weakness is that this text doesn't explicitly mention the `slug` or
`difficulty` or `topics` keys for each entry in the `exercises` array.
This weakness is currently mitigated by the fact that active languages
should have many examples to go off of. The only time where there are no
examples will be when starting a brand-new track.
You would think these are two unrelated things, but it seems to me that neither can stand on its own: I wouldn't want to add an exercise without assuring that it is in fact good, and making Travis test all exercises will have no effect unless there is some exercise to test.
So these together will get the track's inaugural exercise created and tested on Travis. Now that this work is done, hopefully less work to add future exercises.