aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAustin Clements <amdragon@mit.edu>2014-10-13 02:20:03 -0400
committerDavid Bremner <david@tethera.net>2015-08-14 18:23:49 +0200
commitcb08a2ee019e52dc29ba393d139fce8d7282c632 (patch)
tree77e3d75086d8e257ef3abfdf388e6aa2d3a81ff2 /test
parentf76d8f82dd004cf14426a91e8a80dcd2a4b97317 (diff)
lib: Add "lastmod:" queries for filtering by last modification
The implementation is essentially the same as the date range search prior to Jani's fancy date parser.
Diffstat (limited to 'test')
-rwxr-xr-xtest/T570-revision-tracking.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/T570-revision-tracking.sh b/test/T570-revision-tracking.sh
index 20b44cbe..0936011a 100755
--- a/test/T570-revision-tracking.sh
+++ b/test/T570-revision-tracking.sh
@@ -73,4 +73,21 @@ test_expect_success 'tag succeeds with correct uuid' \
test_expect_code 1 'tag fails with incorrect uuid' \
"notmuch tag --uuid=this-is-no-uuid '*' +test2"
+test_begin_subtest 'lastmod:0.. matches everything'
+total=$(notmuch count '*')
+modtotal=$(notmuch count lastmod:0..)
+test_expect_equal "$total" "$modtotal"
+
+test_begin_subtest 'lastmod:1000000.. matches nothing'
+modtotal=$(notmuch count lastmod:1000000..)
+test_expect_equal 0 "$modtotal"
+
+test_begin_subtest 'exclude one message using lastmod'
+lastmod=$(notmuch count --lastmod '*' | cut -f3)
+total=$(notmuch count '*')
+notmuch tag +4EFC743A.3060609@april.org id:4EFC743A.3060609@april.org
+subtotal=$(notmuch count lastmod:..$lastmod)
+result=$(($subtotal == $total-1))
+test_expect_equal 1 "$result"
+
test_done