leap: add new exercise; travis: test each exercise#8
Merged
petertseng merged 9 commits intoexercism:masterfrom Jan 14, 2017
Merged
leap: add new exercise; travis: test each exercise#8petertseng merged 9 commits intoexercism:masterfrom
petertseng merged 9 commits intoexercism:masterfrom
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
petertseng
commented
Jan 11, 2017
| test | ||
| parameters(`value cases`) | ||
| shared void testLeapYear(Integer year, Boolean isLeap) { | ||
| assert(leapYear(year) == isLeap); |
Member
Author
There was a problem hiding this comment.
try assertEquals instead of this plain assert(a == b), see if it gives richer info.
Member
Author
There was a problem hiding this comment.
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.
Merged
Member
Author
|
In the absence of any other reviewers, I am forced to merge my own PR. |
petertseng
added a commit
to exercism/problem-specifications
that referenced
this pull request
Jan 17, 2017
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.