unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] srfi-64: fix double evaluation of test-name
@ 2021-04-02  7:20 Aleix Conchillo Flaqué
  2021-04-02  7:20 ` Aleix Conchillo Flaqué
  0 siblings, 1 reply; 6+ messages in thread
From: Aleix Conchillo Flaqué @ 2021-04-02  7:20 UTC (permalink / raw)
  To: guile-devel

Sorry about the extra noise. The original patch used spaces on the new
lines while testing.scm uses tabs.

Best,

Aleix




^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH] srfi-64: fix double evaluation of test-name
@ 2021-04-02  6:04 Aleix Conchillo Flaqué
  0 siblings, 0 replies; 6+ messages in thread
From: Aleix Conchillo Flaqué @ 2021-04-02  6:04 UTC (permalink / raw)
  To: guile-devel; +Cc: Aleix Conchillo Flaqué

* 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é <aconchillo@gmail.com>
---
 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..6a257323d 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




^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-30 15:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-02  7:20 [PATCH] srfi-64: fix double evaluation of test-name Aleix Conchillo Flaqué
2021-04-02  7:20 ` Aleix Conchillo Flaqué
2021-05-25 19:03   ` Aleix Conchillo Flaqué
2021-05-29 19:57     ` jakub-w
2021-05-30 15:25       ` Aleix Conchillo Flaqué
  -- strict thread matches above, loose matches on Subject: below --
2021-04-02  6:04 Aleix Conchillo Flaqué

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).