Skip to content

Commit cb9c9df

Browse files
jnarebgitster
authored andcommitted
Add simple test for Git::config_path() in t/t9700-perl-git.sh
Tests "~/foo" path expansion and multiple values. Signed-off-by: Jakub Narebski <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6942a3d commit cb9c9df

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

t/t9700-perl-git.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ test_expect_success \
4343
git config --add test.booltrue true &&
4444
git config --add test.boolfalse no &&
4545
git config --add test.boolother other &&
46-
git config --add test.int 2k
46+
git config --add test.int 2k &&
47+
git config --add test.path "~/foo" &&
48+
git config --add test.pathexpanded "$HOME/foo" &&
49+
git config --add test.pathmulti foo &&
50+
git config --add test.pathmulti bar
4751
'
4852

4953
# The external test will outputs its own plan

t/t9700/test.pl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ BEGIN
3333
is($r->config_int("test.nonexistent"), undef, "config_int: nonexistent");
3434
ok($r->config_bool("test.booltrue"), "config_bool: true");
3535
ok(!$r->config_bool("test.boolfalse"), "config_bool: false");
36+
is($r->config_path("test.path"), $r->config("test.pathexpanded"),
37+
"config_path: ~/foo expansion");
38+
is_deeply([$r->config_path("test.pathmulti")], ["foo", "bar"],
39+
"config_path: multiple values");
3640
our $ansi_green = "\x1b[32m";
3741
is($r->get_color("color.test.slot1", "red"), $ansi_green, "get_color");
3842
# Cannot test $r->get_colorbool("color.foo")) because we do not

0 commit comments

Comments
 (0)