mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 06:56:14 +01:00
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.
This commit is contained in:
parent
3ffa7ed0b6
commit
1e74b5872e
@ -843,6 +843,7 @@ test_paths (void)
|
|||||||
gchar *relative_path;
|
gchar *relative_path;
|
||||||
gchar *canonical_path;
|
gchar *canonical_path;
|
||||||
} canonicalize_filename_checks[] = {
|
} canonicalize_filename_checks[] = {
|
||||||
|
#ifndef G_OS_WIN32
|
||||||
{ "/etc", "../usr/share", "/usr/share" },
|
{ "/etc", "../usr/share", "/usr/share" },
|
||||||
{ "/", "/foo/bar", "/foo/bar" },
|
{ "/", "/foo/bar", "/foo/bar" },
|
||||||
{ "/usr/bin", "../../foo/bar", "/foo/bar" },
|
{ "/usr/bin", "../../foo/bar", "/foo/bar" },
|
||||||
@ -857,7 +858,22 @@ test_paths (void)
|
|||||||
{ "///triple/slash", ".", "/triple/slash" },
|
{ "///triple/slash", ".", "/triple/slash" },
|
||||||
{ "//double/slash", ".", "//double/slash" },
|
{ "//double/slash", ".", "//double/slash" },
|
||||||
{ "/cwd/../with/./complexities/", "./hello", "/with/complexities/hello" },
|
{ "/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" },
|
{ "\\etc", "..\\usr\\share", "\\usr\\share" },
|
||||||
{ "\\", "\\foo\\bar", "\\foo\\bar" },
|
{ "\\", "\\foo\\bar", "\\foo\\bar" },
|
||||||
{ "\\usr\\bin", "..\\..\\foo\\bar", "\\foo\\bar" },
|
{ "\\usr\\bin", "..\\..\\foo\\bar", "\\foo\\bar" },
|
||||||
@ -870,8 +886,8 @@ test_paths (void)
|
|||||||
{ "\\etc", "\\\\\\triple\\slash", "\\triple\\slash" },
|
{ "\\etc", "\\\\\\triple\\slash", "\\triple\\slash" },
|
||||||
{ "\\etc", "\\\\double\\slash", "\\\\double\\slash" },
|
{ "\\etc", "\\\\double\\slash", "\\\\double\\slash" },
|
||||||
{ "\\\\\\triple\\slash", ".", "\\triple\\slash" },
|
{ "\\\\\\triple\\slash", ".", "\\triple\\slash" },
|
||||||
{ "\\\\double\\slash", ".", "\\\\double\\slash" },
|
{ "\\\\double\\slash", ".", "\\\\double\\slash\\" },
|
||||||
{ "\\cwd\\..\\with\\.\\complexities\\", ".\\hello", "\\cwd\\with\\complexities\\hello" },
|
{ "\\cwd\\..\\with\\.\\complexities\\", ".\\hello", "\\with\\complexities\\hello" },
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
const guint n_canonicalize_filename_checks = G_N_ELEMENTS (canonicalize_filename_checks);
|
const guint n_canonicalize_filename_checks = G_N_ELEMENTS (canonicalize_filename_checks);
|
||||||
|
Loading…
Reference in New Issue
Block a user