X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2FT570-revision-tracking.sh;h=bcc97dd9396305c7b984d156e575bdde87198804;hb=d4e9b9072c44dcc6faf112bf7b984a268ad22696;hp=aaa45468e5e6fabf3611a351a0dc7f46306fd207;hpb=606d9b02e46498874f6c3b5af18467c870e8658b;p=notmuch diff --git a/test/T570-revision-tracking.sh b/test/T570-revision-tracking.sh index aaa45468..bcc97dd9 100755 --- a/test/T570-revision-tracking.sh +++ b/test/T570-revision-tracking.sh @@ -95,7 +95,7 @@ subtotal=$(notmuch count lastmod:..$lastmod) result=$(($subtotal == $total-1)) test_expect_equal 1 "$result" -if [ $NOTMUCH_HAVE_SFSEXP -eq 1 ]; then +if [ "${NOTMUCH_HAVE_SFSEXP-0}" = "1" ]; then test_begin_subtest 'exclude one message using negative lastmod (sexp)' total=$(notmuch count '*') notmuch tag +${RANDOM} id:4EFC743A.3060609@april.org @@ -103,4 +103,23 @@ if [ $NOTMUCH_HAVE_SFSEXP -eq 1 ]; then test_expect_equal 1 "$count" fi +test_begin_subtest 'exclude one message using negative lastmod' +total=$(notmuch count '*') +notmuch tag +${RANDOM} id:4EFC743A.3060609@april.org +count=$(notmuch count lastmod:-1..) +test_expect_equal 1 "$count" + +test_begin_subtest 'exclude one message using negative lastmod (second param)' +total=$(notmuch count '*') +notmuch tag +${RANDOM} id:4EFC743A.3060609@april.org +count=$(notmuch count lastmod:..-1) +test_expect_equal 51 "$count" + +test_begin_subtest 'negative lastmod (two parameters)' +notmuch tag +${RANDOM} '*' +before=$(notmuch count --lastmod '*' | cut -f3) +notmuch tag +${RANDOM} id:4EFC743A.3060609@april.org +count=$(notmuch count lastmod:-100..$before) +test_expect_equal 51 "$count" + test_done