unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob febe006f58880c824da894efdc013d56356e3ce6 1038 bytes (raw)
name: test/T051-new-renames.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
 
#!/usr/bin/env bash
test_description='"notmuch new" with directory renames'
. ./test-lib.sh

for loop in `seq 10`; do

rm -rf ${MAIL_DIR}

for i in `seq 10`; do
    generate_message '[dir]=foo' '[subject]="Message foo $i"'
done

for i in `seq 10`; do
    generate_message '[dir]=bar' '[subject]="Message bar $i"'
done

test_begin_subtest "Index the messages, round $loop"
output=$(NOTMUCH_NEW)
test_expect_equal "$output" "Added 20 new messages to the database."

all_files=$(notmuch search --output=files \*)
count_foo=$(notmuch count folder:foo)

test_begin_subtest "Rename folder"
mv ${MAIL_DIR}/foo ${MAIL_DIR}/baz
output=$(NOTMUCH_NEW)
test_expect_equal "$output" "No new mail. Detected $count_foo file renames."

test_begin_subtest "Rename folder back"
mv ${MAIL_DIR}/baz ${MAIL_DIR}/foo
output=$(NOTMUCH_NEW)
test_expect_equal "$output" "No new mail. Detected $count_foo file renames."

test_begin_subtest "Files remain the same"
output=$(notmuch search --output=files \*)
test_expect_equal "$output" "$all_files"

done

test_done

debug log:

solving febe006f ...
found febe006f in https://yhetil.org/notmuch/20211226112142.1958395-1-david@tethera.net/ ||
	https://yhetil.org/notmuch/1393191650-28333-1-git-send-email-jani@nikula.org/

applying [1/1] https://yhetil.org/notmuch/20211226112142.1958395-1-david@tethera.net/
diff --git a/test/T051-new-renames.sh b/test/T051-new-renames.sh
new file mode 100755
index 00000000..febe006f

Checking patch test/T051-new-renames.sh...
Applied patch test/T051-new-renames.sh cleanly.

skipping https://yhetil.org/notmuch/1393191650-28333-1-git-send-email-jani@nikula.org/ for febe006f
index at:
100755 febe006f58880c824da894efdc013d56356e3ce6	test/T051-new-renames.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).