X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=test%2FT160-json.sh;h=6a3e581284ed8796e931d7ec5dbe6bc41a480748;hb=d9a2b900b6525874b913276af91840983d81b3f1;hp=004adb4ee4dfe53695a34de8e3dabad8770cffed;hpb=4cb789aa090fb6ba3c7897584ecbcc0a547b2f81;p=notmuch diff --git a/test/T160-json.sh b/test/T160-json.sh index 004adb4e..6a3e5812 100755 --- a/test/T160-json.sh +++ b/test/T160-json.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash test_description="--format=json output" . $(dirname "$0")/test-lib.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 test_begin_subtest "Show message: json" add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[bcc]=\"test_suite+bcc@notmuchmail.org\"" "[reply-to]=\"test_suite+replyto@notmuchmail.org\"" "[body]=\"json-show-message\"" @@ -64,6 +65,23 @@ test_expect_equal_json "$output" "[{\"thread\": \"XXX\", \"tags\": [\"inbox\", \"unread\"]}]" +test_begin_subtest "Search message: json, 64-bit timestamp" +if [ $NOTMUCH_HAVE_64BIT_TIME_T -ne 1 ]; then + test_subtest_known_broken +fi +add_message "[subject]=\"json-search-64bit-timestamp-subject\"" "[date]=\"Tue, 01 Jan 2999 12:00:00 -0000\"" "[body]=\"json-search-64bit-timestamp-message\"" +output=$(notmuch search --format=json "json-search-64bit-timestamp-message" | notmuch_search_sanitize) +test_expect_equal_json "$output" "[{\"thread\": \"XXX\", + \"timestamp\": 32472187200, + \"date_relative\": \"the future\", + \"matched\": 1, + \"total\": 1, + \"authors\": \"Notmuch Test Suite\", + \"subject\": \"json-search-64bit-timestamp-subject\", + \"query\": [\"id:$gen_msg_id\", null], + \"tags\": [\"inbox\", + \"unread\"]}]" + test_begin_subtest "Format version: too low" test_expect_code 20 "notmuch search --format-version=0 \\*"