Commit fdd0cc9e8948bb65c9a461c58e5094a3613bd975

Vicent Marti 2011-04-10T15:25:41

Fix path normalization tests They were backtracking too deep into the filesystem on Linux, where the tests were running directly on `tmp/`.

diff --git a/tests/t00-core.c b/tests/t00-core.c
index 4cb1114..ab9a683 100644
--- a/tests/t00-core.c
+++ b/tests/t00-core.c
@@ -233,7 +233,7 @@ BEGIN_TEST(path3, "prettify and validate a path to a file")
 	must_fail(ensure_file_path_normalized("d1/s1///s2/..//../s3/", NULL, 0));
 	must_pass(ensure_file_path_normalized("d1/s1//../s2/../../d2", "d2", CWD_AS_PREFIX | PATH_AS_SUFFIX));
 	must_fail(ensure_file_path_normalized("dir/sub/../", NULL, 0));
-	must_pass(ensure_file_path_normalized("../../a/../../b/c/d/../../e", "b/e", PATH_AS_SUFFIX));
+	must_pass(ensure_file_path_normalized("../a/../b/c/d/../../e", "b/e", PATH_AS_SUFFIX));
 	must_fail(ensure_file_path_normalized("....", NULL, 0));
 	must_fail(ensure_file_path_normalized("...", NULL, 0));
 	must_fail(ensure_file_path_normalized("./...", NULL, 0));
@@ -309,7 +309,7 @@ BEGIN_TEST(path4, "validate and prettify a path to a folder")
 	must_pass(ensure_dir_path_normalized("d1/s1///s2/..//../s3/", "d1/s3/", CWD_AS_PREFIX | PATH_AS_SUFFIX));
 	must_pass(ensure_dir_path_normalized("d1/s1//../s2/../../d2", "d2/", CWD_AS_PREFIX | PATH_AS_SUFFIX));
 	must_pass(ensure_dir_path_normalized("dir/sub/../", "dir/", CWD_AS_PREFIX | PATH_AS_SUFFIX));
-	must_pass(ensure_dir_path_normalized("../../a/../../b/c/d/../../e", "b/e/", PATH_AS_SUFFIX));
+	must_pass(ensure_dir_path_normalized("../a/../b/c/d/../../e", "b/e/", PATH_AS_SUFFIX));
 	must_fail(ensure_dir_path_normalized("....", NULL, 0));
 	must_fail(ensure_dir_path_normalized("...", NULL, 0));
 	must_fail(ensure_dir_path_normalized("./...", NULL, 0));