summaryrefslogtreecommitdiff
path: root/tests-clar/core
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-05-07 13:58:01 +0200
committernulltoken <emeric.fermas@gmail.com>2012-05-08 10:05:18 +0200
commit9abb5bca5d094f832d2c68342aefc8809ec8ca09 (patch)
treec8efa3ba0f237ef631d402a740d1797a68fc1203 /tests-clar/core
parent46811561ae19701d4d0fc4b00113667f81961dfc (diff)
downloadlibgit2-9abb5bca5d094f832d2c68342aefc8809ec8ca09.tar.gz
compat: make p_realpath Windows implementation be a bit more POSIX compliant and fail if the provided path does not lead to an existing entry
Diffstat (limited to 'tests-clar/core')
-rw-r--r--tests-clar/core/path.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests-clar/core/path.c b/tests-clar/core/path.c
index f02e0f76..d826612a 100644
--- a/tests-clar/core/path.c
+++ b/tests-clar/core/path.c
@@ -405,3 +405,16 @@ void test_core_path__12_offset_to_path_root(void)
cl_assert(git_path_root("//computername") == -1);
#endif
}
+
+#define NON_EXISTING_FILEPATH "i_hope_i_do_not_exist"
+
+void test_core_path__13_cannot_prettify_a_non_existing_file(void)
+{
+ git_buf p = GIT_BUF_INIT;
+
+ cl_must_pass(git_path_exists(NON_EXISTING_FILEPATH) == false);
+ cl_assert_equal_i(GIT_ENOTFOUND, git_path_prettify(&p, NON_EXISTING_FILEPATH, NULL));
+ cl_assert_equal_i(GIT_ENOTFOUND, git_path_prettify(&p, NON_EXISTING_FILEPATH "/so-do-i", NULL));
+
+ git_buf_free(&p);
+}