Re: [PATCH v2 3/3] test: conform to content length, encoding fields

Subject: Re: [PATCH v2 3/3] test: conform to content length, encoding fields

Date: Sun, 21 Oct 2012 14:03:11 +1100

To: notmuch@notmuchmail.org

Cc:

From: Peter Wang


On Fri, 19 Oct 2012 22:21:46 -0400, Ethan Glasser-Camp <ethan.glasser.camp@gmail.com> wrote:
> > diff --git a/test/json b/test/json
> > index ac8fa8e..8ce2e8a 100755
> > --- a/test/json
> > +++ b/test/json
> > @@ -45,7 +45,7 @@ emacs_deliver_message \
> >       (insert \"Message-ID: <$id>\n\")"
> >  output=$(notmuch show --format=json "id:$id")
> >  filename=$(notmuch search --output=files "id:$id")
> > -test_expect_equal_json "$output" "[[[{\"id\": \"$id\", \"match\": true, \"excluded\": false, \"filename\": \"$filename\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\"], \"headers\": {\"Subject\": \"$subject\", \"From\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"To\": \"test_suite@notmuchmail.org\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"multipart/mixed\", \"content\": [{\"id\": 2, \"content-type\": \"text/plain\", \"content\": \"This is a test message with inline attachment with a filename\"}, {\"id\": 3, \"content-type\": \"application/octet-stream\", \"filename\": \"README\"}]}]}, []]]]"
> > +test_expect_equal_json "$output" "[[[{\"id\": \"$id\", \"match\": true, \"excluded\": false, \"filename\": \"$filename\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\"], \"headers\": {\"Subject\": \"$subject\", \"From\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"To\": \"test_suite@notmuchmail.org\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"multipart/mixed\", \"content\": [{\"id\": 2, \"content-type\": \"text/plain\", \"content\": \"This is a test message with inline attachment with a filename\"}, {\"id\": 3, \"content-type\": \"application/octet-stream\", \"content-length\": 12392, \"content-transfer-encoding\": \"base64\", \"filename\": \"README\"}]}]}, []]]]"
> 
> This test fails for me. You're encoding the content-length of
> test/README. test/README certainly hasn't changed in the last six months
> so that seems like a reasonable thing to do... except then why is it
> 12392 on your machine, and 12380 on mine?

README was changed in 1ffb38.  Hardcoding the length was clearly a
bad idea, so I will send a replacement patch.

Peter

Thread: