unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jani Nikula <jani@nikula.org>
To: notmuch@notmuchmail.org
Subject: [PATCH v5 7/9] test: add tests for date:since..until range queries
Date: Mon, 22 Oct 2012 00:22:30 +0300	[thread overview]
Message-ID: <37026480956679b12e82e4975f1837e93ef1c531.1350854171.git.jani@nikula.org> (raw)
In-Reply-To: <cover.1350854171.git.jani@nikula.org>
In-Reply-To: <cover.1350854171.git.jani@nikula.org>

A brief initial test set.
---
 test/notmuch-test |    1 +
 test/search-date  |   21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)
 create mode 100755 test/search-date

diff --git a/test/notmuch-test b/test/notmuch-test
index 7eadfdf..9a1b375 100755
--- a/test/notmuch-test
+++ b/test/notmuch-test
@@ -61,6 +61,7 @@ TESTS="
   emacs-show
   missing-headers
   parse-time-string
+  search-date
 "
 TESTS=${NOTMUCH_TESTS:=$TESTS}
 
diff --git a/test/search-date b/test/search-date
new file mode 100755
index 0000000..70bcf34
--- /dev/null
+++ b/test/search-date
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+test_description="date:since..until queries"
+. ./test-lib.sh
+
+add_email_corpus
+
+test_begin_subtest "Absolute date range"
+output=$(notmuch search date:2010-12-16..12/16/2010 | notmuch_search_sanitize)
+test_expect_equal "$output" "thread:XXX   2010-12-16 [1/1] Olivier Berger; Essai accentué (inbox unread)"
+
+test_begin_subtest "Absolute time range with TZ"
+notmuch search date:18-Nov-2009_02:19:26-0800..2009-11-18_04:49:52-06:00 | notmuch_search_sanitize > OUTPUT
+cat <<EOF >EXPECTED
+thread:XXX   2009-11-18 [1/3] Carl Worth| Jan Janak; [notmuch] What a great idea! (inbox unread)
+thread:XXX   2009-11-18 [1/2] Carl Worth| Jan Janak; [notmuch] [PATCH] Older versions of install do not support -C. (inbox unread)
+thread:XXX   2009-11-18 [1/3] Carl Worth| Aron Griffis, Keith Packard; [notmuch] archive (inbox unread)
+thread:XXX   2009-11-18 [1/2] Carl Worth| Keith Packard; [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread)
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
+test_done
-- 
1.7.10.4

  parent reply	other threads:[~2012-10-21 21:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-21 21:22 [PATCH v5 0/9] notmuch search date:since..until query support Jani Nikula
2012-10-21 21:22 ` [PATCH v5 1/9] build: drop the -Wswitch-enum warning Jani Nikula
2012-10-21 21:22 ` [PATCH v5 2/9] parse-time-string: add a date/time parser to notmuch Jani Nikula
2012-10-22  8:14   ` Austin Clements
2012-10-25 18:58     ` Austin Clements
2012-10-27 20:38       ` Tomi Ollila
2012-10-28 22:30     ` Jani Nikula
2012-10-28 22:52       ` Austin Clements
2012-10-21 21:22 ` [PATCH v5 3/9] test: add new test tool parse-time for date/time parser Jani Nikula
2012-10-21 21:22 ` [PATCH v5 4/9] test: add smoke tests for the date/time parser module Jani Nikula
2012-10-23  4:23   ` Austin Clements
2012-10-28 22:34     ` Jani Nikula
2012-10-21 21:22 ` [PATCH v5 5/9] build: build parse-time-string as part of the notmuch lib and static cli Jani Nikula
2012-10-21 21:22 ` [PATCH v5 6/9] lib: add date range query support Jani Nikula
2012-10-23  4:52   ` Austin Clements
2012-10-28 22:39     ` Jani Nikula
2012-10-21 21:22 ` Jani Nikula [this message]
2012-10-21 21:22 ` [PATCH v5 8/9] man: document the date:since..until range queries Jani Nikula
2012-10-24 21:08   ` Austin Clements
2012-10-28 22:41     ` Jani Nikula
2012-10-21 21:22 ` [PATCH v5 9/9] NEWS: date range search support Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37026480956679b12e82e4975f1837e93ef1c531.1350854171.git.jani@nikula.org \
    --to=jani@nikula.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).