mirror of
https://github.com/gabime/spdlog.git
synced 2025-10-02 11:29:01 +08:00
Compare commits
1 Commits
codex/fix-
...
4xjtpd-cod
Author | SHA1 | Date | |
---|---|---|---|
![]() |
dc578cccff |
@@ -15,9 +15,10 @@ TEST_CASE("ringbuffer stores formatted messages", "[ringbuffer]") {
|
||||
|
||||
auto formatted = sink.last_formatted();
|
||||
REQUIRE(formatted.size() == 3);
|
||||
REQUIRE(formatted[0] == "msg1");
|
||||
REQUIRE(formatted[1] == "msg2");
|
||||
REQUIRE(formatted[2] == "msg3");
|
||||
using spdlog::details::os::default_eol;
|
||||
REQUIRE(formatted[0] == spdlog::fmt_lib::format("msg1{}", default_eol));
|
||||
REQUIRE(formatted[1] == spdlog::fmt_lib::format("msg2{}", default_eol));
|
||||
REQUIRE(formatted[2] == spdlog::fmt_lib::format("msg3{}", default_eol));
|
||||
}
|
||||
|
||||
TEST_CASE("ringbuffer overrun keeps last items", "[ringbuffer]") {
|
||||
@@ -30,8 +31,9 @@ TEST_CASE("ringbuffer overrun keeps last items", "[ringbuffer]") {
|
||||
|
||||
auto formatted = sink.last_formatted();
|
||||
REQUIRE(formatted.size() == 2);
|
||||
REQUIRE(formatted[0] == "second");
|
||||
REQUIRE(formatted[1] == "third");
|
||||
using spdlog::details::os::default_eol;
|
||||
REQUIRE(formatted[0] == spdlog::fmt_lib::format("second{}", default_eol));
|
||||
REQUIRE(formatted[1] == spdlog::fmt_lib::format("third{}", default_eol));
|
||||
}
|
||||
|
||||
TEST_CASE("ringbuffer retrieval limit", "[ringbuffer]") {
|
||||
@@ -44,7 +46,8 @@ TEST_CASE("ringbuffer retrieval limit", "[ringbuffer]") {
|
||||
|
||||
auto formatted = sink.last_formatted(2);
|
||||
REQUIRE(formatted.size() == 2);
|
||||
REQUIRE(formatted[0] == "B");
|
||||
REQUIRE(formatted[1] == "C");
|
||||
using spdlog::details::os::default_eol;
|
||||
REQUIRE(formatted[0] == spdlog::fmt_lib::format("B{}", default_eol));
|
||||
REQUIRE(formatted[1] == spdlog::fmt_lib::format("C{}", default_eol));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user