Hacker News new | past | comments | ask | show | jobs | submit login

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

One 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().

This isn't so much an advantage as a preference.

See https://github.com/joakimkarlsson/snowhouse#assertions

I found the Bandit examples rather disorienting. Can anyone explain what the "[&](){" business means?

That's the syntax for describing a lambda function.

CPP reference has a nice overview of it: http://en.cppreference.com/w/cpp/language/lambda

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact