Fix test/tests/send/test-mimeify
[mmh] / test / tests / send / test-mimeify
index 3de45d7..f5a18aa 100644 (file)
@@ -21,7 +21,7 @@ Subject: Test MIME
 foo
 !
 
-runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
+runandcheck 'send -debug "$draft" | replace_contentid' <<!
 From: Bob <bob@example.org>
 To: alice
 Date: Sun, 25 Oct 2015 18:59:56 +0100
@@ -70,7 +70,7 @@ Date: Fri, 05 Aug 2016 21:38:40 +0200
 --------
 foo
 !
-runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
+runandcheck 'send -debug "$draft" | replace_contentid' <<!
 To: meillo
 Subject: mime test 1
 Date: Fri, 05 Aug 2016 21:38:40 +0200
@@ -93,7 +93,7 @@ Date: Fri, 05 Aug 2016 21:38:56 +0200
 foo
 füße
 !
-runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
+runandcheck 'send -debug "$draft" | replace_contentid' <<!
 To: meillo
 Subject: mime test 2
 Date: Fri, 05 Aug 2016 21:38:56 +0200
@@ -119,7 +119,7 @@ Date: Fri, 05 Aug 2016 21:42:16 +0200
 --------
 foo
 !
-runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
+runandcheck 'send -debug "$draft" | replace_contentid' <<!
 To: meillo
 Subject: mime test 3
 MIME-Version: 1.0
@@ -201,9 +201,13 @@ end
 !
 runandcheck 'mhbuild "$draft"' <<!
 !
+
+# Use static Content-ID headers values for reproducible results
+replace_contentid "$draft" >"$draft.temp" && mv "$draft.temp" "$draft"
+
 runandcheck 'mhlist -v -file "$draft"' <<!
  msg part  type/subtype              size description                         
-   0       multipart/mixed           2623
+   0       multipart/mixed           2343
                boundary="----- =_aaaaaaaaaa0"
      1     text/plain                   4
                charset="us-ascii"
@@ -213,7 +217,7 @@ runandcheck 'mhlist -v -file "$draft"' <<!
                charset="us-ascii"
      4     text/plain                   6
                charset="UTF-8"
-     5     multipart/alternative     1663 Picture of an Amphioctopus marginatu
+     5     multipart/alternative     1593 Picture of an Amphioctopus marginatu
                boundary="----- =_aaaaaaaaaa1"
      5.1   text/plain                  87
                charset="us-ascii"
@@ -221,7 +225,7 @@ runandcheck 'mhlist -v -file "$draft"' <<!
      6     text/plain                   4
                charset="us-ascii"
 !
-runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
+runandcheck 'send -debug "$draft"' <<!
 To: meillo
 Subject: mime test 6
 Date: Fri, 05 Aug 2016 21:46:20 +0200