diff --git a/xo-indentlog/utest/cond.test.cpp b/xo-indentlog/utest/cond.test.cpp index e421c642..d360a449 100644 --- a/xo-indentlog/utest/cond.test.cpp +++ b/xo-indentlog/utest/cond.test.cpp @@ -37,8 +37,21 @@ namespace ut { { std::stringstream ss; + int * ptr = nullptr; - ss << cond(ptr != nullptr, xtag("ptr", 123), xtag("ptr", "null")); + + ss << cond(ptr, xtag("ptr", 123), xtag("ptr", "null")); + + REQUIRE(ss.str() == " :ptr null"); + } + + { + std::stringstream ss; + + int * ptr = nullptr; + + ss << xtag("ptr", cond(ptr, 123, "null")); + REQUIRE(ss.str() == " :ptr null"); } }