philsquared/Catch — pull request #247 by tclamb (2014-02-22 16:48:59+00:00)
Title: switch from ->* to <= in expression decomposer

Thanks for the awesome test framework. The idea really clever!

One problem I had noticed is that comparisons were asymmetric. Tests such as `REQUIRE( 1+1 == 2 )` would fail, but `REQUIRE( 2 == 1+1 )` would pass. This pull request makes tests symmetric.

The expression decomposition seemed like magic, so I spent some time figuring it out and writing my own [minimal working implementation](https://gist.github.com/tclamb/9149587). During that, I realized expressions containing common binary operators can be used on the LHS if we switch from `->*` to a comparison operator.

This pull request allows expressions containing any of `*`, `/`, `%`, `+`, `-`, `<<` and `>>` to be used on the LHS.

`<=` was chosen arbitrarily from comparison operators, but any of `<=`, `>=`, `<`, and `>` have the same precedence.

No tests broke, and the corresponding originally failing test in `[tricky]` was updated and added to the main suite.