2022-05-17 03:32:25 +03:00
|
|
|
// Formatting library for C++ - tests of formatters for standard library types
|
|
|
|
//
|
|
|
|
// Copyright (c) 2012 - present, Victor Zverovich
|
|
|
|
// All rights reserved.
|
|
|
|
//
|
|
|
|
// For the license information refer to format.h.
|
|
|
|
|
|
|
|
#include "fmt/std.h"
|
|
|
|
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
|
|
|
TEST(std_test, path) {
|
|
|
|
#ifdef __cpp_lib_filesystem
|
2022-05-18 16:04:47 +03:00
|
|
|
EXPECT_EQ(fmt::format("{:8}", std::filesystem::path("foo")), "\"foo\" ");
|
2022-05-21 18:12:32 +03:00
|
|
|
EXPECT_EQ(fmt::format("{}", std::filesystem::path("foo\"bar.txt")),
|
|
|
|
"\"foo\\\"bar.txt\"");
|
2022-05-31 17:58:49 +03:00
|
|
|
|
|
|
|
# ifdef _WIN32
|
|
|
|
EXPECT_EQ(fmt::format("{}", std::filesystem::path(L"Файл.txt")),
|
|
|
|
"\"\xd0\xa4\xd0\xb0\xd0\xb9\xd0\xbb.txt\"");
|
|
|
|
# endif
|
2022-05-17 03:32:25 +03:00
|
|
|
#endif
|
|
|
|
}
|
2022-05-18 02:31:06 +03:00
|
|
|
|
|
|
|
TEST(std_test, thread_id) {
|
|
|
|
EXPECT_FALSE(fmt::format("{}", std::this_thread::get_id()).empty());
|
|
|
|
}
|