2 test_description="database revision tracking"
4 . ./test-lib.sh || exit 1
8 test_begin_subtest "notmuch_database_get_revision"
9 test_C ${MAIL_DIR} <<'EOF'
13 int main (int argc, char** argv)
15 notmuch_database_t *db;
16 notmuch_status_t stat;
17 unsigned long revision;
22 stat = notmuch_database_open (argv[1], NOTMUCH_DATABASE_MODE_READ_ONLY, &db);
24 fputs ("open failed\n", stderr);
25 revision = notmuch_database_get_revision (db, &uuid);
26 printf("%s\t%lu\n", uuid, revision);
29 notmuch_uuid_sanitize < OUTPUT > CLEAN
35 test_expect_equal_file EXPECTED CLEAN
37 grep '^[0-9a-f]' OUTPUT > INITIAL_OUTPUT
39 test_begin_subtest "output of count matches test code"
40 notmuch count --lastmod '*' | cut -f2-3 > OUTPUT
41 test_expect_equal_file INITIAL_OUTPUT OUTPUT
43 test_begin_subtest "modification count increases"
44 before=$(notmuch count --lastmod '*' | cut -f3)
45 notmuch tag +a-random-tag-8743632 '*'
46 after=$(notmuch count --lastmod '*' | cut -f3)
47 result=$(($before < $after))
48 test_expect_equal 1 ${result}