From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Newsgroups: gmane.lisp.guile.devel Subject: [PATCH] srfi-64: fix double evaluation of test-name Date: Fri, 2 Apr 2021 00:20:33 -0700 Message-ID: <20210402072033.65809-2-aconchillo@gmail.com> References: <20210402072033.65809-1-aconchillo@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36056"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Fri Apr 02 09:21:52 2021 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lSE7s-0009FO-KI for guile-devel@m.gmane-mx.org; Fri, 02 Apr 2021 09:21:52 +0200 Original-Received: from localhost ([::1]:54074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSE7r-0001Dy-LG for guile-devel@m.gmane-mx.org; Fri, 02 Apr 2021 03:21:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSE7h-0001Dk-0U for guile-devel@gnu.org; Fri, 02 Apr 2021 03:21:41 -0400 Original-Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:35423) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lSE7c-0002ww-JS for guile-devel@gnu.org; Fri, 02 Apr 2021 03:21:40 -0400 Original-Received: by mail-pl1-x633.google.com with SMTP id e14so2176759plj.2 for ; Fri, 02 Apr 2021 00:21:35 -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=fkLXXvUD7Yw4WOHrffepQtnPt5lgJh9zx9URj6nu7xw=; b=VL7ZIoVo26136LsvyXpsYCHyokPNvRh5qFeYYhynprTst45iEOEkRdYAnIk9KCCUNw 0zn4doY/QvlTf1iMwUUnAKMcB8DfQ+YMtQXrsejyGeFBHkixKBMbhrv+IUxpgfMlNyWk oULieepYnxSTGieHhDzJWHyxMIYmydGgvQVXBDTIMENov4i873eN4cszRBfSQBt3xRGX JSWsqoR4ujLuj6qh0FKXhrYbl+X/Ht8hZINzNV+MOvUV00BsBO49sbHbyc3MOkMN9Z3w Inj+zII4dumX644O8As0+GG63Anq1WRJV2So1WWRanL8uRye8G1S4iTLGlCf1T/3y8+H IQAw== 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=fkLXXvUD7Yw4WOHrffepQtnPt5lgJh9zx9URj6nu7xw=; b=qgmaTSSIJGtjCUGba8dVlc1OiwUxj6esBOP2r5vgj9V3CqA5DUuBzrgZW2RX8sgbhp TXApSr6b3S9NACt9e73IdAmLbmkRYvrlfTpjhn7PsmASpisIyqDeAmwd/ap7nDEuBClz v2neCuiojsJTwgOWZHBZ9LzmZyq+rPeeDPLJEKZ/e0vOL3/H8ISF2/fC1PSRwpWg2trV vKCwUtYTpqCKecroWTM2HAqoSTWypXec5UHr/DF2Cv1qCjqfg2TGUH5a4Ng4MDHMwFjZ YAGtY9LmhXzUKPz0GJYTDNAi842mUXfcGPySwZdUmwdF0hydyYjXv9ISMSVAZ6sdT3k0 +3iw== X-Gm-Message-State: AOAM533UNA7w8lrKF5DRYMiehP7ejXGSzMscJkj5ZXpFc0FhPsr5Rgml zl7g/tSHzip8XdRgnN+LjVGE2DfIH9s= X-Google-Smtp-Source: ABdhPJyItSp5+TmzRFtHxzssXM7Y18K8GtAfygvXDrXcV9ccXATFTQ6k8Zq0OWo7DC6pibsGqP48SQ== X-Received: by 2002:a17:902:8303:b029:e6:4ef3:4f17 with SMTP id bd3-20020a1709028303b02900e64ef34f17mr11268870plb.22.1617348094563; Fri, 02 Apr 2021 00:21:34 -0700 (PDT) Original-Received: from localhost (cpe-75-82-162-230.socal.res.rr.com. [75.82.162.230]) by smtp.gmail.com with ESMTPSA id kk6sm7221774pjb.51.2021.04.02.00.21.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Apr 2021 00:21:34 -0700 (PDT) X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210402072033.65809-1-aconchillo@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=aconchillo@gmail.com; helo=mail-pl1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20726 Archived-At: * module/srfi/srfi-64/testing.scm: fix double test-name evaluation which also fix unused variable warnings as a bonus. Signed-off-by: Aleix Conchillo FlaquƩ --- module/srfi/srfi-64/testing.scm | 36 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/module/srfi/srfi-64/testing.scm b/module/srfi/srfi-64/testing.scm index 37792cd0f..4237a5614 100644 --- a/module/srfi/srfi-64/testing.scm +++ b/module/srfi/srfi-64/testing.scm @@ -707,9 +707,9 @@ (syntax-case (list x (list (syntax quote) (%test-source-line2 x))) () (((mac tname expr) line) (syntax - (let* ((r (test-runner-get)) - (name tname)) - (test-result-alist! r (cons (cons 'test-name tname) line)) + (let* ((name tname) + (r (test-runner-get))) + (test-result-alist! r (cons (cons 'test-name name) line)) (%test-comp1body r expr)))) (((mac expr) line) (syntax @@ -720,9 +720,9 @@ (syntax-case (list x (list (syntax quote) (%test-source-line2 x)) comp) () (((mac tname expected expr) line comp) (syntax - (let* ((r (test-runner-get)) - (name tname)) - (test-result-alist! r (cons (cons 'test-name tname) line)) + (let* ((name tname) + (r (test-runner-get))) + (test-result-alist! r (cons (cons 'test-name name) line)) (%test-comp2body r comp expected expr)))) (((mac expected expr) line comp) (syntax @@ -740,9 +740,9 @@ (syntax-case (list x (list (syntax quote) (%test-source-line2 x))) () (((mac tname expected expr error) line) (syntax - (let* ((r (test-runner-get)) - (name tname)) - (test-result-alist! r (cons (cons 'test-name tname) line)) + (let* ((name tname) + (r (test-runner-get))) + (test-result-alist! r (cons (cons 'test-name name) line)) (%test-comp2body r (%test-approximate= error) expected expr)))) (((mac expected expr error) line) (syntax @@ -759,9 +759,9 @@ (define-syntax test-assert (syntax-rules () ((test-assert tname test-expression) - (let* ((r (test-runner-get)) - (name tname)) - (test-result-alist! r '((test-name . tname))) + (let* ((name tname) + (r (test-runner-get))) + (test-result-alist! r '((test-name . name))) (%test-comp1body r test-expression))) ((test-assert test-expression) (let* ((r (test-runner-get))) @@ -770,9 +770,9 @@ (define-syntax %test-comp2 (syntax-rules () ((%test-comp2 comp tname expected expr) - (let* ((r (test-runner-get)) - (name tname)) - (test-result-alist! r (list (cons 'test-name tname))) + (let* ((name tname) + (r (test-runner-get))) + (test-result-alist! r (list (cons 'test-name name))) (%test-comp2body r comp expected expr))) ((%test-comp2 comp expected expr) (let* ((r (test-runner-get))) @@ -895,9 +895,9 @@ (syntax-case (list x (list (syntax quote) (%test-source-line2 x))) () (((mac tname etype expr) line) (syntax - (let* ((r (test-runner-get)) - (name tname)) - (test-result-alist! r (cons (cons 'test-name tname) line)) + (let* ((name tname) + (r (test-runner-get))) + (test-result-alist! r (cons (cons 'test-name name) line)) (%test-error r etype expr)))) (((mac etype expr) line) (syntax -- 2.31.1