diff options
author | Tim Schumacher <timschumi@gmx.de> | 2021-05-27 14:03:55 +0200 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-05-27 18:21:36 +0430 |
commit | e87a9a7f9f0fcccfb222b737b55869ff86f6f30d (patch) | |
tree | cfb1ce76ce3032e6568f393c76e99fae0f20cb5e /Tests | |
parent | 0aaa992c1ceed0927bebbdbfaf7c095acccb289b (diff) | |
download | serenity-e87a9a7f9f0fcccfb222b737b55869ff86f6f30d.zip |
Tests: Add tests for LexicalPath dirname handling
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/AK/TestLexicalPath.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/AK/TestLexicalPath.cpp b/Tests/AK/TestLexicalPath.cpp index 0aa9986c9c..b9ba6aebe1 100644 --- a/Tests/AK/TestLexicalPath.cpp +++ b/Tests/AK/TestLexicalPath.cpp @@ -78,3 +78,11 @@ TEST_CASE(relative_path) EXPECT_EQ(LexicalPath::relative_path("/tmp/foo.txt", "tmp"), String {}); EXPECT_EQ(LexicalPath::relative_path("tmp/foo.txt", "/tmp"), String {}); } + +TEST_CASE(dirname) +{ + EXPECT_EQ(LexicalPath(".").dirname(), "."); + EXPECT_EQ(LexicalPath("/").dirname(), "/"); + EXPECT_EQ(LexicalPath("abc.txt").dirname(), "."); + EXPECT_EQ(LexicalPath("/abc.txt").dirname(), "/"); +} |