diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2019-09-24 10:05:21 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2019-09-24 10:05:21 -0500 |
| commit | 8c41d36a083da4ffb4ec406e56c888d0105abc08 (patch) | |
| tree | 0c43572414addbdef286799b297f4648c60d407d /tests | |
| parent | a1736a94298fefb3c33adbf22e9333ced55c15bd (diff) | |
| parent | 32f725d32f8e15f9bd4d0607251ede14c38fd993 (diff) | |
| download | monzero-core-8c41d36a083da4ffb4ec406e56c888d0105abc08.tar.gz monzero-core-8c41d36a083da4ffb4ec406e56c888d0105abc08.tar.xz monzero-core-8c41d36a083da4ffb4ec406e56c888d0105abc08.zip | |
Merge pull request #5864
32f725d Properly format multiline logs (moneromooo-monero)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit_tests/logging.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/unit_tests/logging.cpp b/tests/unit_tests/logging.cpp index 056eae604..c8526abae 100644 --- a/tests/unit_tests/logging.cpp +++ b/tests/unit_tests/logging.cpp @@ -178,3 +178,20 @@ TEST(logging, last_precedence) cleanup(); } +TEST(logging, multiline) +{ + init(); + mlog_set_categories("global:INFO"); + MGINFO("first\nsecond\nthird"); + std::string str; + ASSERT_TRUE(load_log_to_string(log_filename, str)); + ASSERT_TRUE(nlines(str) == 3); + ASSERT_TRUE(str.find("global") != std::string::npos); + ASSERT_TRUE(str.find("first") != std::string::npos); + ASSERT_TRUE(str.find("second") != std::string::npos); + ASSERT_TRUE(str.find("third") != std::string::npos); + ASSERT_TRUE(str.find("first\nsecond") == std::string::npos); + ASSERT_TRUE(str.find("second\nthird") == std::string::npos); + cleanup(); +} + |
