From 6d216bdd07995f35139fa03829ae05a83a15c281 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 23 Jun 2021 16:05:47 +0200 Subject: [PATCH] test-path-util: check that dot components are irrelevant for path comparisons --- src/test/test-path-util.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c index 50aacdb967..4c041cd57f 100644 --- a/src/test/test-path-util.c +++ b/src/test/test-path-util.c @@ -126,6 +126,8 @@ static void test_path_compare_one(const char *a, const char *b, int expected) { } static void test_path_compare(void) { + log_info("/* %s */", __func__); + test_path_compare_one("/goo", "/goo", 0); test_path_compare_one("/goo", "/goo", 0); test_path_compare_one("//goo", "/goo", 0); @@ -138,6 +140,12 @@ static void test_path_compare(void) { test_path_compare_one("/x", "x/", 1); test_path_compare_one("x/", "/", -1); test_path_compare_one("/x/./y", "x/y", 1); + test_path_compare_one("/x/./y", "/x/y", 0); + test_path_compare_one("/x/./././y", "/x/y/././.", 0); + test_path_compare_one("./x/./././y", "./x/y/././.", 0); + test_path_compare_one(".", "./.", 0); + test_path_compare_one(".", "././.", 0); + test_path_compare_one("./..", ".", 1); test_path_compare_one("x/.y", "x/y", -1); test_path_compare_one("foo", "/foo", -1); test_path_compare_one("/foo", "/foo/bar", -1); -- 2.25.1