summaryrefslogtreecommitdiff
path: root/tests/path
diff options
context:
space:
mode:
authorGabriel DeBacker <gabrield@microsoft.com>2018-09-30 16:40:22 -0700
committerGabriel DeBacker <gabrield@microsoft.com>2018-09-30 16:40:22 -0700
commit8ab11dd53da0bba5152f1d755d92b9c436c71ff0 (patch)
tree2b6ec3ff3f544a29c44dcd7d383e54dee0353058 /tests/path
parent1621a37dd124c6d060b2197eed01155538b0a118 (diff)
downloadlibgit2-8ab11dd53da0bba5152f1d755d92b9c436c71ff0.tar.gz
Fix issue with path canonicalization for Win32 paths
Diffstat (limited to 'tests/path')
-rw-r--r--tests/path/win32.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/path/win32.c b/tests/path/win32.c
index 4ff039738..6065002af 100644
--- a/tests/path/win32.c
+++ b/tests/path/win32.c
@@ -145,6 +145,22 @@ void test_canonicalize(const wchar_t *in, const wchar_t *expected)
#endif
}
+void test_path_git_win32__canonicalize_path(const wchar_t *in, const wchar_t *expected)
+{
+#ifdef GIT_WIN32
+ git_win32_path canonical;
+
+ cl_assert(wcslen(in) < MAX_PATH);
+ wcscpy(canonical, in);
+
+ cl_must_pass(git_win32__canonicalize_path(canonical, wcslen(in)));
+ cl_assert_equal_wcs(expected, canonical);
+#else
+ GIT_UNUSED(in);
+ GIT_UNUSED(expected);
+#endif
+}
+
void test_path_win32__canonicalize(void)
{
#ifdef GIT_WIN32
@@ -186,6 +202,8 @@ void test_path_win32__canonicalize(void)
test_canonicalize(L"\\\\server\\\\share\\\\foo\\\\bar", L"\\\\server\\share\\foo\\bar");
test_canonicalize(L"\\\\server\\share\\..\\foo", L"\\\\server\\foo");
test_canonicalize(L"\\\\server\\..\\..\\share\\.\\foo", L"\\\\server\\share\\foo");
+
+ test_path_git_win32__canonicalize_path(L"\\\\?\\UNC\\server\\C$\\folder", L"\\\\server\\C$\\folder");
#endif
}