[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#74385: [PATCH 1/4] srfi-64: Fix maybe-print-prop.
From: |
Tomas Volf |
Subject: |
bug#74385: [PATCH 1/4] srfi-64: Fix maybe-print-prop. |
Date: |
Sat, 16 Nov 2024 18:42:04 +0100 |
Previously it always printed the property, regardless of whether it was set or
not.
* module/srfi/srfi-64.scm (test-on-test-end-simple)[maybe-print-prop]:
Print only set properties.
---
module/srfi/srfi-64.scm | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/module/srfi/srfi-64.scm b/module/srfi/srfi-64.scm
index 98fcef645..13ae26d48 100644
--- a/module/srfi/srfi-64.scm
+++ b/module/srfi/srfi-64.scm
@@ -418,15 +418,16 @@ instead."
(define (test-on-test-end-simple runner)
"Log that test is done."
(define (maybe-print-prop prop pretty?)
- (let* ((val (test-result-ref runner prop))
- (val (string-trim-both
- (with-output-to-string
- (λ ()
- (if pretty?
- (pretty-print val #:per-line-prefix " ")
- (display val)))))))
- (when val
- (format #t "~a: ~a~%" prop val))))
+ (let* ((default (list))
+ (val (test-result-ref runner prop default)))
+ (unless (eq? val default)
+ (let ((val (string-trim-both
+ (with-output-to-string
+ (λ ()
+ (if pretty?
+ (pretty-print val #:per-line-prefix "
")
+ (display val)))))))
+ (format #t "~a: ~a~%" prop val)))))
(let ((result-kind (test-result-kind runner)))
;; Skip tests not executed due to run list.
--
2.46.0