summaryrefslogtreecommitdiff
path: root/t/t3201-branch-contains.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t3201-branch-contains.sh')
-rwxr-xr-xt/t3201-branch-contains.sh48
1 files changed, 44 insertions, 4 deletions
diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh
index 9ef593f0e1..f86f4bc5eb 100755
--- a/t/t3201-branch-contains.sh
+++ b/t/t3201-branch-contains.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-test_description='branch --contains <commit>'
+test_description='branch --contains <commit>, --merged, and --no-merged'
. ./test-lib.sh
@@ -31,7 +31,7 @@ test_expect_success 'branch --contains=master' '
{
echo " master" && echo "* side"
} >expect &&
- diff -u expect actual
+ test_cmp expect actual
'
@@ -41,7 +41,7 @@ test_expect_success 'branch --contains master' '
{
echo " master" && echo "* side"
} >expect &&
- diff -u expect actual
+ test_cmp expect actual
'
@@ -51,7 +51,47 @@ test_expect_success 'branch --contains=side' '
{
echo "* side"
} >expect &&
- diff -u expect actual
+ test_cmp expect actual
+
+'
+
+test_expect_success 'side: branch --merged' '
+
+ git branch --merged >actual &&
+ {
+ echo " master" &&
+ echo "* side"
+ } >expect &&
+ test_cmp expect actual
+
+'
+
+test_expect_success 'side: branch --no-merged' '
+
+ git branch --no-merged >actual &&
+ >expect &&
+ test_cmp expect actual
+
+'
+
+test_expect_success 'master: branch --merged' '
+
+ git checkout master &&
+ git branch --merged >actual &&
+ {
+ echo "* master"
+ } >expect &&
+ test_cmp expect actual
+
+'
+
+test_expect_success 'master: branch --no-merged' '
+
+ git branch --no-merged >actual &&
+ {
+ echo " side"
+ } >expect &&
+ test_cmp expect actual
'