X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2FT590-libconfig.sh;h=9c1e566dd468c0131588bb1b95c84c815a61434c;hb=1e96445cb5dc333e22b9ce01245902ba23fdb437;hp=8ca688334079662507e697246c3616de730e8a49;hpb=92e59568fa4eec466db78af6c21c39ca5826b0d7;p=notmuch diff --git a/test/T590-libconfig.sh b/test/T590-libconfig.sh index 8ca68833..9c1e566d 100755 --- a/test/T590-libconfig.sh +++ b/test/T590-libconfig.sh @@ -115,4 +115,32 @@ testkey2 testvalue2 EOF test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "dump config" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +{ + RUN(notmuch_database_set_config (db, "key with spaces", "value, with, spaces!")); +} +EOF +notmuch dump --include=config >OUTPUT +cat <<'EOF' >EXPECTED +#notmuch-dump batch-tag:2 config +#@ aaabefore beforeval +#@ key%20with%20spaces value,%20with,%20spaces%21 +#@ testkey1 testvalue1 +#@ testkey2 testvalue2 +#@ zzzafter afterval +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "restore config" +notmuch dump --include=config >EXPECTED +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +{ + RUN(notmuch_database_set_config (db, "testkey1", "mutatedvalue")); +} +EOF +notmuch restore --include=config OUTPUT +test_expect_equal_file EXPECTED OUTPUT + test_done