Skip to content

Commit 3f9c637

Browse files
phillipwoodgitster
authored andcommitted
t9700: add tests for Git::unquote_path()
Check that unquote_path() handles spaces and escape sequences properly. Signed-off-by: Phillip Wood <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d5f28b7 commit 3f9c637

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

t/t9700/test.pl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@ sub adjust_dirsep {
133133
unlink $tmpfile3;
134134
chdir($abs_repo_dir);
135135

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+
136143
printf "1..%d\n", Test::More->builder->current_test;
137144

138145
my $is_passing = eval { Test::More->is_passing };

0 commit comments

Comments
 (0)