t1300: Add tests for git-config --bool --get
Noticed that there were only tests for --int, but not for --bool. Add some. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Frank Lichtenheld committed
May 21, 2007 at 00:12 UTC
cab333cb6ac0ac857dcfb112989ea32aea5d0ec1
1 file changed
+34
t/t1300-repo-config.sh
+34
@@ -436,6 +436,40 @@ test_expect_success numbers '
436
test z1048576 = "z$m"
437
'
438
439
+cat > expect << EOF
440
+true
441
+false
442
+true
443
+false
444
+true
445
+false
446
+true
447
+false
448
+EOF
449
+
450
+test_expect_success bool '
451
+
452
+ git-config bool.true1 01 &&
453
+ git-config bool.true2 -1 &&
454
+ git-config bool.true3 YeS &&
455
+ git-config bool.true4 true &&
456
+ git-config bool.false1 000 &&
457
+ git-config bool.false2 "" &&
458
+ git-config bool.false3 nO &&
459
+ git-config bool.false4 FALSE &&
460
+ rm -f result &&
461
+ for i in 1 2 3 4
462
+ do
463
+ git-config --bool --get bool.true$i >>result
464
+ git-config --bool --get bool.false$i >>result
465
+ done &&
466
+ cmp expect result'
467
+
468
+test_expect_failure 'invalid bool' '
469
+
470
+ git-config bool.nobool foobar &&
471
+ git-config --bool --get bool.nobool'
472
+
473
rm .git/config
474
475
git-config quote.leading " test"