tap: add expect_valid test

This commit is contained in:
Danny Robson 2018-08-08 12:49:47 +10:00
parent 3a4a7bf1d8
commit d1866d9b70

15
tap.hpp
View File

@ -62,6 +62,21 @@ namespace cruft::TAP {
}
///////////////////////////////////////////////////////////////////////
template <typename ValueT, size_t N, typename ...ArgsT>
decltype(auto)
expect_valid (ValueT &&value, char const (&fmt)[N], ArgsT &&...args)
{
return expect (
debug::is_valid (
std::forward<ValueT> (value)
),
fmt,
std::forward<ArgsT> (args)...
);
}
///////////////////////////////////////////////////////////////////////
template <typename ValueA, typename ValueB, std::size_t N, typename ...Args>
decltype(auto)