diff options
| author | David Bremner <david@tethera.net> | 2021-01-02 13:10:39 -0400 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2021-02-06 19:52:11 -0400 |
| commit | 0d3bef312dd624225825e6fe175ea8830c1c9e39 (patch) | |
| tree | 3c9fdf207c504eec56f47e98ca3851b15f119307 /test | |
| parent | 5ef731f1aa0aa3d8fc89d1e724c021dbed8d4418 (diff) | |
cli/new: convert to new config framework
In addition to the same type of changes as converting other
subcommands, add the possibility of creating a database at the top
level. It would probably make sense to use this for insert as well.
Diffstat (limited to 'test')
| -rwxr-xr-x | test/T035-read-config.sh | 14 | ||||
| -rwxr-xr-x | test/T040-setup.sh | 2 | ||||
| -rwxr-xr-x | test/T050-new.sh | 6 |
3 files changed, 18 insertions, 4 deletions
diff --git a/test/T035-read-config.sh b/test/T035-read-config.sh index 102aea60..205d1736 100755 --- a/test/T035-read-config.sh +++ b/test/T035-read-config.sh @@ -461,4 +461,18 @@ output=$(notmuch count '*') restore_config test_expect_equal "52" "$output" +test_begin_subtest "run notmuch-new (xdg)" +xdg_config +generate_message +output=$(NOTMUCH_NEW --debug) +restore_config +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "run notmuch-new (xdg + profile)" +xdg_config ${RANDOM} +generate_message +output=$(NOTMUCH_NEW --debug) +restore_config +test_expect_equal "$output" "Added 1 new message to the database." + test_done diff --git a/test/T040-setup.sh b/test/T040-setup.sh index fbfe200a..1223ebf7 100755 --- a/test/T040-setup.sh +++ b/test/T040-setup.sh @@ -6,7 +6,7 @@ test_description='"notmuch setup"' test_begin_subtest "Notmuch new without a config suggests notmuch setup" output=$(notmuch --config=new-notmuch-config new 2>&1) test_expect_equal "$output" "\ -Configuration file new-notmuch-config not found. +Error: cannot load config file. Try running 'notmuch setup' to create a configuration." test_begin_subtest "Create a new config interactively" diff --git a/test/T050-new.sh b/test/T050-new.sh index 009b2633..882939fa 100755 --- a/test/T050-new.sh +++ b/test/T050-new.sh @@ -324,10 +324,10 @@ test_expect_equal "$output" "" OLDCONFIG=$(notmuch config get new.tags) -test_begin_subtest "Empty tags in new.tags are forbidden" +test_begin_subtest "Empty tags in new.tags are ignored" notmuch config set new.tags "foo;;bar" -output=$(NOTMUCH_NEW --debug 2>&1) -test_expect_equal "$output" "Error: tag '' in new.tags: empty tag forbidden" +output=$(NOTMUCH_NEW --quiet 2>&1) +test_expect_equal "$output" "" test_begin_subtest "Tags starting with '-' in new.tags are forbidden" notmuch config set new.tags "-foo;bar" |
