tap: add proof-of-concept printf chaining
This commit is contained in:
parent
52fcb847c9
commit
401c59bc0e
7
tap.hpp
7
tap.hpp
@ -81,7 +81,14 @@ namespace util::TAP {
|
|||||||
void
|
void
|
||||||
expect_eq (const T &a, const U &b, const char (&fmt)[N], Args&&...args)
|
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)...);
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user