3 test_description
='Test git stash show configuration.'
7 test_expect_success
'setup' '
11 # takes three parameters:
12 # 1. the stash.showStat value (or "<unset>")
13 # 2. the stash.showPatch value (or "<unset>")
14 # 3. the diff options of the expected output (or nothing for no output)
15 test_stat_and_patch
() {
16 if test "<unset>" = "$1"
18 test_unconfig stash.showStat
20 test_config stash.showStat
"$1"
23 if test "<unset>" = "$2"
25 test_unconfig stash.showPatch
27 test_config stash.showPatch
"$2"
37 git stash show
>actual
&&
41 test_must_be_empty actual
43 test_cmp expect actual
47 test_expect_success
'showStat unset showPatch unset' '
48 test_stat_and_patch "<unset>" "<unset>" --stat
51 test_expect_success
'showStat unset showPatch false' '
52 test_stat_and_patch "<unset>" false --stat
55 test_expect_success
'showStat unset showPatch true' '
56 test_stat_and_patch "<unset>" true --stat -p
59 test_expect_success
'showStat false showPatch unset' '
60 test_stat_and_patch false "<unset>"
63 test_expect_success
'showStat false showPatch false' '
64 test_stat_and_patch false false
67 test_expect_success
'showStat false showPatch true' '
68 test_stat_and_patch false true -p
71 test_expect_success
'showStat true showPatch unset' '
72 test_stat_and_patch true "<unset>" --stat
75 test_expect_success
'showStat true showPatch false' '
76 test_stat_and_patch true false --stat
79 test_expect_success
'showStat true showPatch true' '
80 test_stat_and_patch true true --stat -p