From fdd0cc9e8948bb65c9a461c58e5094a3613bd975 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Sun, 10 Apr 2011 15:25:41 -0700 Subject: [PATCH] Fix path normalization tests They were backtracking too deep into the filesystem on Linux, where the tests were running directly on `tmp/`. --- tests/t00-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/t00-core.c b/tests/t00-core.c index 4cb111428..ab9a683a7 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)); -- 2.39.5