From: Jani Nikula Date: Sat, 22 Feb 2014 22:25:36 +0000 (+0200) Subject: [PATCH v2 05/13] test: fix test for literal folder: search X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=516668448ae9f82718ce2a9bfaee059fdffb27f8;p=notmuch-archives.git [PATCH v2 05/13] test: fix test for literal folder: search --- diff --git a/64/b9bacdb4ec632d618878381ed064dca5b8da0e b/64/b9bacdb4ec632d618878381ed064dca5b8da0e new file mode 100644 index 000000000..5541e658e --- /dev/null +++ b/64/b9bacdb4ec632d618878381ed064dca5b8da0e @@ -0,0 +1,141 @@ +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 25A49429E37 + for ; Sat, 22 Feb 2014 14:26:13 -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 gOs7Bcno7UgA for ; + Sat, 22 Feb 2014 14:26:09 -0800 (PST) +Received: from mail-ee0-f41.google.com (mail-ee0-f41.google.com + [74.125.83.41]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 6BE6E431FBF for ; Sat, 22 Feb 2014 14:26:00 -0800 + (PST) +Received: by mail-ee0-f41.google.com with SMTP id b15so171101eek.0 + for ; Sat, 22 Feb 2014 14:25:59 -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=FfTMgmIXjeUEZG9ebSHcX0rehDDBc/sQNdlb61wsWCc=; + b=RsG0xDZa+RGAeq+iAX3ClbmoR0grL2G7CnAZvojvvG3g+Pz+LULuCSoTKaWrLWj3bB + ZpNM343Sek/UxZ8s+nlFLwiPE4z4R3WAuLFqFyxOcMBH2447uRsgJ1LmpqGv5TI4ghB8 + RY8CMj+0bilXF5y0EJZpG2ttMs55HfU3WPRm3oKTHwHfLzzU/ZES21gFTmUV9fhjLkKT + Gt4MhF7UnZv4NVUJ7me0ShtD7Qa1KIvqiszPUocFKcV6Rw0SQtdGLLLvp7iE4/Ntax5J + fdMvW7caRVb/4q/iOorudmaTdaFp57NRqpxYmWyMhDK30DKGEzf3a+UpUgXCURPfI+mU + 5CQw== +X-Gm-Message-State: + ALoCoQkJIvuj9doVfgeX6tD5DYYjMI3kveS6Ie7B/S9jFOjH+sT30XyFLedXb5nGn+1TqZCBLape +X-Received: by 10.14.176.66 with SMTP id a42mr16115353eem.101.1393107959165; + Sat, 22 Feb 2014 14:25:59 -0800 (PST) +Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi. + [88.195.111.91]) + by mx.google.com with ESMTPSA id g1sm43759857eet.6.2014.02.22.14.25.57 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Sat, 22 Feb 2014 14:25:58 -0800 (PST) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH v2 05/13] test: fix test for literal folder: search +Date: Sun, 23 Feb 2014 00:25:36 +0200 +Message-Id: + <7f0d707ba67d9de5940e05c110e9a78f669e9b06.1393105055.git.jani@nikula.org> +X-Mailer: git-send-email 1.8.5.3 +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: Sat, 22 Feb 2014 22:26:13 -0000 + +Some of the folder: matching capabilities are lost in the +probabilistic to boolean prefix change. Fix them. +--- + test/T100-search-by-folder.sh | 24 +++++++++++++++++++++--- + 1 file changed, 21 insertions(+), 3 deletions(-) + +diff --git a/test/T100-search-by-folder.sh b/test/T100-search-by-folder.sh +index 5cc2ca8d388a..84ca43820031 100755 +--- a/test/T100-search-by-folder.sh ++++ b/test/T100-search-by-folder.sh +@@ -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.3 +