X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2Fcount;h=da86c8cc70cf4a9f32669fd1b3472353f528d295;hp=879b114a35f567bb190185581cf6bad3d6ea28c4;hb=09f8ef3e3db6e9e831f3f57fcd18231af355557a;hpb=60e79e3a9f1c8f054bd3f064714a9e92e8fe13b8 diff --git a/test/count b/test/count index 879b114a..da86c8cc 100755 --- a/test/count +++ b/test/count @@ -28,6 +28,16 @@ test_expect_equal \ "$((`notmuch search '*' | wc -l`))" \ "`notmuch count --output=threads '*'`" +test_begin_subtest "files count" +test_expect_equal \ + "$((`notmuch search --output=files '*' | wc -l`))" \ + "`notmuch count --output=files '*'`" + +test_begin_subtest "files count for a duplicate message-id" +test_expect_equal \ + "2" \ + "`notmuch count --output=files id:20091117232137.GA7669@griffis1.net`" + test_begin_subtest "count with no matching messages" test_expect_equal \ "0" \ @@ -38,4 +48,50 @@ test_expect_equal \ "0" \ "`notmuch count --output=threads from:cworth and not from:cworth`" +test_begin_subtest "message count is the default for batch count" +notmuch count --batch >OUTPUT <EXPECTED +notmuch count --output=messages from:cworth >>EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "batch message count" +notmuch count --batch --output=messages >OUTPUT <EXPECTED +notmuch count --output=messages >>EXPECTED +notmuch count --output=messages tag:inbox >>EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "batch thread count" +notmuch count --batch --output=threads >OUTPUT <EXPECTED +notmuch count --output=threads from:cworth >>EXPECTED +notmuch count --output=threads from:cworth and not from:cworth >>EXPECTED +notmuch count --output=threads foo >>EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "batch message count with input file" +cat >INPUT <OUTPUT +notmuch count --output=messages from:cworth >EXPECTED +notmuch count --output=messages >>EXPECTED +notmuch count --output=messages tag:inbox >>EXPECTED +test_expect_equal_file EXPECTED OUTPUT + + test_done