unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob 062fd59962236ebed5871651ccf0df3e947c8aa7 1246 bytes (raw)
name: test/T570-revision-tracking.sh 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
 
#!/usr/bin/env bash
test_description="database revision tracking"

. ./test-lib.sh

add_email_corpus

test_begin_subtest "notmuch_database_get_revision"
test_C ${MAIL_DIR} <<'EOF'
#include <stdio.h>
#include <string.h>
#include <notmuch.h>
int main (int argc, char** argv)
{
   notmuch_database_t *db;
   notmuch_status_t stat;
   unsigned long revision;
   const char *uuid;

   unsigned long rev;

   stat = notmuch_database_open (argv[1], NOTMUCH_DATABASE_MODE_READ_ONLY, &db);
   if (stat)
       fputs ("open failed\n", stderr);
   revision = notmuch_database_get_revision (db, &uuid);
   printf("%s\t%lu\n", uuid, revision);
}
EOF
notmuch_uuid_sanitize < OUTPUT > CLEAN
cat <<'EOF' >EXPECTED
== stdout ==
UUID	53
== stderr ==
EOF
test_expect_equal_file EXPECTED CLEAN

grep '^[0-9a-f]' OUTPUT > INITIAL_OUTPUT

test_begin_subtest "output of count matches test code"
notmuch count --output=modifications '*' > OUTPUT
test_expect_equal_file INITIAL_OUTPUT OUTPUT

test_begin_subtest "modification count increases"
before=$(notmuch count --output=modifications '*' | cut -f2)
notmuch tag +a-random-tag-8743632 '*'
after=$(notmuch count --output=modifications '*' | cut -f2)
result=$(($before < $after))
test_expect_equal 1 ${result}
test_done

debug log:

solving 062fd59 ...
found 062fd59 in https://yhetil.org/notmuch/1433525318-23756-5-git-send-email-david@tethera.net/
found 74a7c49 in https://yhetil.org/notmuch/1433525318-23756-4-git-send-email-david@tethera.net/

applying [1/2] https://yhetil.org/notmuch/1433525318-23756-4-git-send-email-david@tethera.net/
diff --git a/test/T570-revision-tracking.sh b/test/T570-revision-tracking.sh
new file mode 100755
index 0000000..74a7c49


applying [2/2] https://yhetil.org/notmuch/1433525318-23756-5-git-send-email-david@tethera.net/
diff --git a/test/T570-revision-tracking.sh b/test/T570-revision-tracking.sh
index 74a7c49..062fd59 100755

Checking patch test/T570-revision-tracking.sh...
Applied patch test/T570-revision-tracking.sh cleanly.
Checking patch test/T570-revision-tracking.sh...
Applied patch test/T570-revision-tracking.sh cleanly.

index at:
100755 062fd59962236ebed5871651ccf0df3e947c8aa7	test/T570-revision-tracking.sh

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).