Given EXPECT( 1==9 || 1==8 );doctest currently gives a false positive (see issue 30), whereas CATCH warns that the expression is 'too complicated' via a static assert.
lest currently gives a compile-time error that doesn't give a hint as to what the problem is:
Visual C++ 2015:
issue-exprdecomp-too-complex.cpp(7): error C2440: 'initializing': cannot convert from 'bool' to 'lest::result'
issue-exprdecomp-too-complex.cpp(7): note: No constructor could take the source type, or constructor overload resolution was ambiguous
GCC:
In file included from issue-expr-too-complex.cpp:1:0:
issue-expr-too-complex.cpp: In lambda function:
issue-expr-too-complex.cpp:7:22: error: conversion from 'bool' to non-scalar type 'lest::result' requested
EXPECT( 1==9 || 1==8 );
^
../../lest/include/lest/lest.hpp:216:67: note: in definition of macro 'lest_DECOMPOSE'
#define lest_DECOMPOSE( expr ) ( lest::expression_decomposer() << expr )
^
../../lest/include/lest/lest.hpp:80:28: note: in expansion of macro 'lest_EXPECT'
# define EXPECT lest_EXPECT
^
issue-expr-too-complex.cpp:7:9: note: in expansion of macro 'EXPECT'
EXPECT( 1==9 || 1==8 );
^
Perhaps it's a good idea too warn too simplify the expression like CATCH does.
Given
EXPECT( 1==9 || 1==8 );
doctest currently gives a false positive (see issue 30), whereas CATCH warns that the expression is 'too complicated' via a static assert.lest
currently gives a compile-time error that doesn't give a hint as to what the problem is:Visual C++ 2015:
GCC:
Perhaps it's a good idea too warn too simplify the expression like CATCH does.