Skip to content

Commit f9fd521

Browse files
hjemligitster
authored andcommitted
Add tests for branch --[no-]merged
Signed-off-by: Lars Hjemli <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9a7ea2b commit f9fd521

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

t/t3201-branch-contains.sh

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
test_description='branch --contains <commit>'
3+
test_description='branch --contains <commit>, --merged, and --no-merged'
44

55
. ./test-lib.sh
66

@@ -55,4 +55,44 @@ test_expect_success 'branch --contains=side' '
5555
5656
'
5757

58+
test_expect_success 'side: branch --merged' '
59+
60+
git branch --merged >actual &&
61+
{
62+
echo " master" &&
63+
echo "* side"
64+
} >expect &&
65+
test_cmp expect actual
66+
67+
'
68+
69+
test_expect_success 'side: branch --no-merged' '
70+
71+
git branch --no-merged >actual &&
72+
>expect &&
73+
test_cmp expect actual
74+
75+
'
76+
77+
test_expect_success 'master: branch --merged' '
78+
79+
git checkout master &&
80+
git branch --merged >actual &&
81+
{
82+
echo "* master"
83+
} >expect &&
84+
test_cmp expect actual
85+
86+
'
87+
88+
test_expect_success 'master: branch --no-merged' '
89+
90+
git branch --no-merged >actual &&
91+
{
92+
echo " side"
93+
} >expect &&
94+
test_cmp expect actual
95+
96+
'
97+
5898
test_done

0 commit comments

Comments
 (0)