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 1A5BF6DE1F02 for ; Sat, 25 Feb 2017 05:31:39 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.535 X-Spam-Level: X-Spam-Status: No, score=-0.535 tagged_above=-999 required=5 tests=[AWL=0.185, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] 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 HureWJMDmQ4O for ; Sat, 25 Feb 2017 05:31:38 -0800 (PST) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) by arlo.cworth.org (Postfix) with ESMTPS id 92E146DE1EFE for ; Sat, 25 Feb 2017 05:31:37 -0800 (PST) Received: by mail-lf0-f50.google.com with SMTP id l12so18458041lfe.0 for ; Sat, 25 Feb 2017 05:31:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nikula-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=52c9Yl/1YfUwsYuiPmY1JE6z4ECQQAr+2IvchBQoz1c=; b=OY2AtPBvomuKJN03L1ET8MGcgTLhfxVtaZPcCyTr9Av0SoHI/2uEpey85KtHLiK2YT JuRn4c3W2JxiZi7l4opS/49vO2iIY6d1YoqI7kNP4G+OszX5Voq4+FC/kd3ah6Rn60sS CKdVmlLZMyr4Cv6dSTFuJUms4xSkVJMQJjfl4MwD7KRC8yYTuDfUO0fXOIe1rVPqPYIx gaGJJ448l0YdNoGxzd2Kxlslsieda+U4VV3SzvdlUyXIdqyBtd+qUYPa7/ZM9Kea2RTw zGOa2ihBOJfdKpdwPKe8N9EsF8uvNxWVY+LCWVUCorhw5l+Om+iyGze7Pp+L+IhOnBP9 MaJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=52c9Yl/1YfUwsYuiPmY1JE6z4ECQQAr+2IvchBQoz1c=; b=b2g/zjr76hQqz2QRy4TcKUKgsCPtCigEjqQ2I6UuF/dUTt0shprwEHkGp0eO6CrLTn OyfunvSVXw8sLL6KdJrQMrsWYPHFSV41Em7yGLRR3VI6GWC7sUFR06a3rPL64n24jUVC uGceAVIQURU70i8iwecGVHWL5B6G/QUJo5D6pK7J2uU2SWfTO58rz7irUa1nDCFe/i2c eMkk86MLj9EZSqKc0CrQVACQsV6AtPFSvW7FD7cN3ME15nO4ZF/PkmQFTtrLiCBea/Dm +KVnpL7DCK/pfRH22GLiTfXZgNTG7j8BJrx+FSB3K79nHJ3L/fD0y/CmsK8Tb23g3Kg2 385A== X-Gm-Message-State: AMke39n1tNeUx40f4MdqOvS9lIdSksjf6f/BLu2Nr7drersnEvnje5xBLRYYmwGj+ycf/w== X-Received: by 10.25.206.146 with SMTP id e140mr2412387lfg.94.1488029495794; Sat, 25 Feb 2017 05:31:35 -0800 (PST) Received: from localhost (mobile-access-bcee80-14.dhcp.inet.fi. [188.238.128.14]) by smtp.gmail.com with ESMTPSA id z26sm2172751lja.61.2017.02.25.05.31.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 Feb 2017 05:31:35 -0800 (PST) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH 2/2] test: test format version difference between v2 and v3 Date: Sat, 25 Feb 2017 15:31:32 +0200 Message-Id: <20170225133132.9976-2-jani@nikula.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170225133132.9976-1-jani@nikula.org> References: <20170225133132.9976-1-jani@nikula.org> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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: Sat, 25 Feb 2017 13:31:39 -0000 Schemata v3 changed message filename field to a list. Test both versions 2 and 3. --- test/T160-json.sh | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/test/T160-json.sh b/test/T160-json.sh index 099632b4a286..85b9b41f314c 100755 --- a/test/T160-json.sh +++ b/test/T160-json.sh @@ -70,4 +70,71 @@ test_expect_code 20 "Format version: too low" \ test_expect_code 21 "Format version: too high" \ "notmuch search --format-version=999 \\*" +test_begin_subtest "Show message: multiple filenames" +add_message "[id]=message-id@example.com [filename]=copy1" +add_message "[id]=message-id@example.com [filename]=copy2" +cat < EXPECTED +[ + [ + [ + { + "date_relative": "2001-01-05", + "excluded": false, + "filename": [ + "${MAIL_DIR}/copy1", + "${MAIL_DIR}/copy2" + ], + "headers": { + "Date": "Fri, 05 Jan 2001 15:43:52 +0000", + "From": "Notmuch Test Suite ", + "Subject": "Show message: multiple filenames", + "To": "Notmuch Test Suite " + }, + "id": "message-id@example.com", + "match": true, + "tags": [ + "inbox", + "unread" + ], + "timestamp": 978709432 + }, + [] + ] + ] +] +EOF +output=$(notmuch show --format=json --body=false id:message-id@example.com) +test_expect_equal_json "$output" "$(cat EXPECTED)" + +test_begin_subtest "Show message: multiple filenames, format version 2" +cat < EXPECTED +[ + [ + [ + { + "date_relative": "2001-01-05", + "excluded": false, + "filename": "${MAIL_DIR}/copy1", + "headers": { + "Date": "Fri, 05 Jan 2001 15:43:52 +0000", + "From": "Notmuch Test Suite ", + "Subject": "Show message: multiple filenames", + "To": "Notmuch Test Suite " + }, + "id": "message-id@example.com", + "match": true, + "tags": [ + "inbox", + "unread" + ], + "timestamp": 978709432 + }, + [] + ] + ] +] +EOF +output=$(notmuch show --format=json --body=false --format-version=2 id:message-id@example.com) +test_expect_equal_json "$output" "$(cat EXPECTED)" + test_done -- 2.11.0