Skip to content

Moving all the core exercises to Catch2.#244

Merged
arcuru merged 8 commits intoexercism:masterfrom
arcuru:core_catch
Apr 6, 2019
Merged

Moving all the core exercises to Catch2.#244
arcuru merged 8 commits intoexercism:masterfrom
arcuru:core_catch

Conversation

@arcuru
Copy link
Copy Markdown
Contributor

@arcuru arcuru commented Mar 27, 2019

Drops Boost for Catch 2.7.0 in the core exercises (after #240 is merged). Depends on #239 getting merged first.

Related to #233.

@arcuru arcuru mentioned this pull request Mar 27, 2019
6 tasks
@elyashiv
Copy link
Copy Markdown
Contributor

Looks nice. The errors also look quite clear.
I will like to see how hard is it to migrate more complex test case. Two I can think of are handling scoped enums in triangle, and array compression in binary_tree.

@arcuru
Copy link
Copy Markdown
Contributor Author

arcuru commented Mar 30, 2019

@elyashiv That's a good idea, these are mostly only the simplistic test cases. I'll setup some of the more complex cases in a different PR.

Triangle is pretty easy, there should be only limited difference from my older changes - https://github.com/exercism/cpp/blob/remove_boost/exercises/triangle/triangle_test.cpp

For all the instances of BOOST_REQUIRE_EQUAL_COLLECTIONS, Catch instead relies on using REQUIRE statements and gives pretty good error messages ( It also has Matchers which also has some overlap with that, but those aren't likely to be too useful for the existing tests at least since we're comparing against a fully known output). Most places we use that are just comparing two containers, so we can switch to just using REQUIRE(expected == actual). The trickiest compare is probably going to be the comparison using the iterator in binary_search_tree, which I should be able to do by just building a container out of the iterator. I'll mess around with it to figure out a good solution.

As an example of a failure, I edited one element of a vector and did a comparison to give this output (which is colored too):

exercises/anagram/anagram_test.cpp:42: FAILED:
  REQUIRE( expected == matches )
with expansion:
  { "stream", "maers" }
  ==
  { "stream", "maters" }

===============================================================================
test cases: 10 | 9 passed | 1 failed
assertions: 10 | 9 passed | 1 failed

@arcuru arcuru changed the title Moving the first few core exercises to Catch2. Moving all the core exercises to Catch2. Mar 31, 2019
@arcuru arcuru merged commit 4119bdf into exercism:master Apr 6, 2019
@arcuru arcuru deleted the core_catch branch April 6, 2019 16:45
@arcuru arcuru mentioned this pull request Apr 6, 2019
48 tasks
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.

2 participants