From a0f7a7a880a09d7d7bb3eba8ed01264a4bda7850 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Fri, 10 Jan 2014 00:18:34 +0200 Subject: [PATCH] [PATCH 3/5] test: fix test for literal folder: search --- 4a/e437dd4a12115f73043f9c20a29f9dd57ebab5 | 139 ++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 4a/e437dd4a12115f73043f9c20a29f9dd57ebab5 diff --git a/4a/e437dd4a12115f73043f9c20a29f9dd57ebab5 b/4a/e437dd4a12115f73043f9c20a29f9dd57ebab5 new file mode 100644 index 000000000..a74040290 --- /dev/null +++ b/4a/e437dd4a12115f73043f9c20a29f9dd57ebab5 @@ -0,0 +1,139 @@ +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 B67DE431FDA + for ; Thu, 9 Jan 2014 23:23:05 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" +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 KK7a2mkT2qLm for ; + Thu, 9 Jan 2014 23:22:59 -0800 (PST) +Received: from mail-ee0-f50.google.com (mail-ee0-f50.google.com + [74.125.83.50]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 9C529431FDC for ; Thu, 9 Jan 2014 23:22:56 -0800 + (PST) +Received: by mail-ee0-f50.google.com with SMTP id c41so1703229eek.37 + for ; Thu, 09 Jan 2014 23:22:55 -0800 (PST) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to + :references:in-reply-to:references; + bh=tFuV44LnXbpaW3axJ9yoYhlWmqMYYtxb0UCw1CgQYXQ=; + b=cm4MSbrnxq+BmVR+6FMShdO2YXdCWquKYmomEe32dA8qz/22iwljhH5GLeQRZqoAu8 + T+O5JkF1mR53+xennK2QV+KiKf8lqVcyfGgbSBgzwKG4pJEtuIt+mqUZmHPAqDyX1xJA + ojxrECp34XbLj7VV7L9XYM//oGw0iN5ZG1SwtaxNNndPrVVD/dRIagwahAOxaJdQssOZ + zFuFsv0Aj23BZ5nOuvHhXAOBgDkPe0yxM2/yeyPTxWgxHHu8Ye1BkxfHDcdmxCR4UNrn + kO6GeM6pfMOr3LaohbP4Vg1+yZHrjucXoaXYTkgxE59JHiXED1LAGp+j9aa58R7nhCx0 + PS3A== +X-Gm-Message-State: + ALoCoQk5qfz/DC6eG8kTHTlzVyRSDT3+Xpd81j3dgGX1G2xWfTiDm0DhJbY3YPy/kD+Rp/vwQ/f8 +X-Received: by 10.14.107.3 with SMTP id n3mr5524489eeg.67.1389305936871; + Thu, 09 Jan 2014 14:18:56 -0800 (PST) +Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi. + [88.195.111.91]) + by mx.google.com with ESMTPSA id v7sm9383116eel.2.2014.01.09.14.18.55 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Thu, 09 Jan 2014 14:18:56 -0800 (PST) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH 3/5] test: fix test for literal folder: search +Date: Fri, 10 Jan 2014 00:18:34 +0200 +Message-Id: + +X-Mailer: git-send-email 1.8.5.2 +In-Reply-To: +References: +In-Reply-To: +References: +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: Fri, 10 Jan 2014 07:23:05 -0000 + +--- + test/search-by-folder | 24 +++++++++++++++++++++--- + 1 file changed, 21 insertions(+), 3 deletions(-) + +diff --git a/test/search-by-folder b/test/search-by-folder +index 5cc2ca8..84ca438 100755 +--- a/test/search-by-folder ++++ b/test/search-by-folder +@@ -3,6 +3,7 @@ test_description='"notmuch search" by folder: (with variations)' + . ./test-lib.sh + + add_message '[dir]=bad' '[subject]="To the bone"' ++add_message '[dir]=.' '[subject]="Top level"' + add_message '[dir]=bad/news' '[subject]="Bears"' + mkdir -p "${MAIL_DIR}/duplicate/bad/news" + cp "$gen_msg_filename" "${MAIL_DIR}/duplicate/bad/news" +@@ -12,29 +13,46 @@ add_message '[dir]=things/favorite' '[subject]="Raindrops, whiskers, kettles"' + add_message '[dir]=things/bad' '[subject]="Bites, stings, sad feelings"' + + test_begin_subtest "Single-world folder: specification (multiple results)" +-output=$(notmuch search folder:bad | notmuch_search_sanitize) ++output=$(notmuch search folder:bad folder:bad/news folder:things/bad | notmuch_search_sanitize) + test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; To the bone (inbox unread) + thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bears (inbox unread) + thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bites, stings, sad feelings (inbox unread)" + ++test_begin_subtest "Top level folder" ++output=$(notmuch search folder:'""' | notmuch_search_sanitize) ++test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Top level (inbox unread)" ++ + test_begin_subtest "Two-word path to narrow results to one" + output=$(notmuch search folder:bad/news | notmuch_search_sanitize) + test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bears (inbox unread)" + ++test_begin_subtest "Folder search with --output=files" ++output=$(notmuch search --output=files folder:bad/news | sed -e "s,$MAIL_DIR,MAIL_DIR,") ++test_expect_equal "$output" "MAIL_DIR/bad/news/msg-003 ++MAIL_DIR/duplicate/bad/news/msg-003" ++ + test_begin_subtest "After removing duplicate instance of matching path" + rm -r "${MAIL_DIR}/bad/news" + notmuch new + output=$(notmuch search folder:bad/news | notmuch_search_sanitize) ++test_expect_equal "$output" "" ++ ++test_begin_subtest "Folder search with --output=files part #2" ++output=$(notmuch search --output=files folder:duplicate/bad/news | sed -e "s,$MAIL_DIR,MAIL_DIR,") ++test_expect_equal "$output" "MAIL_DIR/duplicate/bad/news/msg-003" ++ ++test_begin_subtest "After removing duplicate instance of matching path part #2" ++output=$(notmuch search folder:duplicate/bad/news | notmuch_search_sanitize) + test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bears (inbox unread)" + + test_begin_subtest "After rename, old path returns nothing" + mv "${MAIL_DIR}/duplicate/bad/news" "${MAIL_DIR}/duplicate/bad/olds" + notmuch new +-output=$(notmuch search folder:bad/news | notmuch_search_sanitize) ++output=$(notmuch search folder:duplicate/bad/news | notmuch_search_sanitize) + test_expect_equal "$output" "" + + test_begin_subtest "After rename, new path returns result" +-output=$(notmuch search folder:bad/olds | notmuch_search_sanitize) ++output=$(notmuch search folder:duplicate/bad/olds | notmuch_search_sanitize) + test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bears (inbox unread)" + + test_done +-- +1.8.5.2 + -- 2.26.2