From 7a453716c27f09063e0bda56b9ba1d6b2cdd17b5 Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins Date: Fri, 6 May 2011 11:57:16 -0700 Subject: test: Move a test from search to search-output, and add a similar json test The "Search for non-existent message prints nothing" test fits better with the existing tests in search-output, so move it there. Also add a similar test for the --format=json case. These tests also use the new test_expect_equal_file function, (to ensure that the presence of a trailing newline is correctly tested). --- test/search-output | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/search-output') diff --git a/test/search-output b/test/search-output index 1554eb1e..8ba8acf7 100755 --- a/test/search-output +++ b/test/search-output @@ -304,4 +304,16 @@ cat <EXPECTED EOF test_expect_equal_file OUTPUT EXPECTED +test_begin_subtest "notmuch search for non-existent message prints nothing" +notmuch search "no-message-matches-this" > OUTPUT +echo -n >EXPECTED +test_expect_equal_file OUTPUT EXPECTED + +test_begin_subtest "notmuch search --format=json for non-existent message prints proper empty json" +notmuch search --format=json "no-message-matches-this" > OUTPUT +cat <EXPECTED +[] +EOF +test_expect_equal_file OUTPUT EXPECTED + test_done -- cgit v1.2.3