diff options
author | 2013-08-27 18:26:22 -0700 | |
---|---|---|
committer | 2013-08-27 18:26:22 -0700 | |
commit | 24f1da7f309f7e7077e265e1777c9da46ff65e37 (patch) | |
tree | 25f6278f07e4a6c463e999bb4c3384f7f59e9fac /fish_tests.cpp | |
parent | 85ce80d72e666d51b52f8a54e8143062478286e4 (diff) |
Add a fancy new paths_are_equivalent function to test for equivalent
paths instead of merely equal ones
Diffstat (limited to 'fish_tests.cpp')
-rw-r--r-- | fish_tests.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fish_tests.cpp b/fish_tests.cpp index 41464c31..b47ce3a3 100644 --- a/fish_tests.cpp +++ b/fish_tests.cpp @@ -766,9 +766,8 @@ static void test_path() say(L"Testing path functions"); wcstring path = L"//foo//////bar/"; - wcstring canon = path; - path_make_canonical(canon); - if (canon != L"/foo/bar") + path_make_canonical(path); + if (path != L"/foo/bar") { err(L"Bug in canonical PATH code"); } @@ -779,6 +778,11 @@ static void test_path() { err(L"Bug in canonical PATH code"); } + + if (paths_are_equivalent(L"/foo/bar/baz", L"foo/bar/baz")) err(L"Bug in canonical PATH code on line %ld", (long)__LINE__); + if (! paths_are_equivalent(L"///foo///bar/baz", L"/foo/bar////baz//")) err(L"Bug in canonical PATH code on line %ld", (long)__LINE__); + if (! paths_are_equivalent(L"/foo/bar/baz", L"/foo/bar/baz")) err(L"Bug in canonical PATH code on line %ld", (long)__LINE__); + if (! paths_are_equivalent(L"/", L"/")) err(L"Bug in canonical PATH code on line %ld", (long)__LINE__); } enum word_motion_t |