message: Fix error checks on GCC
diff: @@ -341,9 +341,18 @@ CAF_TEST(ranges can use signed integers) {
  CHECK_RANGE("-2..+2..+2", -2, 0, 2);
  }
  +#define CHECK_ERR(expr, enum_value) \
  + if (auto res = r(expr)) { \
  + CAF_FAIL("expected expression to produce to an error"); \
  + } else { \
  + auto& err = res.error(); \
  + CAF_CHECK_EQUAL(err.category(), atom("parser")); \
  + CAF_CHECK_EQUAL(err.code(), static_cast<uint8_t>(enum_value)); \
  + }
  +
  CAF_TEST(the parser rejects invalid step values) {
  - CAF_CHECK_EQUAL(r("-2..+2..-2"), pec::invalid_range_expression);
  - CAF_CHECK_EQUAL(r("+2..-2..+2"), pec::invalid_range_expression);
  + CHECK_ERR("-2..+2..-2", pec::invalid_range_expression);
  + CHECK_ERR("+2..-2..+2", pec::invalid_range_expression);
  }
  CAF_TEST_FIXTURE_SCOPE_END()
  