status: update short status to respect --no-ahead-behind
[gitweb.git] / t / t9700 / test.pl
index 7e8c40b97b4eecc2347ab2986a97b62148fe5f88..34cd01366f92164ffcd712cb86dac4eb1cffa3f5 100755 (executable)
@@ -17,6 +17,12 @@ BEGIN
 use Cwd;
 use File::Basename;
 
+sub adjust_dirsep {
+       my $path = shift;
+       $path =~ s{\\}{/}g;
+       return $path;
+}
+
 BEGIN { use_ok('Git') }
 
 # set up
@@ -33,7 +39,7 @@ BEGIN
 is($r->config_int("test.nonexistent"), undef, "config_int: nonexistent");
 ok($r->config_bool("test.booltrue"), "config_bool: true");
 ok(!$r->config_bool("test.boolfalse"), "config_bool: false");
-is($r->config_path("test.path") =~ s/\\/\//gr, $r->config("test.pathexpanded"),
+is(adjust_dirsep($r->config_path("test.path")), $r->config("test.pathexpanded"),
    "config_path: ~/foo expansion");
 is_deeply([$r->config_path("test.pathmulti")], ["foo", "bar"],
    "config_path: multiple values");
@@ -127,6 +133,13 @@ BEGIN
 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 };