From e79d4464da9ec770b2ebcb8bbefe293c88869060 Mon Sep 17 00:00:00 2001 From: Ladislas de Toldi Date: Tue, 7 Jun 2022 12:07:53 +0200 Subject: [PATCH] :adhesive_bandage: (LogKit): tests - fix warning unknown escape sequence '\.' --- libs/LogKit/tests/LogKit_test_format.cpp | 8 ++++---- libs/LogKit/tests/LogKit_test_log.cpp | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libs/LogKit/tests/LogKit_test_format.cpp b/libs/LogKit/tests/LogKit_test_format.cpp index 8ab75f1c7e..ac0f82dea0 100644 --- a/libs/LogKit/tests/LogKit_test_format.cpp +++ b/libs/LogKit/tests/LogKit_test_format.cpp @@ -40,14 +40,14 @@ TEST_F(LogKitFormatTest, formatFullContentStringOnly) { log_info("Hello, World"); - EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\.]+ \\[[A-Z]+\\] \\[.+:[0-9]+\\] .+() > .+")); + EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\\.]+ \\[[A-Z]+\\] \\[.+:[0-9]+\\] .+() > .+")); } TEST_F(LogKitFormatTest, formatFullContentStringAdditionalArguments) { log_info("Hello, World. %i %s!", 42, "FTW"); - EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\.]+ \\[[A-Z]+\\] \\[.+:[0-9]+\\] .+() > .+")); + EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\\.]+ \\[[A-Z]+\\] \\[.+:[0-9]+\\] .+() > .+")); } TEST_F(LogKitFormatTest, formatFullContentStringEmpty) @@ -55,7 +55,7 @@ TEST_F(LogKitFormatTest, formatFullContentStringEmpty) log_info(""); EXPECT_THAT(spy_sink_output, Not(HasSubstr(" > "))); - EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\.]+ \\[[A-Z]+\\] \\[.+:[0-9]+\\] .+()")); + EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\\.]+ \\[[A-Z]+\\] \\[.+:[0-9]+\\] .+()")); } TEST_F(LogKitFormatTest, formatTimeHumanReadable) @@ -65,7 +65,7 @@ TEST_F(LogKitFormatTest, formatTimeHumanReadable) auto time = std::string(leka::logger::buffer::timestamp.data()); // Format: hhh:mm:ss:μμμ - ASSERT_THAT(time, MatchesRegex("[0-9]{3}:[0-9]{2}:[0-9]{2}\.[0-9]{3}")); + ASSERT_THAT(time, MatchesRegex("[0-9]{3}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}")); } TEST_F(LogKitFormatTest, formatLevel) diff --git a/libs/LogKit/tests/LogKit_test_log.cpp b/libs/LogKit/tests/LogKit_test_log.cpp index e53766aa4b..b2e33de6ad 100644 --- a/libs/LogKit/tests/LogKit_test_log.cpp +++ b/libs/LogKit/tests/LogKit_test_log.cpp @@ -82,15 +82,15 @@ TEST_F(LogKitTest, formatFullContentStringOnly) { log_debug("Hello, World"); - EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\.]+ \\[[A-Z ]+\\] \\[.+:[0-9]+\\] .+() > .+")); + EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\\.]+ \\[[A-Z ]+\\] \\[.+:[0-9]+\\] .+() > .+")); log_info("Hello, World"); - EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\.]+ \\[[A-Z ]+\\] \\[.+:[0-9]+\\] .+() > .+")); + EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\\.]+ \\[[A-Z ]+\\] \\[.+:[0-9]+\\] .+() > .+")); log_error("Hello, World"); - EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\.]+ \\[[A-Z ]+\\] \\[.+:[0-9]+\\] .+() > .+")); + EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\\.]+ \\[[A-Z ]+\\] \\[.+:[0-9]+\\] .+() > .+")); } TEST_F(LogKitTest, formatFullContentStringAdditionalArguments) @@ -98,15 +98,15 @@ TEST_F(LogKitTest, formatFullContentStringAdditionalArguments) { log_debug("Hello, World. %i %s!", 42, "FTW"); - EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\.]+ \\[[A-Z ]+\\] \\[.+:[0-9]+\\] .+() > .+")); + EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\\.]+ \\[[A-Z ]+\\] \\[.+:[0-9]+\\] .+() > .+")); log_info("Hello, World. %i %s!", 42, "FTW"); - EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\.]+ \\[[A-Z ]+\\] \\[.+:[0-9]+\\] .+() > .+")); + EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\\.]+ \\[[A-Z ]+\\] \\[.+:[0-9]+\\] .+() > .+")); log_error("Hello, World. %i %s!", 42, "FTW"); - EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\.]+ \\[[A-Z ]+\\] \\[.+:[0-9]+\\] .+() > .+")); + EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\\.]+ \\[[A-Z ]+\\] \\[.+:[0-9]+\\] .+() > .+")); } TEST_F(LogKitTest, formatFullContentStringEmpty) @@ -114,15 +114,15 @@ TEST_F(LogKitTest, formatFullContentStringEmpty) log_debug(""); EXPECT_THAT(spy_sink_output, Not(HasSubstr(" > "))); - EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\.]+ \\[[A-Z ]+\\] \\[.+:[0-9]+\\] .+()")); + EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\\.]+ \\[[A-Z ]+\\] \\[.+:[0-9]+\\] .+()")); log_info(""); EXPECT_THAT(spy_sink_output, Not(HasSubstr(" > "))); - EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\.]+ \\[[A-Z ]+\\] \\[.+:[0-9]+\\] .+()")); + EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\\.]+ \\[[A-Z ]+\\] \\[.+:[0-9]+\\] .+()")); log_error(""); EXPECT_THAT(spy_sink_output, Not(HasSubstr(" > "))); - EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\.]+ \\[[A-Z ]+\\] \\[.+:[0-9]+\\] .+()")); + EXPECT_THAT(spy_sink_output, MatchesRegex("[0-9:\\.]+ \\[[A-Z ]+\\] \\[.+:[0-9]+\\] .+()")); }