forked from Alepha/Alepha
Boolean test lambdas can now be used properly.
This commit is contained in:
@ -96,6 +96,20 @@ namespace Alepha::Hydrogen::Testing
|
||||
template< typename Integer, typename= std::enable_if_t< std::is_integral_v< Integer > > >
|
||||
inline auto
|
||||
operator <= ( TestName name, std::function< Integer () > test )
|
||||
{
|
||||
if constexpr( std::is_same_v< Integer, bool > )
|
||||
{
|
||||
auto wrapper= [test]
|
||||
{
|
||||
if( not test )
|
||||
{
|
||||
throw TestFailureException{ 1 };
|
||||
}
|
||||
};
|
||||
|
||||
return name <= wrapper;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto wrapper= [test]
|
||||
{
|
||||
@ -105,6 +119,7 @@ namespace Alepha::Hydrogen::Testing
|
||||
|
||||
return name <= wrapper;
|
||||
}
|
||||
}
|
||||
|
||||
namespace exports
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user