From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0r.migadu.com with LMTPS id QCR4GchBjWCYXwEALuJCtg (envelope-from ) for ; Sat, 01 May 2021 13:55:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id OBQIFchBjWCQcAAAbx9fmQ (envelope-from ) for ; Sat, 01 May 2021 11:55:52 +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)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D8F6E10E10 for ; Sat, 1 May 2021 13:55:51 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id CD2E5271F3; Sat, 1 May 2021 07:55:12 -0400 (EDT) Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by mail.notmuchmail.org (Postfix) with ESMTPS id BDBDF2758B for ; Sat, 1 May 2021 07:54:45 -0400 (EDT) Received: by mail-ot1-x329.google.com with SMTP id z25-20020a9d65d90000b02902a560806ca7so880329oth.11 for ; Sat, 01 May 2021 04:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wubm5B8nn+VROotDSHQKrUhBs1MKH3mS0bWk4Pp/Hio=; b=mGBLQnKq0O9x0PnpeSfUYSV56Sii6wfH701HSe98prcBjZYc1xRsltKNtOxiK6oIcO asD50bli8Bx6UvOcyEAMCXURKUJQ0D5E8et046wcvV8yYeIgVdTDB59yGcSciZFLH6La UO8ifrgd/b7JrThU9gTfyYt4MFwm2+5yCCfGtSQWZbuwlSVg3NPFDBq6C/bd5Qzp77Bh zM6xTjzJU05RQCFYU1yaQBxaoLoYPGxZMFn4ExTKxk5FQ6yjPeYKJu3rcZ4rqU/aSC3f scj0rjPK3PYSUMjAy6/clzQmRWgX6EoZTgbcJKyAdRY55uKH8Mfe+YsSmn2ySpHtM5Z1 J86Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wubm5B8nn+VROotDSHQKrUhBs1MKH3mS0bWk4Pp/Hio=; b=fwROnJRVGyyXgR65En9Hc4m89YexNzRZNXNGm2rbHxuZQ7PiVvgds5/PVk0e7pYEdR PhzABEqKJZ9L/Ti67phXuxWmGXVWvmPO8t0ozAZf+xnME/Ze1v0lz36msWbH07gBb1NM 1DGQt9kDaY4pNO99cftw/qidWMpx/EGu4rNZs9ToSyihaHVvK4nTpMKK1/x0SC3IeJto 8VmE4WLuJL0ixPCSdOPShbk000ZHZaY1b03vIBRx+bfaIebXBYQSh8BS+exmnWzcRdH4 jDR8hENitsT9lo1eH8lGUomBE7Tn/2+2maIr+2GLfibw53r4TCMtBxwHo4nbjvCFdwc9 Q4vw== X-Gm-Message-State: AOAM531V63jEbd7yOq/2X3A5JWSgUDmJqDi09AhsytZgnTEmle8X+Hkx GMWVYbvHntxVzKSPEeRK6Ir7YnvhCaYOrA== X-Google-Smtp-Source: ABdhPJzyFLmxzmYaqli/QbF8fmqqcET9VVRMeW/ArKxBRw7LgGMCv4OZdBHnIOYLos7oWNgXv5iEFg== X-Received: by 2002:a9d:875:: with SMTP id 108mr836119oty.22.1619870084573; Sat, 01 May 2021 04:54:44 -0700 (PDT) Received: from localhost ([2806:2f0:4060:638f:a2c5:89ff:fe0c:1151]) by smtp.gmail.com with ESMTPSA id z204sm923172oia.2.2021.05.01.04.54.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 May 2021 04:54:44 -0700 (PDT) From: Felipe Contreras To: notmuch@notmuchmail.org Subject: [PATCH 13/13] test: more style fixes Date: Sat, 1 May 2021 06:54:22 -0500 Message-Id: <20210501115422.483314-14-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210501115422.483314-1-felipe.contreras@gmail.com> References: <20210501115422.483314-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Message-ID-Hash: 7BKK45YVYT6CGBQ2BP6IMYVWIEV57IZK X-Message-ID-Hash: 7BKK45YVYT6CGBQ2BP6IMYVWIEV57IZK X-MailFrom: felipe.contreras@gmail.com 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 CC: Daniel Kahn Gillmor 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=1619870152; 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:dkim-signature; bh=1V4Tj1MJECwkVsilgNCAgjAZpnegOeweLacievn4sro=; b=Zz+T3lA43hWDjceUO3SzSBeopkYEvvrlMN6Zr+m+Z0jcPXredbZ2G5cshu8xCoAft9couu FU8WNM4fXsekrvB5K76gJ0iD6+6EjVEzHtuzL5DT2nimVx5mW6qfpMwxWRNJQo+0a2vEtP jB/+/ZHMJw+nB4q/01x8WC+fhJjVIdEvsaTIb7BvGscwkkxLxhuRJqndvsNY4InefwBEUu 7zMe24Gm2hycJPNn6ZJECoMq5sMSxy6s8zMs7eP+7UeT9mBlCwNFgEXO59Knlws8bMl0bt FEDaj0rfNTTW5gW0ou9yCYJVKkGHP8o1NkF2KnOoHT1zer1Sqw8/i2uYM1g7qQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619870152; a=rsa-sha256; cv=none; b=M8YqDyW4wPikxzDo6LHk5ZlQk3mWI1wS84Dzb4AIorv9qBiWmLe84xjSb1nmB3Q3r4l172 FrDEEqB5EBa/WSqciP9vl431z36l8j6ebBT+dp/pbQdUyCdlur3ZCf/Sawr11lSAfgy8ZJ IIMAfFOrsRoZn+iV0diXNxx2opyqJxdOudz5UuS0ndiXk9J8i9UTG7aor5/SP9l6xq5ONQ y1QWfUWdKCWRWAs6pXfrBPYMzVhE4CfomjUsQ4+bQiMzcxYEjIje3qvu+hHk3kKYkxLUIp oJhQ8gNNRQDQvOuhIu1c2zj6BQfQEi4tig840A0T8UmtKr/o3Asoq5xQpRCQog== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=mGBLQnKq; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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.96 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=mGBLQnKq; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: D8F6E10E10 X-Spam-Score: -0.96 X-Migadu-Scanner: scn0.migadu.com X-TUID: Mn88EwsN4k6Q In order to fit the git coding style. Signed-off-by: Felipe Contreras --- test/T140-excludes.sh | 3 +- test/T190-multipart.sh | 3 +- test/T490-parse-time-string.sh | 6 +-- test/export-dirs.sh | 3 +- test/test-lib-common.sh | 6 +-- test/test-lib-emacs.sh | 6 +-- test/test-lib.sh | 72 ++++++++++++---------------------- 7 files changed, 33 insertions(+), 66 deletions(-) diff --git a/test/T140-excludes.sh b/test/T140-excludes.sh index acab5381..352b3eb8 100755 --- a/test/T140-excludes.sh +++ b/test/T140-excludes.sh @@ -5,8 +5,7 @@ test_description='"notmuch search, count and show" with excludes in several vari # Generates a thread consisting of a top level message and 'length' # replies. The subject of the top message 'subject: top message" # and the subject of the nth reply in the thread is "subject: reply n" -generate_thread () -{ +generate_thread () { local subject="$1" local length="$2" generate_message '[subject]="'"${subject}: top message"'"' '[body]="'"body of top message"'"' diff --git a/test/T190-multipart.sh b/test/T190-multipart.sh index 6f715ff9..3545a599 100755 --- a/test/T190-multipart.sh +++ b/test/T190-multipart.sh @@ -725,8 +725,7 @@ EOF notmuch new > /dev/null -cat_expected_head () -{ +cat_expected_head () { cat < /dev/null } diff --git a/test/test-lib-emacs.sh b/test/test-lib-emacs.sh index bf875a28..dde32177 100644 --- a/test/test-lib-emacs.sh +++ b/test/test-lib-emacs.sh @@ -28,8 +28,7 @@ test_require_emacs () { # Accepts arbitrary extra emacs/elisp functions to modify the message # before sending, which is useful to doing things like attaching files # to the message and encrypting/signing. -emacs_deliver_message () -{ +emacs_deliver_message () { local subject body smtp_dummy_pid smtp_dummy_port subject="$1" body="$2" @@ -75,8 +74,7 @@ emacs_deliver_message () # If any GNU-style long-arguments (like --quiet or --decrypt=true) are # at the head of the argument list, they are sent directly to "notmuch # new" after message delivery -emacs_fcc_message () -{ +emacs_fcc_message () { local nmn_args subject body nmn_args='' while [[ "$1" =~ ^-- ]]; do diff --git a/test/test-lib.sh b/test/test-lib.sh index 1b502456..1d0178f0 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -114,8 +114,7 @@ unset ALTERNATE_EDITOR unset EMAIL unset NAME -add_gnupg_home () -{ +add_gnupg_home () { [ -e "${GNUPGHOME}/gpg.conf" ] && return _gnupg_exit () { gpgconf --kill all 2>/dev/null || true; } at_exit_function _gnupg_exit @@ -135,8 +134,7 @@ add_gnupg_home () printf '%s:6:\n' "$FINGERPRINT" | gpg --quiet --batch --no-tty --import-ownertrust } -add_gpgsm_home () -{ +add_gpgsm_home () { local fpr [ -e "$GNUPGHOME/gpgsm.conf" ] && return _gnupg_exit () { gpgconf --kill all 2>/dev/null || true; } @@ -268,8 +266,7 @@ then fi test_description_printed= -print_test_description () -{ +print_test_description () { test -z "$test_description_printed" || return 0 echo echo $this_test: "Testing ${test_description}" @@ -351,8 +348,7 @@ trap 'trap_signal' HUP INT TERM # history of the notmuch mailing list, which allows for reliably # testing commands that need to operate on a not-totally-trivial # number of messages. -add_email_corpus () -{ +add_email_corpus () { local corpus corpus=${1:-default} @@ -361,8 +357,7 @@ add_email_corpus () notmuch new >/dev/null || die "'notmuch new' failed while adding email corpus" } -test_begin_subtest () -{ +test_begin_subtest () { if [ -n "$inside_subtest" ]; then exec 1>&6 2>&7 # Restore stdout and stderr error "bug in test script: Missing test_expect_equal in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}" @@ -382,8 +377,7 @@ test_begin_subtest () # not accept a test name. Instead, the caller should call # test_begin_subtest before calling this function in order to set the # name. -test_expect_equal () -{ +test_expect_equal () { local output expected testname exec 1>&6 2>&7 # Restore stdout and stderr if [ -z "$inside_subtest" ]; then @@ -409,8 +403,7 @@ test_expect_equal () } # Like test_expect_equal, but takes two filenames. -test_expect_equal_file () -{ +test_expect_equal_file () { local file1 file2 testname basename1 basename2 exec 1>&6 2>&7 # Restore stdout and stderr if [ -z "$inside_subtest" ]; then @@ -491,19 +484,16 @@ test_json_nodes () { fi } -NOTMUCH_NEW () -{ +NOTMUCH_NEW () { notmuch new "${@}" | grep -v -E -e '^Processed [0-9]*( total)? file|Found [0-9]* total file' } -NOTMUCH_DUMP_TAGS () -{ +NOTMUCH_DUMP_TAGS () { # this relies on the default format being batch-tag, otherwise some tests will break notmuch dump --include=tags "${@}" | sed '/^#/d' | sort } -notmuch_drop_mail_headers () -{ +notmuch_drop_mail_headers () { $NOTMUCH_PYTHON -c ' import email, sys msg = email.message_from_file(sys.stdin) @@ -512,41 +502,34 @@ print(msg.as_string(False)) ' "$@" } -notmuch_exception_sanitize () -{ +notmuch_exception_sanitize () { perl -pe 's/(A Xapian exception occurred at .*[.]cc?):([0-9]*)/\1:XXX/' } -notmuch_search_sanitize () -{ +notmuch_search_sanitize () { perl -pe 's/("?thread"?: ?)("?)................("?)/\1\2XXX\3/' } -notmuch_search_files_sanitize () -{ +notmuch_search_files_sanitize () { notmuch_dir_sanitize } -notmuch_dir_sanitize () -{ +notmuch_dir_sanitize () { sed -e "s,$MAIL_DIR,MAIL_DIR," -e "s,${PWD},CWD,g" "$@" } NOTMUCH_SHOW_FILENAME_SQUELCH='s,filename:.*/mail,filename:/XXX/mail,' -notmuch_show_sanitize () -{ +notmuch_show_sanitize () { sed -e "$NOTMUCH_SHOW_FILENAME_SQUELCH" } -notmuch_show_sanitize_all () -{ +notmuch_show_sanitize_all () { sed \ -e 's| filename:.*| filename:XXXXX|' \ -e 's| id:[^ ]* | id:XXXXX |' | \ notmuch_date_sanitize } -notmuch_json_show_sanitize () -{ +notmuch_json_show_sanitize () { sed \ -e 's|"id": "[^"]*",|"id": "XXXXX",|g' \ -e 's|"Date": "Fri, 05 Jan 2001 [^"]*0000"|"Date": "GENERATED_DATE"|g' \ @@ -556,8 +539,7 @@ notmuch_json_show_sanitize () -e 's|"content-length": [1-9][0-9]*|"content-length": "NONZERO"|g' } -notmuch_emacs_error_sanitize () -{ +notmuch_emacs_error_sanitize () { local command command=$1 shift @@ -569,24 +551,20 @@ notmuch_emacs_error_sanitize () -e "s|^\(command: \)\{0,1\}/.*/$command|\1YYY/$command|" } -notmuch_date_sanitize () -{ +notmuch_date_sanitize () { sed \ -e 's/^Date: Fri, 05 Jan 2001 .*0000/Date: GENERATED_DATE/' } -notmuch_uuid_sanitize () -{ +notmuch_uuid_sanitize () { sed 's/[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}/UUID/g' } -notmuch_built_with_sanitize () -{ +notmuch_built_with_sanitize () { sed 's/^built_with[.]\(.*\)=.*$/built_with.\1=something/' } -notmuch_passwd_sanitize () -{ +notmuch_passwd_sanitize () { ${NOTMUCH_PYTHON} -c' import os, sys, pwd, socket @@ -606,13 +584,11 @@ for l in sys.stdin: ' } -notmuch_config_sanitize () -{ +notmuch_config_sanitize () { notmuch_dir_sanitize | notmuch_built_with_sanitize } -notmuch_show_part () -{ +notmuch_show_part () { awk '/^\014part}/{ f=0 }; { if (f) { print $0 } } /^\014part{ ID: '"$1"'/{ f=1 }' } -- 2.31.0