3 ms·
To be honest, I prefer bandit[1], it uses lambdas instead of macros which I consider more modern and it has a nice syntax to it. Anyone interested in catch shou
by Svenstaro 12y ago
To be honest, I prefer bandit[1], it uses lambdas instead of macros which I consider more modern and it has a nice syntax to it. Anyone interested in catch should also check out bandit.
[1] http://banditcpp.org/index.html http://banditcpp.org/index.html
- wtracy 12y agoI found the Bandit examples rather disorienting. Can anyone explain what the "[&](){" business means?
- vowelless 12y agoThat's the syntax for describing a lambda function. CPP reference has a nice overview of it: http://en.cppreference.com/w/cpp/language/lambda http://en.cppreference.com/w/cpp/language/lambda
- tveita 12y agoOne advantage of Catch is that you can use native C++ expressions in your assertions, so instead of AssertThat(guitar->sound(), Equals(sounds::clean)); you can write CHECK(guitar->sound() == sounds::clean); And you'll still get sensible output when it fails, showing the expression and the result of guitar->sound().
- banachtarski 12y agoThis isn't so much an advantage as a preference. See https://github.com/joakimkarlsson/snowhouse#assertions https://github.com/joakimkarlsson/snowhouse#assertions