Skip to content

Commit

Permalink
Add simple test for Git::config_path() in t/t9700-perl-git.sh
Browse files Browse the repository at this point in the history
Tests "~/foo" path expansion and multiple values.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jakub Narebski authored and Junio C Hamano committed Oct 21, 2011
1 parent 6942a3d commit cb9c9df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion t/t9700-perl-git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ test_expect_success \
git config --add test.booltrue true &&
git config --add test.boolfalse no &&
git config --add test.boolother other &&
git config --add test.int 2k
git config --add test.int 2k &&
git config --add test.path "~/foo" &&
git config --add test.pathexpanded "$HOME/foo" &&
git config --add test.pathmulti foo &&
git config --add test.pathmulti bar
'

# The external test will outputs its own plan
Expand Down
4 changes: 4 additions & 0 deletions t/t9700/test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ 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"), $r->config("test.pathexpanded"),
"config_path: ~/foo expansion");
is_deeply([$r->config_path("test.pathmulti")], ["foo", "bar"],
"config_path: multiple values");
our $ansi_green = "\x1b[32m";
is($r->get_color("color.test.slot1", "red"), $ansi_green, "get_color");
# Cannot test $r->get_colorbool("color.foo")) because we do not
Expand Down

0 comments on commit cb9c9df

Please sign in to comment.