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>
This commit is contained in:
Phillip Wood 2017-06-30 10:49:12 +01:00 committed by Junio C Hamano
parent d5f28b7241
commit 3f9c637ec7

View File

@ -133,6 +133,13 @@ close TEMPFILE3;
unlink $tmpfile3;
chdir($abs_repo_dir);
# unquoting paths
is(Git::unquote_path('abc'), 'abc', 'unquote unquoted path');
is(Git::unquote_path('"abc def"'), 'abc def', 'unquote simple quoted path');
is(Git::unquote_path('"abc\"\\\\ \a\b\t\n\v\f\r\001\040"'),
"abc\"\\ \x07\x08\x09\x0a\x0b\x0c\x0d\x01 ",
'unquote escape sequences');
printf "1..%d\n", Test::More->builder->current_test;
my $is_passing = eval { Test::More->is_passing };