]> git.notmuchmail.org Git - notmuch/blobdiff - test/json
test: move utf-8 subject search test from json to search test script
[notmuch] / test / json
index 7fe2a27a8d6479bfd32c0d03b1c68b23ff7bf26f..0badb1d237c9e0ae71cbd7d6bbbdb32b68aba76f 100755 (executable)
--- 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