git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/1] Add tests for `branch --[no-]merged`

From
LHLars Hjemli <hjemli@gmail.com>
Date
Apr 18, 2008, 16:30 UTC
Message-ID
<1208536215-11921-1-git-send-email-hjemli@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
---

A bit late, but here's a testscript for the new options (shamelessly based on t3201).

 t/t3202-branch-merged.sh |   68 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 68 insertions(+), 0 deletions(-)
 create mode 100755 t/t3202-branch-merged.sh
diff --git a/t/t3202-branch-merged.sh b/t/t3202-branch-merged.sh
new file mode 100755
index 0000000..2710923
--- /dev/null
+++ b/t/t3202-branch-merged.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+test_description='branch --merged/--no-merged'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+
+	>file &&
+	git add file &&
+	test_tick &&
+	git commit -m initial &&
+	git branch side &&
+
+	echo 1 >file &&
+	test_tick &&
+	git commit -a -m "second on master" &&
+
+	git checkout side &&
+	echo 1 >file &&
+	test_tick &&
+	git commit -a -m "second on side" &&
+
+	git merge master
+
+'
+
+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
-- 
1.5.5.74.g74a72
Message 1 of 1 in “Add tests for `branch --[no-]merged`”
  1. 3/1 Add tests for `branch --[no-]merged`Lars Hjemli, Apr 18, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.