static void
json_string (struct sprinter *sp, const char *val)
{
+ if (val == NULL)
+ val = "";
json_string_len (sp, val, strlen (val));
}
static void
text_string (struct sprinter *sp, const char *val)
{
+ if (val == NULL)
+ val = "";
text_string_len (sp, val, strlen (val));
}
* a list or map, followed or preceded by separators). For string
* and string_len, the char * must be UTF-8 encoded. string_len
* allows non-terminated strings and strings with embedded NULs
- * (though the handling of the latter is format-dependent).
+ * (though the handling of the latter is format-dependent). For
+ * string (but not string_len) the string pointer passed may be
+ * NULL.
*/
void (*string) (struct sprinter *, const char *);
void (*string_len) (struct sprinter *, const char *, size_t);
thread:XXX 1970-01-01 [1/1] Notmuch Test Suite; (inbox unread)"
test_begin_subtest "Search: json"
-test_subtest_known_broken
output=$(notmuch search --format=json '*' | notmuch_search_sanitize)
test_expect_equal_json "$output" '
[
\fmessage}"
test_begin_subtest "Show: json"
-test_subtest_known_broken
output=$(notmuch show --format=json '*' | notmuch_json_show_sanitize)
test_expect_equal_json "$output" '
[