t9700: add tests for Git::unquote_path()

Check that unquote_path() handles spaces and escape sequences properly. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Phillip Wood committed Jun 30, 2017 at 10:49 UTC 3f9c637ec7c28dc9de5937b45334ee11875e9fe8
1 file changed +7
t/t9700/test.pl
+7
@@ -133,6 +133,13 @@ close TEMPFILE3;
133 unlink $tmpfile3;
134 chdir($abs_repo_dir);
135
136 +# unquoting paths
137 +is(Git::unquote_path('abc'), 'abc', 'unquote unquoted path');
138 +is(Git::unquote_path('"abc def"'), 'abc def', 'unquote simple quoted path');
139 +is(Git::unquote_path('"abc\"\\\\ \a\b\t\n\v\f\r\001\040"'),
140 + "abc\"\\ \x07\x08\x09\x0a\x0b\x0c\x0d\x01 ",
141 + 'unquote escape sequences');
142 +
143 printf "1..%d\n", Test::More->builder->current_test;
144
145 my $is_passing = eval { Test::More->is_passing };