mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-24 18:34:52 +01:00
test: test insert --create-folder option
Add tests for notmuch insert --create-folder option.
This commit is contained in:
parent
d494271d79
commit
9a64b2df29
1 changed files with 24 additions and 0 deletions
24
test/insert
24
test/insert
|
@ -94,4 +94,28 @@ gen_insert_msg
|
|||
test_expect_code 1 "Insert message into non-existent folder" \
|
||||
"notmuch insert --folder=nonesuch < $gen_msg_filename"
|
||||
|
||||
test_begin_subtest "Insert message, create folder"
|
||||
gen_insert_msg
|
||||
notmuch insert --folder=F --create-folder +folder < "$gen_msg_filename"
|
||||
output=$(notmuch search --output=files folder:F tag:folder)
|
||||
basename=$(basename "$output")
|
||||
test_expect_equal_file "$gen_msg_filename" "$MAIL_DIR/F/cur/${basename}"
|
||||
|
||||
test_begin_subtest "Insert message, create subfolder"
|
||||
gen_insert_msg
|
||||
notmuch insert --folder=F/G/H/I/J --create-folder +folder < "$gen_msg_filename"
|
||||
output=$(notmuch search --output=files folder:F/G/H/I/J tag:folder)
|
||||
basename=$(basename "$output")
|
||||
test_expect_equal_file "$gen_msg_filename" "${MAIL_DIR}/F/G/H/I/J/cur/${basename}"
|
||||
|
||||
test_begin_subtest "Insert message, create existing subfolder"
|
||||
gen_insert_msg
|
||||
notmuch insert --folder=F/G/H/I/J --create-folder +folder < "$gen_msg_filename"
|
||||
output=$(notmuch count folder:F/G/H/I/J tag:folder)
|
||||
test_expect_equal "$output" "2"
|
||||
|
||||
gen_insert_msg
|
||||
test_expect_code 1 "Insert message, create invalid subfolder" \
|
||||
"notmuch insert --folder=../G --create-folder $gen_msg_filename"
|
||||
|
||||
test_done
|
||||
|
|
Loading…
Reference in a new issue