diff options
author | Руслан Ижбулатов <lrn1986@gmail.com> | 2019-02-08 20:59:23 +0000 |
---|---|---|
committer | Philip Withnall <withnall@endlessm.com> | 2019-02-13 08:49:42 +0000 |
commit | 1e74b5872e555ee1aee6fa623d200ebb9654d62d (patch) | |
tree | 8aa57e28b9860b0bbc3108a5d57dfa7898cab32a /tests | |
parent | 3ffa7ed0b6dccfa0368267807a4c8adfdd38be94 (diff) | |
download | glib-1e74b5872e555ee1aee6fa623d200ebb9654d62d.tar.gz |
GLib test: Adjust to follow the implementation
Canonicalization converts slashes to backslashes on Windows (most
of the time). This is a horrible design decision, but that's what
it does, and it's too late to change that. The test shouldn't expect
anything else.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testglib.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/testglib.c b/tests/testglib.c index f29bbc664..687fadd5b 100644 --- a/tests/testglib.c +++ b/tests/testglib.c @@ -843,6 +843,7 @@ test_paths (void) gchar *relative_path; gchar *canonical_path; } canonicalize_filename_checks[] = { +#ifndef G_OS_WIN32 { "/etc", "../usr/share", "/usr/share" }, { "/", "/foo/bar", "/foo/bar" }, { "/usr/bin", "../../foo/bar", "/foo/bar" }, @@ -857,7 +858,22 @@ test_paths (void) { "///triple/slash", ".", "/triple/slash" }, { "//double/slash", ".", "//double/slash" }, { "/cwd/../with/./complexities/", "./hello", "/with/complexities/hello" }, -#ifdef G_OS_WIN32 +#else + { "/etc", "../usr/share", "\\usr\\share" }, + { "/", "/foo/bar", "\\foo\\bar" }, + { "/usr/bin", "../../foo/bar", "\\foo\\bar" }, + { "/", "../../foo/bar", "\\foo\\bar" }, + { "/double//dash", "../../foo/bar", "\\foo\\bar" }, + { "/usr/share/foo", ".././././bar", "\\usr\\share\\bar" }, + { "/foo/bar", "../bar/./.././bar", "\\foo\\bar" }, + { "/test///dir", "../../././foo/bar", "\\foo\\bar" }, + { "/test///dir", "../../././/foo///bar", "\\foo\\bar" }, + { "/etc", "///triple/slash", "\\triple\\slash" }, + { "/etc", "//double/slash", "//double/slash" }, + { "///triple/slash", ".", "\\triple\\slash" }, + { "//double/slash", ".", "//double/slash\\" }, + { "/cwd/../with/./complexities/", "./hello", "\\with\\complexities\\hello" }, + { "\\etc", "..\\usr\\share", "\\usr\\share" }, { "\\", "\\foo\\bar", "\\foo\\bar" }, { "\\usr\\bin", "..\\..\\foo\\bar", "\\foo\\bar" }, @@ -870,8 +886,8 @@ test_paths (void) { "\\etc", "\\\\\\triple\\slash", "\\triple\\slash" }, { "\\etc", "\\\\double\\slash", "\\\\double\\slash" }, { "\\\\\\triple\\slash", ".", "\\triple\\slash" }, - { "\\\\double\\slash", ".", "\\\\double\\slash" }, - { "\\cwd\\..\\with\\.\\complexities\\", ".\\hello", "\\cwd\\with\\complexities\\hello" }, + { "\\\\double\\slash", ".", "\\\\double\\slash\\" }, + { "\\cwd\\..\\with\\.\\complexities\\", ".\\hello", "\\with\\complexities\\hello" }, #endif }; const guint n_canonicalize_filename_checks = G_N_ELEMENTS (canonicalize_filename_checks); |