From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Cc: David Bremner <david@tethera.net>
Subject: [PATCH 1/6] test: use keys with group 'test' in T590-libconfig
Date: Sun, 20 Dec 2020 08:10:19 -0400 [thread overview]
Message-ID: <20201220121024.1122362-2-david@tethera.net> (raw)
In-Reply-To: <20201220121024.1122362-1-david@tethera.net>
In a future commit we want to interoperate better with glib KeyFiles,
which need groups for all keys.
---
test/T590-libconfig.sh | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/test/T590-libconfig.sh b/test/T590-libconfig.sh
index 360e45b0..8c34acf9 100755
--- a/test/T590-libconfig.sh
+++ b/test/T590-libconfig.sh
@@ -28,18 +28,18 @@ EOF
test_begin_subtest "notmuch_database_{set,get}_config"
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
{
- EXPECT0(notmuch_database_set_config (db, "testkey1", "testvalue1"));
- EXPECT0(notmuch_database_set_config (db, "testkey2", "testvalue2"));
- EXPECT0(notmuch_database_get_config (db, "testkey1", &val));
- printf("testkey1 = %s\n", val);
- EXPECT0(notmuch_database_get_config (db, "testkey2", &val));
- printf("testkey2 = %s\n", val);
+ EXPECT0(notmuch_database_set_config (db, "test.key1", "testvalue1"));
+ EXPECT0(notmuch_database_set_config (db, "test.key2", "testvalue2"));
+ EXPECT0(notmuch_database_get_config (db, "test.key1", &val));
+ printf("test.key1 = %s\n", val);
+ EXPECT0(notmuch_database_get_config (db, "test.key2", &val));
+ printf("test.key2 = %s\n", val);
}
EOF
cat <<'EOF' >EXPECTED
== stdout ==
-testkey1 = testvalue1
-testkey2 = testvalue2
+test.key1 = testvalue1
+test.key2 = testvalue2
== stderr ==
EOF
test_expect_equal_file EXPECTED OUTPUT
@@ -93,8 +93,8 @@ EOF
cat <<'EOF' >EXPECTED
== stdout ==
aaabefore beforeval
-testkey1 testvalue1
-testkey2 testvalue2
+test.key1 testvalue1
+test.key2 testvalue2
zzzafter afterval
== stderr ==
EOF
@@ -115,8 +115,8 @@ EOF
cat <<'EOF' >EXPECTED
== stdout ==
aaabefore 1
-testkey1 1
-testkey2 1
+test.key1 1
+test.key2 1
zzzafter 1
== stderr ==
EOF
@@ -126,7 +126,7 @@ test_begin_subtest "notmuch_database_get_config_list: one prefix"
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
{
notmuch_config_list_t *list;
- EXPECT0(notmuch_database_get_config_list (db, "testkey", &list));
+ EXPECT0(notmuch_database_get_config_list (db, "test.key", &list));
for (; notmuch_config_list_valid (list); notmuch_config_list_move_to_next (list)) {
printf("%s %s\n", notmuch_config_list_key (list), notmuch_config_list_value(list));
}
@@ -135,8 +135,8 @@ cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
EOF
cat <<'EOF' >EXPECTED
== stdout ==
-testkey1 testvalue1
-testkey2 testvalue2
+test.key1 testvalue1
+test.key2 testvalue2
== stderr ==
EOF
test_expect_equal_file EXPECTED OUTPUT
@@ -152,8 +152,8 @@ cat <<'EOF' >EXPECTED
#notmuch-dump batch-tag:3 config
#@ aaabefore beforeval
#@ key%20with%20spaces value,%20with,%20spaces%21
-#@ testkey1 testvalue1
-#@ testkey2 testvalue2
+#@ test.key1 testvalue1
+#@ test.key2 testvalue2
#@ zzzafter afterval
EOF
test_expect_equal_file EXPECTED OUTPUT
@@ -162,7 +162,7 @@ test_begin_subtest "restore config"
notmuch dump --include=config >EXPECTED
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
{
- EXPECT0(notmuch_database_set_config (db, "testkey1", "mutatedvalue"));
+ EXPECT0(notmuch_database_set_config (db, "test.key1", "mutatedvalue"));
}
EOF
notmuch restore --include=config <EXPECTED
--
2.29.2
next prev parent reply other threads:[~2020-12-20 12:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-20 12:10 v2 preliminaries for merged config David Bremner
2020-12-20 12:10 ` David Bremner [this message]
2020-12-20 12:10 ` [PATCH 2/6] lib: factor out feature name related code David Bremner
2020-12-20 12:10 ` [PATCH 3/6] lib: factor out prefix related code to its own file David Bremner
2020-12-20 15:36 ` Tomi Ollila
2020-12-20 20:03 ` David Bremner
2020-12-20 12:10 ` [PATCH 4/6] lib/config: delay setting talloc destructor David Bremner
2020-12-20 12:10 ` [PATCH 5/6] test: add regression test for searching with alternate config David Bremner
2020-12-20 12:10 ` [PATCH 6/6] lib: factor out notmuch_database_open* related code to own file David Bremner
2020-12-23 23:50 ` v2 preliminaries for merged config David Bremner
-- strict thread matches above, loose matches on Subject: below --
2020-08-12 22:49 David Bremner
2020-08-12 22:49 ` [PATCH 1/6] test: use keys with group 'test' in T590-libconfig David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201220121024.1122362-2-david@tethera.net \
--to=david@tethera.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).