diff options
| author | David Bremner <david@tethera.net> | 2016-10-01 23:13:26 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2016-10-15 10:22:40 -0300 |
| commit | 169e29d43192a9336869c4e6431203da7c85ef2d (patch) | |
| tree | 1377c1e96e41061dcc517678131566cac8318a97 /test | |
| parent | 6a3ce94aaf637db0308e87354b013ad7fd54705d (diff) | |
test: add known broken test for nondestructiveness of count
Thanks to Lucas (id:147263183913.27784.12274024193186585889@mbp) for the
bug report and the test case.
I decided to use the python version because the python bindings could
use more exercise.
Diffstat (limited to 'test')
| -rwxr-xr-x | test/T060-count.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/T060-count.sh b/test/T060-count.sh index d6933a76..69ab591f 100755 --- a/test/T060-count.sh +++ b/test/T060-count.sh @@ -126,4 +126,32 @@ sed 's/^\(A Xapian exception [^:]*\):.*$/\1/' < OUTPUT > OUTPUT.clean test_expect_equal_file EXPECTED OUTPUT.clean restore_database +test_begin_subtest "count library function is non-destructive" +test_subtest_known_broken +cat<<EOF > EXPECTED +1: 52 messages +2: 52 messages +Exclude 'spam' +3: 52 messages +4: 52 messages +EOF +test_python <<EOF +import sys +import notmuch + +query_string = 'tag:inbox or tag:spam' +tag_string = 'spam' + +database = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY) +query = notmuch.Query(database, query_string) + +print("1: {} messages".format(query.count_messages())) +print("2: {} messages".format(query.count_messages())) +print("Exclude '{}'".format(tag_string)) +query.exclude_tag(tag_string) +print("3: {} messages".format(query.count_messages())) +print("4: {} messages".format(query.count_messages())) +EOF +test_expect_equal_file EXPECTED OUTPUT + test_done |
