Added tests for log functions.

pull/2667/head
Gianluca Martino 3 years ago
parent 8ae7e4d763
commit e950911a4a

@ -258,6 +258,18 @@ TEST_CASE("default logger API", "[default logger]")
spdlog::error(123);
REQUIRE(oss.str() == "*** 123" + std::string(spdlog::details::os::default_eol));
oss.str("");
spdlog::log(spdlog::level::err, 123);
REQUIRE(oss.str() == "*** 123" + std::string(spdlog::details::os::default_eol));
oss.str("");
spdlog::log(spdlog::level::err, "{}", 123);
REQUIRE(oss.str() == "*** 123" + std::string(spdlog::details::os::default_eol));
oss.str("");
spdlog::log(spdlog::level::err, "{}{}{}", 1, 2, 3);
REQUIRE(oss.str() == "*** 123" + std::string(spdlog::details::os::default_eol));
oss.str("");
spdlog::critical(std::string("some string"));
REQUIRE(oss.str() == "*** some string" + std::string(spdlog::details::os::default_eol));

Loading…
Cancel
Save