Commit 47d0db78 by nulltoken Committed by Vicent Marti

Added some dirname and basename tests to ensure that trailing slashes are ignored.

parent 87d3acf4
...@@ -78,7 +78,11 @@ BEGIN_TEST("strutil", dirname) ...@@ -78,7 +78,11 @@ BEGIN_TEST("strutil", dirname)
DIRNAME_TEST("/usr", "/"); DIRNAME_TEST("/usr", "/");
DIRNAME_TEST("/usr/", "/"); DIRNAME_TEST("/usr/", "/");
DIRNAME_TEST("/usr/lib", "/usr"); DIRNAME_TEST("/usr/lib", "/usr");
DIRNAME_TEST("/usr/lib/", "/usr");
DIRNAME_TEST("/usr/lib//", "/usr");
DIRNAME_TEST("usr/lib", "usr"); DIRNAME_TEST("usr/lib", "usr");
DIRNAME_TEST("usr/lib/", "usr");
DIRNAME_TEST("usr/lib//", "usr");
DIRNAME_TEST(".git/", "."); DIRNAME_TEST(".git/", ".");
#undef DIRNAME_TEST #undef DIRNAME_TEST
...@@ -103,6 +107,7 @@ BEGIN_TEST("strutil", basename) ...@@ -103,6 +107,7 @@ BEGIN_TEST("strutil", basename)
BASENAME_TEST("/usr", "usr"); BASENAME_TEST("/usr", "usr");
BASENAME_TEST("/usr/", "usr"); BASENAME_TEST("/usr/", "usr");
BASENAME_TEST("/usr/lib", "lib"); BASENAME_TEST("/usr/lib", "lib");
BASENAME_TEST("/usr/lib//", "lib");
BASENAME_TEST("usr/lib", "lib"); BASENAME_TEST("usr/lib", "lib");
#undef BASENAME_TEST #undef BASENAME_TEST
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment