tap: add proof-of-concept printf chaining

This commit is contained in:
Danny Robson 2018-04-16 15:55:47 +10:00
parent 52fcb847c9
commit 401c59bc0e

View File

@ -81,7 +81,14 @@ namespace util::TAP {
void
expect_eq (const T &a, const U &b, const char (&fmt)[N], Args&&...args)
{
#if 1
expect (almost_equal (a, b), fmt, std::forward<Args> (args)...);
#else
if (almost_equal (a, b))
return expect (true, fmt, std::forward<Args> (args)...);
else
return expect (false, "%! # %! != %!", format::printf (fmt)(std::forward<Args> (args)...), a, b);
#endif
}