[PATCH] test: canonicalize content-type in "Sending a message via (fake) SMTP"

2012-08-31 Thread Tomi Ollila
On Fri, Aug 31 2012, david at tethera.net wrote:

> From: David Bremner 
>
> The version of message.el in emacs24 omits the charset=us-ascii,
> causing the current version of this test to fail. With this patch, we
> accept either option.  According to RFC 2046, they are semantically
> equivalent.
> ---

LGTM.

Tomi


[PATCH] test: canonicalize content-type in "Sending a message via (fake) SMTP"

2012-08-31 Thread David Bremner
david at tethera.net writes:

> From: David Bremner 
>
> The version of message.el in emacs24 omits the charset=us-ascii,
> causing the current version of this test to fail. With this patch, we
> accept either option.  According to RFC 2046, they are semantically
> equivalent.

Pushed the second one.

d


[PATCH] test: canonicalize content-type in "Sending a message via (fake) SMTP"

2012-08-31 Thread Austin Clements
LGTM.

Quoth david at tethera.net on Aug 30 at  8:24 pm:
> From: David Bremner 
> 
> The version of message.el in emacs24 omits the charset=us-ascii,
> causing the current version of this test to fail. With this patch, we
> accept either option.  According to RFC 2046, they are semantically
> equivalent.
> ---
> 
> as discussed on IRC, the $ is not quite as nice as \b, but it is
> POSIX.2, at least according to "man 7 regex"
> 
>  test/emacs |5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/test/emacs b/test/emacs
> index afe35ba..5d118b6 100755
> --- a/test/emacs
> +++ b/test/emacs
> @@ -169,7 +169,8 @@ emacs_deliver_message \
>   (insert "To: user at example.com\n")'
>  sed \
>  -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX 
> Emacs/XXX,' \
> --e s',^Message-ID: <.*>$,Message-ID: ,' < sent_message >OUTPUT
> +-e s',^Message-ID: <.*>$,Message-ID: ,' \
> +-e s',^\(Content-Type: text/plain\); charset=us-ascii$,\1,' < 
> sent_message >OUTPUT
>  cat   From: Notmuch Test Suite 
>  To: user at example.com
> @@ -178,7 +179,7 @@ Date: 01 Jan 2000 12:00:00 -
>  User-Agent: Notmuch/XXX Emacs/XXX
>  Message-ID: 
>  MIME-Version: 1.0
> -Content-Type: text/plain; charset=us-ascii
> +Content-Type: text/plain
>  
>  This is a test that messages are sent via SMTP
>  EOF


[PATCH] test: canonicalize content-type in "Sending a message via (fake) SMTP"

2012-08-30 Thread da...@tethera.net
From: David Bremner 

The version of message.el in emacs24 omits the charset=us-ascii,
causing the current version of this test to fail. With this patch, we
accept either option.  According to RFC 2046, they are semantically
equivalent.
---

as discussed on IRC, the $ is not quite as nice as \b, but it is
POSIX.2, at least according to "man 7 regex"

 test/emacs |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/test/emacs b/test/emacs
index afe35ba..5d118b6 100755
--- a/test/emacs
+++ b/test/emacs
@@ -169,7 +169,8 @@ emacs_deliver_message \
  (insert "To: user at example.com\n")'
 sed \
 -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' 
\
--e s',^Message-ID: <.*>$,Message-ID: ,' < sent_message >OUTPUT
+-e s',^Message-ID: <.*>$,Message-ID: ,' \
+-e s',^\(Content-Type: text/plain\); charset=us-ascii$,\1,' < sent_message 
>OUTPUT
 cat 

[PATCH] test: canonicalize content-type in Sending a message via (fake) SMTP

2012-08-30 Thread david
From: David Bremner brem...@debian.org

The version of message.el in emacs24 omits the charset=us-ascii,
causing the current version of this test to fail. With this patch, we
accept either option.  According to RFC 2046, they are semantically
equivalent.
---

as discussed on IRC, the $ is not quite as nice as \b, but it is
POSIX.2, at least according to man 7 regex

 test/emacs |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/test/emacs b/test/emacs
index afe35ba..5d118b6 100755
--- a/test/emacs
+++ b/test/emacs
@@ -169,7 +169,8 @@ emacs_deliver_message \
  (insert To: u...@example.com\n)'
 sed \
 -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' 
\
--e s',^Message-ID: .*$,Message-ID: XXX,'  sent_message OUTPUT
+-e s',^Message-ID: .*$,Message-ID: XXX,' \
+-e s',^\(Content-Type: text/plain\); charset=us-ascii$,\1,'  sent_message 
OUTPUT
 cat EOF EXPECTED
 From: Notmuch Test Suite test_su...@notmuchmail.org
 To: u...@example.com
@@ -178,7 +179,7 @@ Date: 01 Jan 2000 12:00:00 -
 User-Agent: Notmuch/XXX Emacs/XXX
 Message-ID: XXX
 MIME-Version: 1.0
-Content-Type: text/plain; charset=us-ascii
+Content-Type: text/plain
 
 This is a test that messages are sent via SMTP
 EOF
-- 
1.7.10.4

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] test: canonicalize content-type in "Sending a message via (fake) SMTP"

2012-08-29 Thread da...@tethera.net
From: David Bremner 

The version of message.el in emacs24 omits the charset=us-ascii,
causing the current version of this test to fail. Here we just ask
that the content-type start with "text/plain"
---

Alternatively, somebody might want to dig into message.el and
understand why it behaves differently in emacs24. I could not
replicate the omission of charset=us-ascii sending a message
interactively.

 test/emacs |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/test/emacs b/test/emacs
index afe35ba..6fab4db 100755
--- a/test/emacs
+++ b/test/emacs
@@ -169,7 +169,8 @@ emacs_deliver_message \
  (insert "To: user at example.com\n")'
 sed \
 -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' 
\
--e s',^Message-ID: <.*>$,Message-ID: ,' < sent_message >OUTPUT
+-e s',^Message-ID: <.*>$,Message-ID: ,' \
+-e s',^Content-Type: text/plain.*$,Content-Type: XXX,' < sent_message 
>OUTPUT
 cat 

[PATCH] test: canonicalize content-type in "Sending a message via (fake) SMTP"

2012-08-29 Thread Austin Clements
Quoth david at tethera.net on Aug 29 at 10:12 pm:
> From: David Bremner 
> 
> The version of message.el in emacs24 omits the charset=us-ascii,
> causing the current version of this test to fail. Here we just ask
> that the content-type start with "text/plain"
> ---
> 
> Alternatively, somebody might want to dig into message.el and
> understand why it behaves differently in emacs24. I could not
> replicate the omission of charset=us-ascii sending a message
> interactively.
> 
>  test/emacs |5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/test/emacs b/test/emacs
> index afe35ba..6fab4db 100755
> --- a/test/emacs
> +++ b/test/emacs
> @@ -169,7 +169,8 @@ emacs_deliver_message \
>   (insert "To: user at example.com\n")'
>  sed \
>  -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX 
> Emacs/XXX,' \
> --e s',^Message-ID: <.*>$,Message-ID: ,' < sent_message >OUTPUT
> +-e s',^Message-ID: <.*>$,Message-ID: ,' \
> +-e s',^Content-Type: text/plain.*$,Content-Type: XXX,' < sent_message 
> >OUTPUT

Maybe something more exact?  Since us-ascii is the default charset and
equivalent to not specifying a charset (which is presumably related to
the change in Emacs 24), how about
  s',^\(Content-Type: text/plain\); charset=us-ascii\b,\1,'
?  That would canonicalize away only the default-valued part.

>  cat   From: Notmuch Test Suite 
>  To: user at example.com
> @@ -178,7 +179,7 @@ Date: 01 Jan 2000 12:00:00 -
>  User-Agent: Notmuch/XXX Emacs/XXX
>  Message-ID: 
>  MIME-Version: 1.0
> -Content-Type: text/plain; charset=us-ascii
> +Content-Type: XXX
>  
>  This is a test that messages are sent via SMTP
>  EOF


[PATCH] test: canonicalize content-type in Sending a message via (fake) SMTP

2012-08-29 Thread david
From: David Bremner brem...@debian.org

The version of message.el in emacs24 omits the charset=us-ascii,
causing the current version of this test to fail. Here we just ask
that the content-type start with text/plain
---

Alternatively, somebody might want to dig into message.el and
understand why it behaves differently in emacs24. I could not
replicate the omission of charset=us-ascii sending a message
interactively.

 test/emacs |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/test/emacs b/test/emacs
index afe35ba..6fab4db 100755
--- a/test/emacs
+++ b/test/emacs
@@ -169,7 +169,8 @@ emacs_deliver_message \
  (insert To: u...@example.com\n)'
 sed \
 -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' 
\
--e s',^Message-ID: .*$,Message-ID: XXX,'  sent_message OUTPUT
+-e s',^Message-ID: .*$,Message-ID: XXX,' \
+-e s',^Content-Type: text/plain.*$,Content-Type: XXX,'  sent_message 
OUTPUT
 cat EOF EXPECTED
 From: Notmuch Test Suite test_su...@notmuchmail.org
 To: u...@example.com
@@ -178,7 +179,7 @@ Date: 01 Jan 2000 12:00:00 -
 User-Agent: Notmuch/XXX Emacs/XXX
 Message-ID: XXX
 MIME-Version: 1.0
-Content-Type: text/plain; charset=us-ascii
+Content-Type: XXX
 
 This is a test that messages are sent via SMTP
 EOF
-- 
1.7.10.4

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] test: canonicalize content-type in Sending a message via (fake) SMTP

2012-08-29 Thread Austin Clements
Quoth da...@tethera.net on Aug 29 at 10:12 pm:
 From: David Bremner brem...@debian.org
 
 The version of message.el in emacs24 omits the charset=us-ascii,
 causing the current version of this test to fail. Here we just ask
 that the content-type start with text/plain
 ---
 
 Alternatively, somebody might want to dig into message.el and
 understand why it behaves differently in emacs24. I could not
 replicate the omission of charset=us-ascii sending a message
 interactively.
 
  test/emacs |5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
 
 diff --git a/test/emacs b/test/emacs
 index afe35ba..6fab4db 100755
 --- a/test/emacs
 +++ b/test/emacs
 @@ -169,7 +169,8 @@ emacs_deliver_message \
   (insert To: u...@example.com\n)'
  sed \
  -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX 
 Emacs/XXX,' \
 --e s',^Message-ID: .*$,Message-ID: XXX,'  sent_message OUTPUT
 +-e s',^Message-ID: .*$,Message-ID: XXX,' \
 +-e s',^Content-Type: text/plain.*$,Content-Type: XXX,'  sent_message 
 OUTPUT

Maybe something more exact?  Since us-ascii is the default charset and
equivalent to not specifying a charset (which is presumably related to
the change in Emacs 24), how about
  s',^\(Content-Type: text/plain\); charset=us-ascii\b,\1,'
?  That would canonicalize away only the default-valued part.

  cat EOF EXPECTED
  From: Notmuch Test Suite test_su...@notmuchmail.org
  To: u...@example.com
 @@ -178,7 +179,7 @@ Date: 01 Jan 2000 12:00:00 -
  User-Agent: Notmuch/XXX Emacs/XXX
  Message-ID: XXX
  MIME-Version: 1.0
 -Content-Type: text/plain; charset=us-ascii
 +Content-Type: XXX
  
  This is a test that messages are sent via SMTP
  EOF
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch