@matheusbsbs / matheus-bagliano / commits / f9fd5210c8
Fork 0

Add tests for `branch --[no-]merged`

Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Lars Hjemli committed Apr 18, 2008 at 18:30 UTC f9fd5210c825dfcd245a2cd38e7b12c03000c33f
1 file changed +41 -1
t/t3201-branch-contains.sh
+41 -1
@@ -1,6 +1,6 @@
1 #!/bin/sh
2
3 -test_description='branch --contains <commit>'
3 +test_description='branch --contains <commit>, --merged, and --no-merged'
4
5 . ./test-lib.sh
6
@@ -55,4 +55,44 @@ test_expect_success 'branch --contains=side' '
55
56 '
57
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 +
98 test_done