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

[PATCH next v3] git-notes: add test case for multi-line notes

From
Tor Arne Vestbø <torarnv@gmail.com>
Date
Jan 14, 2009, 20:57 UTC
Message-ID
<496E51A3.8050908@gmail.com>
In-Reply-To
<496E1D77.6000307@viscovery.net>

The tests adds a third commit with a multi-line note. The output of git log -2 is then checked to see if the note lines are wrapped correctly, and that there's a line separator between the two commits.

Signed-off-by: Tor Arne Vestbø <tavestbo@trolltech.com>
---
 t/t3301-notes.sh |   32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index ba42c45..9393a25 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -59,7 +59,37 @@ EOF
 test_expect_success 'show notes' '
 	! (git cat-file commit HEAD | grep b1) &&
 	git log -1 > output &&
-	git diff expect output
+	test_cmp expect output
+'
+test_expect_success 'create multi-line notes (setup)' '
+	: > a3 &&
+	git add a3 &&
+	test_tick &&
+	git commit -m 3rd &&
+	MSG="b3
+c3c3c3c3
+d3d3d3" git notes edit
+'
+
+cat > expect-multiline << EOF
+commit 1584215f1d29c65e99c6c6848626553fdd07fd75
+Author: A U Thor <author@example.com>
+Date:   Thu Apr 7 15:15:13 2005 -0700
+
+    3rd
+
+Notes:
+    b3
+    c3c3c3c3
+    d3d3d3
+EOF
+
+printf "\n" >> expect-multiline
+cat expect >> expect-multiline
+
+test_expect_success 'show multi-line notes' '
+	git log -2 > output &&
+	test_cmp expect-multiline output
 '
 
 test_done
-- 
1.6.0.2.GIT
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 14 of 17 in “git-notes: fix printing of multi-line notes”
  1. git-notes: fix printing of multi-line notesTor Arne Vestbø, Jan 13, 2009
  2. Johannes SchindelinJan 13, 2009
  3. Junio C HamanoJan 14, 2009
  4. Johannes SchindelinJan 14, 2009
  5. git-notes: add test case for multi-line notesTor Arne Vestbø, Jan 14, 2009
  6. Johannes SchindelinJan 14, 2009
  7. git-notes: add test case for multi-line notesTor Arne Vestbø, Jan 14, 2009
  8. Jeff KingJan 14, 2009
  9. Boyd Stephen Smith Jr.Jan 14, 2009
  10. Jeff KingJan 14, 2009
  11. Johannes SixtJan 14, 2009
  12. Jeff KingJan 14, 2009
  13. Johannes SchindelinJan 14, 2009
  14. git-notes: add test case for multi-line notesTor Arne Vestbø, Jan 14, 2009
  15. Johannes SchindelinJan 14, 2009
  16. git-notes: fix printing of multi-line notesTor Arne Vestbø, Jan 16, 2009
  17. Junio C HamanoJan 18, 2009

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.