From: Austin Clements Date: Tue, 11 Mar 2014 22:19:53 +0000 (+2000) Subject: [PATCH 1/2] test: Add broken test for Emacs boolean term escaping X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=99a0e13803b63c11be5eb1486ca2bd9443088453;p=notmuch-archives.git [PATCH 1/2] test: Add broken test for Emacs boolean term escaping --- diff --git a/1f/fb069a3aeaf2fe36639858fc8417ea81e84556 b/1f/fb069a3aeaf2fe36639858fc8417ea81e84556 new file mode 100644 index 000000000..56168b4bf --- /dev/null +++ b/1f/fb069a3aeaf2fe36639858fc8417ea81e84556 @@ -0,0 +1,107 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id B0325431FC4 + for ; Tue, 11 Mar 2014 15:20:16 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 4Y9umFKgm-Oy for ; + Tue, 11 Mar 2014 15:20:12 -0700 (PDT) +Received: from dmz-mailsec-scanner-4.mit.edu (dmz-mailsec-scanner-4.mit.edu + [18.9.25.15]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id A1B35431FBD + for ; Tue, 11 Mar 2014 15:20:12 -0700 (PDT) +X-AuditID: 1209190f-f790b6d000000c3a-e6-531f8c196c74 +Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) + (using TLS with cipher AES256-SHA (256/256 bits)) + (Client did not present a certificate) + by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP + id 19.C8.03130.91C8F135; Tue, 11 Mar 2014 18:20:10 -0400 (EDT) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id s2BMK792009794; + Tue, 11 Mar 2014 18:20:08 -0400 +Received: from drake.dyndns.org (31-33-67.wireless.csail.mit.edu + [128.31.33.67]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s2BMK62J024773 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Tue, 11 Mar 2014 18:20:07 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1WNV1p-0003MX-Nj; Tue, 11 Mar 2014 18:20:05 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH 1/2] test: Add broken test for Emacs boolean term escaping +Date: Tue, 11 Mar 2014 18:19:53 -0400 +Message-Id: <1394576394-12816-1-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.8.4.rc3 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFrrHIsWRmVeSWpSXmKPExsUixCmqrSvVIx9sMEfA4vrNmcwOjB7PVt1i + DmCM4rJJSc3JLEst0rdL4Mo439zJVtDOUfHo0F6mBsa/bF2MHBwSAiYS59YldzFyApliEhfu + rQcKc3EICcxmkmi+MhfK2cgo8X3VQkYI5xiTxJ61y5ggnLmMEksPvWEB6WcT0JDYtn85I4gt + IiAtsfPubFaQFcwCahJ/ulRAwsICXhKztuxlArFZBFQlFr6cDHYFr4CDxJZ94hBXKEksPLWN + FcTmFRCUODnzCQvEFHWJ9fOEQMLMAvISzVtnM09gFJiFpGoWQtUsJFULGJlXMcqm5Fbp5iZm + 5hSnJusWJyfm5aUW6Zro5WaW6KWmlG5iBAejJP8Oxm8HlQ4xCnAwKvHwzlCSDxZiTSwrrsw9 + xCjJwaQkyju7AyjEl5SfUpmRWJwRX1Sak1p8iFGCg1lJhPejJlCONyWxsiq1KB8mJc3BoiTO + 23dWIlhIID2xJDU7NbUgtQgmK8PBoSTBu7wLqFGwKDU9tSItM6cEIc3EwQkynAdoOEM3yPDi + gsTc4sx0iPwpRkUpcd6FIM0CIImM0jy4XliyeMUoDvSKMG8USBUPMNHAdb8CGswENPhHANjg + kkSElFQDo7C/zpy37lvmusmmXkrSiJJ/f+WmUp3GTt39VQ8PVdu2MHPe6FVImd8WJ7Dt3XFW + qzgmLtOUH9IdVzb571GRZNTr+/TG0/de86MXy98p6vZey3j698ZdQYXZD/Qu7X2/yNrHZpoy + z44rN9yNTzpVM4ty3r94aUqr0u0DTQsXlMd7d3zTcJXbocRSnJFoqMVcVJwIAFPsrxTxAgAA +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +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: Tue, 11 Mar 2014 22:20:16 -0000 + +The current term escaper gets most of these right, but fails to escape +things containing Unicode "fancy quotes" or things containing +non-whitespace control characters. +--- + test/T310-emacs.sh | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh +index 00ae96a..6c18bbd 100755 +--- a/test/T310-emacs.sh ++++ b/test/T310-emacs.sh +@@ -953,4 +953,16 @@ test_emacs '(notmuch-search "subject:\"search race test\" -subject:two") + output=$(notmuch search --output=messages 'tag:search-global-race-tag') + test_expect_equal "$output" "id:$gen_msg_id_1" + ++test_begin_subtest "Term escaping" ++test_subtest_known_broken ++output=$(test_emacs "(mapcar 'notmuch-escape-boolean-term (list ++ \"\" ++ \"abc\`~\!@#\$%^&*-=_+123\" ++ \"(abc\" ++ \")abc\" ++ \"\\\"abc\" ++ \"\x01xyz\" ++ \"\\x201cxyz\\x201d\"))") ++test_expect_equal "$output" '("\"\"" "abc`~!@#$%^&*-=_+123" "\"(abc\"" "\")abc\"" "\"\"\"abc\"" "\"'$'\x01''xyz\"" "\"“xyz”\"")' ++ + test_done +-- +1.8.4.rc3 +