summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2021-05-27 14:03:55 +0200
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-05-27 18:21:36 +0430
commite87a9a7f9f0fcccfb222b737b55869ff86f6f30d (patch)
treecfb1ce76ce3032e6568f393c76e99fae0f20cb5e /Tests
parent0aaa992c1ceed0927bebbdbfaf7c095acccb289b (diff)
downloadserenity-e87a9a7f9f0fcccfb222b737b55869ff86f6f30d.zip
Tests: Add tests for LexicalPath dirname handling
Diffstat (limited to 'Tests')
-rw-r--r--Tests/AK/TestLexicalPath.cpp8
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(), "/");
+}