From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id D5FAF6DE0EB0 for ; Sun, 28 Apr 2019 09:29:25 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.03 X-Spam-Level: X-Spam-Status: No, score=-0.03 tagged_above=-999 required=5 tests=[AWL=-0.029, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0LcSlqxANW-U for ; Sun, 28 Apr 2019 09:29:24 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 800736DE0E92 for ; Sun, 28 Apr 2019 09:29:24 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1hKmg5-000050-Cu; Sun, 28 Apr 2019 12:29:21 -0400 Received: (nullmailer pid 20139 invoked by uid 1000); Sun, 28 Apr 2019 16:29:18 -0000 From: David Bremner To: Rob Browning , notmuch@notmuchmail.org Subject: [PATCH 1/2] test: notmuch show --format=raw for 4096 byte messages. Date: Sun, 28 Apr 2019 13:29:05 -0300 Message-Id: <20190428162906.20062-2-david@tethera.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190428162906.20062-1-david@tethera.net> References: <20190427210756.20370-1-rlb@defaultvalue.org> <20190428162906.20062-1-david@tethera.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 16:29:25 -0000 Rob Browning isolated a bug where files of exactly 4096 bytes generate errors because of a zero byte read. --- test/T210-raw.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/test/T210-raw.sh b/test/T210-raw.sh index 99fdef72..e1dd6064 100755 --- a/test/T210-raw.sh +++ b/test/T210-raw.sh @@ -30,4 +30,33 @@ Date: GENERATED_DATE This is just a test message (#2)" +test_begin_subtest "generating 4096 byte message" +line=$(seq 1 72 | sed 's/.*/./' | tr -d '\n') +for i in $(seq 1 53); do + printf "%s\n" "$line" >> BODY +done +# The last newline is added by add_message +printf "01234567890123456789012345" >> BODY +add_message '[subject]="4096"' '[body]="$(cat BODY)"' +output="$((`wc -c < $gen_msg_filename`))" +test_expect_equal 4096 "$output" + +test_begin_subtest "Show a raw message exactly 4096 bytes: no error" +test_subtest_known_broken +test_expect_success "notmuch show --format=raw subject:4096 1>/dev/null" + +test_begin_subtest "Show a raw message exactly 4096 bytes: correct output" +notmuch show --format=raw subject:4096 | notmuch_date_sanitize > OUTPUT +cat < EXPECTED +From: Notmuch Test Suite +To: Notmuch Test Suite +Message-Id: +Subject: 4096 +Date: GENERATED_DATE + +EOF +cat BODY >> EXPECTED +printf "\n" >> EXPECTED +test_expect_equal_file EXPECTED OUTPUT + test_done -- 2.20.1