Skip to content

Conversation

@petertseng
Copy link
Member

@petertseng petertseng commented Jan 11, 2017

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.

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);
Copy link
Member Author

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.

Copy link
Member Author

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.
@petertseng
Copy link
Member Author

In the absence of any other reviewers, I am forced to merge my own PR.

@petertseng petertseng merged commit 9331ce0 into exercism:master Jan 14, 2017
@petertseng petertseng deleted the travis branch January 14, 2017 02:16
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant