X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2Fjson;h=0badb1d237c9e0ae71cbd7d6bbbdb32b68aba76f;hp=7fe2a27a8d6479bfd32c0d03b1c68b23ff7bf26f;hb=7fdeb0fb630da0eac355f3c6538f01dba932c5e6;hpb=44ea57a0d10ddab514abea319c4d25ec4e36b51e diff --git a/test/json b/test/json index 7fe2a27a..0badb1d2 100755 --- a/test/json +++ b/test/json @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash test_description="--format=json output" . ./test-lib.sh @@ -18,11 +18,6 @@ test_expect_equal "$output" "[{\"thread\": \"XXX\", \"subject\": \"json-search-subject\", \"tags\": [\"inbox\", \"unread\"]}]" -test_begin_subtest "Search by subject (utf-8):" -add_message [subject]=utf8-sübjéct "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" -output=$(notmuch search subject:utf8-sübjéct | notmuch_search_sanitize) -test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; utf8-sübjéct (inbox unread)" - test_begin_subtest "Show message: json, utf-8" add_message "[subject]=\"json-show-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"jsön-show-méssage\"" output=$(notmuch show --format=json "jsön-show-méssage") @@ -39,4 +34,8 @@ test_expect_equal "$output" "[{\"thread\": \"XXX\", \"subject\": \"json-search-utf8-body-sübjéct\", \"tags\": [\"inbox\", \"unread\"]}]" +test_begin_subtest "Search returning no messages" +output=$(notmuch search --format=json "this string had better not match any messages" | notmuch_search_sanitize) +test_expect_equal "$output" "[]" + test_done