X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2FT570-revision-tracking.sh;h=a63e691cd3d4b931659f9cd33d99947ee9370d07;hb=d0cd253b37646d9364d046e1d3edb022a58c105a;hp=20b44cbe52943b5f098e552cfe5d2b112e016190;hpb=f76d8f82dd004cf14426a91e8a80dcd2a4b97317;p=notmuch diff --git a/test/T570-revision-tracking.sh b/test/T570-revision-tracking.sh index 20b44cbe..a63e691c 100755 --- a/test/T570-revision-tracking.sh +++ b/test/T570-revision-tracking.sh @@ -49,11 +49,11 @@ test_expect_equal 1 ${result} notmuch count --lastmod '*' | cut -f2 > UUID -test_expect_success 'search succeeds with correct uuid' \ - "notmuch search --uuid=$(cat UUID) '*'" +test_begin_subtest "search succeeds with correct uuid" +test_expect_success "notmuch search --uuid=$(cat UUID) '*'" -test_expect_success 'uuid works as global option ' \ - "notmuch --uuid=$(cat UUID) search '*'" +test_begin_subtest "uuid works as global option" +test_expect_success "notmuch --uuid=$(cat UUID) search '*'" test_expect_code 1 'uuid works as global option II' \ "notmuch --uuid=this-is-no-uuid search '*'" @@ -61,16 +61,33 @@ test_expect_code 1 'uuid works as global option II' \ test_expect_code 1 'search fails with incorrect uuid' \ "notmuch search --uuid=this-is-no-uuid '*'" -test_expect_success 'show succeeds with correct uuid' \ - "notmuch show --uuid=$(cat UUID) '*'" +test_begin_subtest "show succeeds with correct uuid" +test_expect_success "notmuch show --uuid=$(cat UUID) '*'" test_expect_code 1 'show fails with incorrect uuid' \ "notmuch show --uuid=this-is-no-uuid '*'" -test_expect_success 'tag succeeds with correct uuid' \ - "notmuch tag --uuid=$(cat UUID) +test '*'" +test_begin_subtest "tag succeeds with correct uuid" +test_expect_success "notmuch tag --uuid=$(cat UUID) +test '*'" 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