[PATCH 1 of 4] test-patchbomb.t: test use of sendmail program

Bryan O'Sullivan bos at serpentine.com
Tue Jan 5 05:56:07 UTC 2016


# HG changeset patch
# User Bryan O'Sullivan <bos at serpentine.com>
# Date 1451973286 28800
#      Mon Jan 04 21:54:46 2016 -0800
# Node ID 48f03f0d7b63e0506d2176a5906c0f12e1f7b223
# Parent  0486b6c4d3568ecb7d4e3f8190d200455fb53650
test-patchbomb.t: test use of sendmail program

diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t
--- a/tests/test-patchbomb.t
+++ b/tests/test-patchbomb.t
@@ -2721,6 +2721,18 @@ dest#branch URIs:
   +d
   
 
+Set up a fake sendmail program
+
+  $ cat > pretendmail.sh << 'EOF'
+  > #!/bin/sh
+  > echo "$@"
+  > cat
+  > EOF
+  $ chmod +x pretendmail.sh
+
+  $ echo '[email]' >> $HGRCPATH
+  $ echo "method=`pwd`/pretendmail.sh" >> $HGRCPATH
+
 Test introduction configuration
 =================================
 
@@ -2806,15 +2818,13 @@ bad value setting
 
 single rev
 
-  $ hg email --date '1980-1-1 0:1' -n -t foo -s test -r '10'
+  $ hg email  --date '1980-1-1 0:1' -v -t foo -s test -r '10'
   From [test]: test
   this patch series consists of 1 patches.
   
   warning: invalid patchbomb.intro value "mpmwearaclownnose"
   (should be one of always, never, auto)
-  Cc: 
-  
-  displaying [PATCH] test ...
+  -f test foo
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -2844,7 +2854,10 @@ single rev
   @@ -1,1 +1,2 @@
    d
   +d
-  
+  Cc: 
+  
+  sending [PATCH] test ...
+  sending mail: $TESTTMP/t2/pretendmail.sh -f test foo
 Test pull url header
 =================================
 


More information about the Mercurial-devel mailing list