Commit fdd0cc9e by Vicent Marti

Fix path normalization tests

They were backtracking too deep into the filesystem on Linux, where the
tests were running directly on `tmp/`.
parent a6359408
...@@ -233,7 +233,7 @@ BEGIN_TEST(path3, "prettify and validate a path to a file") ...@@ -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_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_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_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)); 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") ...@@ -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/..//../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("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("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)); must_fail(ensure_dir_path_normalized("...", NULL, 0));
must_fail(ensure_dir_path_normalized("./...", NULL, 0)); must_fail(ensure_dir_path_normalized("./...", NULL, 0));
......
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