unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob 41a8288689a9b82bc7b12c2bae81f44ac362d137 1099 bytes (raw)
name: test/T081-sexpr-search.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
 
#!/usr/bin/env bash
test_description='"notmuch search" in several variations'
. $(dirname "$0")/test-lib.sh || exit 1

add_email_corpus

for query in '()' '(not)' '(and)' '(or ())' '(or (not))' '(or (and))' \
	     '(or (and) (or) (not (and)))'; do
    test_begin_subtest "all messages: $query"
    notmuch search '*' > EXPECTED
    notmuch search --query-syntax=sexp "$query" > OUTPUT
    test_expect_equal_file EXPECTED OUTPUT
done

for query in '(or)' '(not ())' '(not (not))' '(not (and))' \
		    '(not (or (and) (or) (not (and))))'; do
    test_begin_subtest "no messages: $query"
    notmuch search --query-syntax=sexp "$query" > OUTPUT
    test_expect_equal_file /dev/null OUTPUT
done

test_begin_subtest "Unbalanced parens"
# A code 1 indicates the error was handled (a crash will return e.g. 139).
test_expect_code 1 "notmuch search --query-syntax=sexp '('"

test_begin_subtest "unknown_prefix"
notmuch search --query-syntax=sexp '(foo)' >OUTPUT 2>&1
cat <<EOF > EXPECTED
notmuch search: Syntax error in query
unimplemented prefix foo
EOF
test_expect_equal_file EXPECTED OUTPUT

test_done

debug log:

solving 41a82886 ...
found 41a82886 in https://yhetil.org/notmuch/20210718024021.3850340-7-david@tethera.net/

applying [1/1] https://yhetil.org/notmuch/20210718024021.3850340-7-david@tethera.net/
diff --git a/test/T081-sexpr-search.sh b/test/T081-sexpr-search.sh
new file mode 100755
index 00000000..41a82886

Checking patch test/T081-sexpr-search.sh...
Applied patch test/T081-sexpr-search.sh cleanly.

index at:
100755 41a8288689a9b82bc7b12c2bae81f44ac362d137	test/T081-sexpr-search.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).