Commit bfc76278 authored by gabime's avatar gabime

update tests

parent a1f28394
[2019-10-25 15:16:33.502] [LOGGER] [info] Hello
[2019-10-25 15:16:41.712] [LOGGER] [info] Hello
[2019-10-25 15:16:58.845] [LOGGER] [info] Hello
[2019-10-25 15:16:53.945] [LOGGER] [info] Hello
[2019-10-25 15:18:50.127] [LOGGER] [info] Hello
This is async handler error message
\ No newline at end of file
...@@ -13,7 +13,6 @@ bool try_create_dir(const char *path, const char *normalized_path) ...@@ -13,7 +13,6 @@ bool try_create_dir(const char *path, const char *normalized_path)
return file_exists(normalized_path); return file_exists(normalized_path);
} }
#include "spdlog/sinks/stdout_color_sinks.h"
TEST_CASE("create_dir", "[create_dir]") TEST_CASE("create_dir", "[create_dir]")
{ {
...@@ -26,7 +25,7 @@ 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")); REQUIRE(try_create_dir("test_logs/../test_logs/dir1/dir4", "test_logs/dir1/dir4"));
#ifdef WIN32 #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\\dir222", "test_logs\\dir1\\dir222"));
REQUIRE(try_create_dir("test_logs\\dir1\\dir223\\", "test_logs\\dir1\\dir223\\")); 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")); 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]") ...@@ -45,13 +44,21 @@ TEST_CASE("dir_name", "[create_dir]")
REQUIRE(dir_name(R"(dir\)") == "dir"); REQUIRE(dir_name(R"(dir\)") == "dir");
REQUIRE(dir_name(R"(dir\\\)") == R"(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)") == "dir");
REQUIRE(dir_name(R"(dir\file.txt)") == "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\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"(\\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"(.\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)");
REQUIRE(dir_name(R"(c://a/b/c/d/file.txt)") == R"(c:\\a\b\c\d)");
#else #else
REQUIRE(dir_name("dir/") == "dir"); REQUIRE(dir_name("dir/") == "dir");
REQUIRE(dir_name("dir///") == "dir//"); REQUIRE(dir_name("dir///") == "dir//");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment