Have only a single command in each test_expect_failure
[stgit/ydirson.git] / t / t1900-mail.sh
blob78050dbcbc8605017de4b1df813a86c2af3605fd
1 #!/bin/sh
2 # Copyright (c) 2006 Karl Hasselström
3 test_description='Test the mail command'
4 . ./test-lib.sh
6 test_expect_success \
7 'Initialize the StGIT repository' \
9 git repo-config stgit.sender "A U Thor <author@example.com>" &&
10 for i in 1 2 3 4 5; do
11 touch foo.txt &&
12 echo "line $i" >> foo.txt &&
13 git add foo.txt &&
14 git commit -a -m "Patch $i"
15 done &&
16 stg init &&
17 stg uncommit -n 5 foo
20 test_expect_success \
21 'Put all the patches in an mbox' \
22 'stg mail --to="Inge Ström <inge@example.com>" -a -m \
23 -t ../../templates/patchmail.tmpl > mbox0'
25 test_expect_success \
26 'Import the mbox and compare' \
28 t1=$(git cat-file -p $(stg id) | grep ^tree)
29 stg pop -a &&
30 stg import -M mbox0 &&
31 t2=$(git cat-file -p $(stg id) | grep ^tree) &&
32 [ "$t1" = "$t2" ]
35 test_done