3 test_description='"notmuch config"'
6 test_begin_subtest "Get string value"
7 test_expect_equal "$(notmuch config get user.name)" "Notmuch Test Suite"
9 test_begin_subtest "Get list value"
10 test_expect_equal "$(notmuch config get new.tags)" "\
14 test_begin_subtest "Set string value"
15 notmuch config set foo.string "this is a string value"
16 test_expect_equal "$(notmuch config get foo.string)" "this is a string value"
18 test_begin_subtest "Set string value again"
19 notmuch config set foo.string "this is another string value"
20 test_expect_equal "$(notmuch config get foo.string)" "this is another string value"
22 test_begin_subtest "Set list value"
23 notmuch config set foo.list this "is a" "list value"
24 test_expect_equal "$(notmuch config get foo.list)" "\
29 test_begin_subtest "Set list value again"
30 notmuch config set foo.list this "is another" "list value"
31 test_expect_equal "$(notmuch config get foo.list)" "\
36 test_begin_subtest "Remove key"
37 notmuch config set foo.remove baz
38 notmuch config set foo.remove
39 test_expect_equal "$(notmuch config get foo.remove)" ""
41 test_begin_subtest "Remove non-existent key"
42 notmuch config set foo.nonexistent
43 test_expect_equal "$(notmuch config get foo.nonexistent)" ""
45 test_begin_subtest "List all items"
46 notmuch config set database.path "/canonical/path"
47 output=$(notmuch config list)
48 test_expect_equal "$output" "\
49 database.path=/canonical/path
50 user.name=Notmuch Test Suite
51 user.primary_email=test_suite@notmuchmail.org
52 user.other_email=test_suite_other@notmuchmail.org;test_suite@otherdomain.org
53 new.tags=unread;inbox;
56 maildir.synchronize_flags=true
57 foo.string=this is another string value
58 foo.list=this;is another;list value;"