X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=t%2Ft9001-send-email.sh;h=e9ea33c18d8e0ffa2612e52748bbab4bf13ef513;hb=24cf6e5847073d50390e0b7950e8e6b5a09103bc;hp=276cbac3ba0a863ff0292d19c75e2ff8f844c740;hpb=ce903018f1ed0283fdaa3de1ec3ad29fccf25c96;p=git.git diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 276cbac3b..e9ea33c18 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -13,22 +13,32 @@ test_expect_success \ test_expect_success \ 'Setup helper tool' \ - 'echo "#!/bin/sh" > fake.sendmail - echo "shift" >> fake.sendmail - echo "echo \"\$*\" > commandline" >> fake.sendmail - echo "cat > msgtxt" >> fake.sendmail + '(echo "#!/bin/sh" + echo shift + echo for a + echo do + echo " echo \"!\$a!\"" + echo "done >commandline" + echo "cat > msgtxt" + ) >fake.sendmail chmod +x ./fake.sendmail git add fake.sendmail GIT_AUTHOR_NAME="A" git commit -a -m "Second."' -test_expect_success \ - 'Extract patches and send' \ - 'git format-patch -n HEAD^1 - git send-email -from="Example " --to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" ./0001*txt' +test_expect_success 'Extract patches' ' + patches=`git format-patch -n HEAD^1` +' + +test_expect_success 'Send patches' ' + git send-email -from="Example " --to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" $patches 2>errors +' +cat >expected <<\EOF +!nobody@example.com! +!author@example.com! +EOF test_expect_success \ 'Verify commandline' \ - 'cline=$(cat commandline) - [ "$cline" == "nobody@example.com author@example.com" ]' + 'diff commandline expected' test_done