blob 13840df76fe6bebc1834dc5aaf76f4e601453382 3929 bytes (raw)
name: test/T083-sexpr-count.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
| | #!/usr/bin/env bash
test_description='"(count ...)" modifier for sexp queries'
. $(dirname "$0")/test-lib.sh || exit 1
if [ $NOTMUCH_HAVE_SFSEXP -ne 1 ]; then
printf "Skipping due to missing sfsexp library\n"
test_done
fi
add_email_corpus
test_begin_subtest "threads with one message"
notmuch search --query=sexp '(and (from gusarov) (thread (count 1)))' | notmuch_search_sanitize > OUTPUT
cat <<EOF >EXPECTED
thread:XXX 2009-11-17 [1/1] Mikhail Gusarov; [notmuch] [PATCH] Handle rename of message file (inbox unread)
EOF
test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "partition threads by size"
notmuch count --output=threads --query=sexp '()' > OUTPUT
notmuch count --output=threads --query=sexp '(thread (count 1 2))' >> OUTPUT
notmuch count --output=threads --query=sexp '(thread (count 3 *))' >> OUTPUT
cat <<EOF >EXPECTED
24
16
8
EOF
test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "from addresses with any count"
notmuch address --query=sexp '(from (count 1 *))' | sort > OUTPUT
cat <<EOF >EXPECTED
Adrian Perez de Castro <aperez@igalia.com>
Alex Botero-Lowry <alex.boterolowry@gmail.com>
Alexander Botero-Lowry <alex.boterolowry@gmail.com>
Aron Griffis <agriffis@n01se.net>
Carl Worth <cworth@cworth.org>
Chris Wilson <chris@chris-wilson.co.uk>
François Boulogne <boulogne.f@gmail.com>
Ingmar Vanhassel <ingmar@exherbo.org>
Israel Herraiz <isra@herraiz.org>
Jan Janak <jan@ryngle.com>
Jjgod Jiang <gzjjgod@gmail.com>
Keith Packard <keithp@keithp.com>
Lars Kellogg-Stedman <lars@seas.harvard.edu>
Mikhail Gusarov <dottedmag@dottedmag.net>
Olivier Berger <olivier.berger@it-sudparis.eu>
Rolland Santimano <rollandsantimano@yahoo.com>
Stewart Smith <stewart@flamingspork.com>
EOF
test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "from addresses with unique words"
notmuch address --query=sexp '(from (count 1))' | sort > OUTPUT
cat <<EOF >EXPECTED
Adrian Perez de Castro <aperez@igalia.com>
Aron Griffis <agriffis@n01se.net>
Chris Wilson <chris@chris-wilson.co.uk>
François Boulogne <boulogne.f@gmail.com>
Ingmar Vanhassel <ingmar@exherbo.org>
Israel Herraiz <isra@herraiz.org>
Olivier Berger <olivier.berger@it-sudparis.eu>
Rolland Santimano <rollandsantimano@yahoo.com>
EOF
test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "from addresses with only non-unique words"
notmuch address --query=sexp '(from (not (count 1)))' | sort > OUTPUT
cat <<EOF >EXPECTED
Alex Botero-Lowry <alex.boterolowry@gmail.com>
Alexander Botero-Lowry <alex.boterolowry@gmail.com>
Carl Worth <cworth@cworth.org>
Jan Janak <jan@ryngle.com>
Jjgod Jiang <gzjjgod@gmail.com>
Keith Packard <keithp@keithp.com>
Lars Kellogg-Stedman <lars@seas.harvard.edu>
Mikhail Gusarov <dottedmag@dottedmag.net>
Stewart Smith <stewart@flamingspork.com>
EOF
test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "to addresses with any count"
notmuch address --output=recipients --deduplicate=address --output=address \
--query=sexp '(to (count 1 *))' | sort >OUTPUT
cat <<EOF >EXPECTED
allan@archlinux.org
aur-general@archlinux.org
dottedmag@dottedmag.net
keithp@keithp.com
notmuch@notmuchmail.org
olivier.berger@it-sudparis.eu
EOF
test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "to addresses with unique words"
notmuch address --query=sexp --output=recipients --output=address '(to (count 1))' | sort > OUTPUT
cat <<EOF >EXPECTED
allan@archlinux.org
aur-general@archlinux.org
dottedmag@dottedmag.net
keithp@keithp.com
notmuch@notmuchmail.org
olivier.berger@it-sudparis.eu
EOF
test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "to addresses with only non-unique words"
notmuch address --output=recipients --deduplicate=address --output=address \
--query=sexp '(to (not (count 1)))' | sort > OUTPUT
cat <<EOF >EXPECTED
notmuch@notmuchmail.org
EOF
test_expect_equal_file EXPECTED OUTPUT
test_done
|
debug log:
solving f3010d11 ...
found f3010d11 in https://yhetil.org/notmuch/20230218171737.3273805-4-david@tethera.net/
found e825ef3d in https://yhetil.org/notmuch/20230218171737.3273805-3-david@tethera.net/
applying [1/2] https://yhetil.org/notmuch/20230218171737.3273805-3-david@tethera.net/
diff --git a/test/T083-sexpr-count.sh b/test/T083-sexpr-count.sh
new file mode 100755
index 00000000..e825ef3d
applying [2/2] https://yhetil.org/notmuch/20230218171737.3273805-4-david@tethera.net/
diff --git a/test/T083-sexpr-count.sh b/test/T083-sexpr-count.sh\r
index e825ef3d..f3010d11 100755\r
Checking patch test/T083-sexpr-count.sh...
Applied patch test/T083-sexpr-count.sh cleanly.
Checking patch test/T083-sexpr-count.sh...
Applied patch test/T083-sexpr-count.sh cleanly.
index at:
100755 13840df76fe6bebc1834dc5aaf76f4e601453382 test/T083-sexpr-count.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).