mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 10:52:30 +00:00
21 lines
505 B
C++
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(""));
|
||
|
}
|