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

[StGIT PATCH 2/2] Regression test for "stg mail"

From
Karl Hasselström <kha@treskal.com>
Date
Nov 12, 2006, 21:15 UTC
Message-ID
<20061112211556.19362.68287.stgit@localhost>
In-Reply-To
<20061112211434.19362.66077.stgit@localhost>
From: Karl Hasselström <kha@treskal.com>
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 t/t1900-mail.sh |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/t/t1900-mail.sh b/t/t1900-mail.sh
new file mode 100755
index 0000000..6a950b4
--- /dev/null
+++ b/t/t1900-mail.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+# Copyright (c) 2006 Karl Hasselström
+test_description='Test the mail command'
+. ./test-lib.sh
+
+test_expect_success \
+    'Initialize the StGIT repository' \
+    '
+    for i in 1 2 3 4 5; do
+      touch foo.txt &&
+      echo "line $i" >> foo.txt &&
+      git add foo.txt &&
+      git commit -a -m "Patch $i"
+    done &&
+    stg init &&
+    stg uncommit -n 5 foo
+    '
+
+test_expect_success \
+    'Put all the patches in an mbox' \
+    'stg mail --to="Inge Ström <inge@example.com>" -a -m \
+       -t ../../templates/patchmail.tmpl > mbox0'
+
+test_expect_success \
+    'Import the mbox and compare' \
+    '
+    t1=$(git cat-file -p $(stg id) | grep ^tree)
+    stg pop -a &&
+    stg import -M mbox0 &&
+    t2=$(git cat-file -p $(stg id) | grep ^tree) &&
+    [ "$t1" == "$t2" ]
+    '
+
Previous: Karl Hasselström
Message 4 of 4 in “Re: [PATCH] Add a MIME-Version header to e-mails”
  1. Catalin MarinasNov 8, 2006
  2. 0/2 mail and import testsKarl Hasselström, Nov 12, 2006
  3. 1/2 Regression test for "stg import"Karl Hasselström, Nov 12, 2006
  4. 2/2 Regression test for "stg mail"Karl Hasselström, Nov 12, 2006

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.