add Path::ext()
This commit is contained in:
1 parent
87c3abe0fa
commit
a1e9c30af2
3 files changed
+38
No files matched your search
@@ -31,6 +31,7 @@ TEST(PathTest, joins_two_paths_together)
|
||||
|
||||
TEST(PathTest, dirname)
|
||||
{
|
||||
EXPECT_EQ("", Path("").dirname()->to_s());
|
||||
EXPECT_EQ("/one/two", Path("/one/two/f.c").dirname()->to_s());
|
||||
EXPECT_EQ("C:/a", Path("C:\\a\\b\\").dirname()->to_s());
|
||||
EXPECT_EQ("/", Path("/").dirname()->to_s());
|
||||
@@ -40,6 +41,16 @@ TEST(PathTest, dirname)
|
||||
EXPECT_EQ("a", Path("a/b").dirname()->to_s());
|
||||
}
|
||||
|
||||
TEST(PathTest, ext)
|
||||
{
|
||||
EXPECT_EQ("", Path("").ext("")->to_s());
|
||||
EXPECT_EQ("", Path("").ext("h")->to_s());
|
||||
EXPECT_EQ("file.h", Path("file.c").ext(".h")->to_s());
|
||||
EXPECT_EQ("file.h", Path("file.c").ext("h")->to_s());
|
||||
EXPECT_EQ("/some/crazy/dir/foo.txt", Path("/some/crazy/dir/foo").ext(".txt")->to_s());
|
||||
EXPECT_EQ("/some/crazy/dir/foo.txt", Path("/some/crazy/dir/foo").ext("txt")->to_s());
|
||||
}
|
||||
|
||||
TEST(PathTest, exists)
|
||||
{
|
||||
EXPECT_TRUE(Path("runtime").exists());
|
||||
|
||||
Reference in new issue
Block a user