From 401c59bc0e3b9855fb3788acef14afb59f31f11e Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 16 Apr 2018 15:55:47 +1000 Subject: [PATCH] tap: add proof-of-concept printf chaining --- tap.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tap.hpp b/tap.hpp index f53de8e0..d8e94d4c 100644 --- a/tap.hpp +++ b/tap.hpp @@ -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)...); +#else + if (almost_equal (a, b)) + return expect (true, fmt, std::forward (args)...); + else + return expect (false, "%! # %! != %!", format::printf (fmt)(std::forward (args)...), a, b); +#endif }