From f9fd5210c825dfcd245a2cd38e7b12c03000c33f Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Fri, 18 Apr 2008 18:30:15 +0200 Subject: [PATCH] Add tests for `branch --[no-]merged` Signed-off-by: Lars Hjemli Signed-off-by: Junio C Hamano --- t/t3201-branch-contains.sh | 42 +++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh index b4cf628d22..f86f4bc5eb 100755 --- a/t/t3201-branch-contains.sh +++ b/t/t3201-branch-contains.sh @@ -1,6 +1,6 @@ #!/bin/sh -test_description='branch --contains ' +test_description='branch --contains , --merged, and --no-merged' . ./test-lib.sh @@ -55,4 +55,44 @@ test_expect_success 'branch --contains=side' ' ' +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 + +' + test_done