From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sDJGLMYKCGGE7wAAgWs5BA (envelope-from ) for ; Mon, 02 Aug 2021 17:09:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id cJX1J8YKCGHvawAAB5/wlQ (envelope-from ) for ; Mon, 02 Aug 2021 15:09:58 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DD4477A14 for ; Mon, 2 Aug 2021 17:09:57 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 79D0F2C056; Mon, 2 Aug 2021 11:09:41 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id A718C2C040 for ; Mon, 2 Aug 2021 11:09:34 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 7A1395FD5C; Mon, 2 Aug 2021 11:09:34 -0400 (EDT) Received: (nullmailer pid 3234754 invoked by uid 1000); Mon, 02 Aug 2021 15:09:30 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: David Bremner Subject: [PATCH 5/8] test/path-config: use test_expect_equal_file_nonempty Date: Mon, 2 Aug 2021 12:09:19 -0300 Message-Id: <20210802150922.3234616-6-david@tethera.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210802150922.3234616-1-david@tethera.net> References: <87bl9lx864.fsf@kisara.moe> <20210802150922.3234616-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: U2ANEKP6C3FOJTTQ7MMUXN677L5ZFQRP X-Message-ID-Hash: U2ANEKP6C3FOJTTQ7MMUXN677L5ZFQRP X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1627916998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=YM2pNQPDm4Tl3HE4YxA3ysvvL9Kl8ydCMhNHKYuStHo=; b=GU/SZN99s1qdw38SYQdKsm7GKUs+8fLxZNGVG+jlm7hUb5FGzvn13ouf/R45FytE+Rkxns 60LGta87i7pRMZQCPgmo5l396IHmlyhaM2CYHVhcf9mQA33PJIc6TO86rqIRgby6rumL5y Zq4PgCbX2f4z4l7GoqbmCbwWt5bjHZ/e3TnOxTEa+Kfr96vrOnbcdubfTuUn38iWSgXkki qE31smfqgOTRTw+JgoRaMIF6lxXMdAd9264QoNdlkXOGhiSQvh+miECWPI2uZXi9mkplhS v6tgo4XI5Q467yeJfuJeT78ze9yYux2wPH59Se9YvXLA7C+YTQnGM1fWpTA57g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627916998; a=rsa-sha256; cv=none; b=MSPYWpl4rQSX7lzaB8mOMVhBwYSwnLDKLacVRLRTzEWcyJzQwlBUJlH1dfQpHGLxiP+7Ss 10HdKBUu9xVMiRmow3clRVY36OqK/DQkDN8jk3lV2mRkFAbTMJA9UotuZS1t1ZpUkUxPHA M0XoN4/AJZ6T+jubyTm1iZnpkA3oc2SR3S82gUg0oO5Cz0kjp28ZFZz8jqmNbVSFzWeN3K M4aqxv/RoccanStCnT9tf8Umtco3pZf/D3MxVHBZ4A6IFLV+sUTOAvg8IeGQ629ixWGBz+ 97WOby1NjeeZFKdCoMVG98nagY7WfYYIty5eyoSOBWSRkbmwjbirw+v0Z/QdmQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 0.53 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: DD4477A14 X-Spam-Score: 0.53 X-Migadu-Scanner: scn1.migadu.com X-TUID: wgLac9ncv8k+ This is more robust against crashes when the expected output is also generated by notmuch. In the case where the expected output is explicit, it seems like overkill. --- test/T055-path-config.sh | 11 +++++------ test/test-lib.sh | 1 + 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh index 2061b116..035276c2 100755 --- a/test/T055-path-config.sh +++ b/test/T055-path-config.sh @@ -151,13 +151,13 @@ EOF notmuch tag -inbox '*' notmuch restore < EXPECTED notmuch dump > OUTPUT - test_expect_equal_file EXPECTED OUTPUT + test_expect_equal_file_nonempty EXPECTED OUTPUT config_subtest "reindex" "$config" notmuch search --output=messages '*' > EXPECTED notmuch reindex '*' notmuch search --output=messages '*' > OUTPUT - test_expect_equal_file EXPECTED OUTPUT + test_expect_equal_file_nonempty EXPECTED OUTPUT config_subtest "use existing database" "$config" output=$(notmuch new) @@ -179,7 +179,7 @@ EOF config_subtest "Show a raw message" "$config" add_message notmuch show --format=raw id:$gen_msg_id > OUTPUT - test_expect_equal_file $gen_msg_filename OUTPUT + test_expect_equal_file_nonempty $gen_msg_filename OUTPUT rm -f $gen_msg_filename config_subtest "reply" "$config" @@ -208,14 +208,13 @@ EOF mkdir -p "$MAIL_DIR"/{cur,new,tmp} notmuch insert < "$gen_msg_filename" cur_msg_filename=$(notmuch search --output=files "subject:insert-subject") - test_expect_equal_file "$cur_msg_filename" "$gen_msg_filename" - + test_expect_equal_file_nonempty "$cur_msg_filename" "$gen_msg_filename" config_subtest "compact+search" "$config" notmuch search --output=messages '*' | sort > EXPECTED notmuch compact notmuch search --output=messages '*' | sort > OUTPUT - test_expect_equal_file EXPECTED OUTPUT + test_expect_equal_file_nonempty EXPECTED OUTPUT config_subtest "upgrade backup" "$config" features=$(xapian-metadata get $XAPIAN_PATH features | grep -v "^relative directory paths") diff --git a/test/test-lib.sh b/test/test-lib.sh index 4865032d..94f9d605 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -447,6 +447,7 @@ test_expect_equal_file_nonempty () { for file in "$1" "$2"; do if [ ! -s "$file" ]; then test_failure_ "Missing or zero length file: $file" + return $? fi done -- 2.30.2