mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 10:01:33 +08:00
update tests
This commit is contained in:
parent
a1f283946e
commit
bfc76278a9
2
build-branch/example/Debug/logs/mylog.txt
Normal file
2
build-branch/example/Debug/logs/mylog.txt
Normal file
@ -0,0 +1,2 @@
|
||||
[2019-10-25 15:16:33.502] [LOGGER] [info] Hello
|
||||
[2019-10-25 15:16:41.712] [LOGGER] [info] Hello
|
1
build-branch/example/Debug/mylog.txt
Normal file
1
build-branch/example/Debug/mylog.txt
Normal file
@ -0,0 +1 @@
|
||||
[2019-10-25 15:16:58.845] [LOGGER] [info] Hello
|
2
build-branch/example/mylog.txt
Normal file
2
build-branch/example/mylog.txt
Normal file
@ -0,0 +1,2 @@
|
||||
[2019-10-25 15:16:53.945] [LOGGER] [info] Hello
|
||||
[2019-10-25 15:18:50.127] [LOGGER] [info] Hello
|
@ -1 +0,0 @@
|
||||
This is async handler error message
|
@ -13,7 +13,6 @@ bool try_create_dir(const char *path, const char *normalized_path)
|
||||
return file_exists(normalized_path);
|
||||
}
|
||||
|
||||
#include "spdlog/sinks/stdout_color_sinks.h"
|
||||
|
||||
TEST_CASE("create_dir", "[create_dir]")
|
||||
{
|
||||
@ -26,7 +25,7 @@ TEST_CASE("create_dir", "[create_dir]")
|
||||
REQUIRE(try_create_dir("test_logs/../test_logs/dir1/dir4", "test_logs/dir1/dir4"));
|
||||
|
||||
#ifdef WIN32
|
||||
// test backslash
|
||||
// test backslash folder separator
|
||||
REQUIRE(try_create_dir("test_logs\\dir1\\dir222", "test_logs\\dir1\\dir222"));
|
||||
REQUIRE(try_create_dir("test_logs\\dir1\\dir223\\", "test_logs\\dir1\\dir223\\"));
|
||||
REQUIRE(try_create_dir(".\\test_logs\\dir1\\dir2\\dir99\\..\\dir23", "test_logs\\dir1\\dir2\\dir23"));
|
||||
@ -45,13 +44,21 @@ TEST_CASE("dir_name", "[create_dir]")
|
||||
REQUIRE(dir_name(R"(dir\)") == "dir");
|
||||
REQUIRE(dir_name(R"(dir\\\)") == R"(dir\\)");
|
||||
REQUIRE(dir_name(R"(dir\file)") == "dir");
|
||||
REQUIRE(dir_name(R"(dir/file)") == "dir");
|
||||
REQUIRE(dir_name(R"(dir\file.txt)") == "dir");
|
||||
REQUIRE(dir_name(R"(dir/file)") == "dir");
|
||||
REQUIRE(dir_name(R"(dir\file.txt\)") == R"(dir\file.txt)");
|
||||
REQUIRE(dir_name(R"(dir/file.txt/)") == R"(dir\file.txt)");
|
||||
REQUIRE(dir_name(R"(\dir\file.txt)") == R"(\dir)");
|
||||
REQUIRE(dir_name(R"(/dir/file.txt)") == R"(\dir)");
|
||||
REQUIRE(dir_name(R"(\\dir\file.txt)") == R"(\\dir)");
|
||||
REQUIRE(dir_name(R"(//dir/file.txt)") == R"(\\dir)");
|
||||
REQUIRE(dir_name(R"(..\file.txt)") == "..");
|
||||
REQUIRE(dir_name(R"(../file.txt)") == "..");
|
||||
REQUIRE(dir_name(R"(.\file.txt)") == ".");
|
||||
REQUIRE(dir_name(R"(./file.txt)") == ".");
|
||||
REQUIRE(dir_name(R"(c:\\a\b\c\d\file.txt)") == R"(c:\\a\b\c\d)");
|
||||
REQUIRE(dir_name(R"(c://a/b/c/d/file.txt)") == R"(c:\\a\b\c\d)");
|
||||
#else
|
||||
REQUIRE(dir_name("dir/") == "dir");
|
||||
REQUIRE(dir_name("dir///") == "dir//");
|
||||
|
Loading…
Reference in New Issue
Block a user