ClickHouse/dbms/Disks/tests/gtest_path_functions.cpp
Ivan 97f2a2213e
Move all folders inside /dbms one level up (#9974)
* Move some code outside dbms/src folder
* Fix paths
2020-04-02 02:51:21 +03:00

21 lines
505 B
C++

#include <gtest/gtest.h>
#include <Disks/IDisk.h>
TEST(DiskTest, parentPath)
{
EXPECT_EQ("", DB::parentPath("test_dir/"));
EXPECT_EQ("test_dir/", DB::parentPath("test_dir/nested_dir/"));
EXPECT_EQ("test_dir/", DB::parentPath("test_dir/nested_file"));
}
TEST(DiskTest, fileName)
{
EXPECT_EQ("test_file", DB::fileName("test_file"));
EXPECT_EQ("nested_file", DB::fileName("test_dir/nested_file"));
EXPECT_EQ("", DB::fileName("test_dir/"));
EXPECT_EQ("", DB::fileName(""));
}