summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2011-02-25 15:09:31 +0100
committerVicent Marti <tanoku@gmail.com>2011-03-03 20:23:50 +0200
commit47d0db78bb1e52925b726450572b17bd7805a196 (patch)
treed204d96476f828d03f57affba93bc1bc320a24b9 /tests
parent87d3acf45eb1a63b5847bca2061a993471b8b1ee (diff)
downloadlibgit2-47d0db78bb1e52925b726450572b17bd7805a196.tar.gz
Added some dirname and basename tests to ensure that trailing slashes are ignored.
Diffstat (limited to 'tests')
-rw-r--r--tests/t00-core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/t00-core.c b/tests/t00-core.c
index c8a9f0624..216a19837 100644
--- a/tests/t00-core.c
+++ b/tests/t00-core.c
@@ -78,7 +78,11 @@ BEGIN_TEST("strutil", dirname)
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(".git/", ".");
#undef DIRNAME_TEST
@@ -103,6 +107,7 @@ BEGIN_TEST("strutil", basename)
BASENAME_TEST("/usr", "usr");
BASENAME_TEST("/usr/", "usr");
BASENAME_TEST("/usr/lib", "lib");
+ BASENAME_TEST("/usr/lib//", "lib");
BASENAME_TEST("usr/lib", "lib");
#undef BASENAME_TEST