about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2025-09-30 18:56:43 +0100
committerArun Isaac2025-10-01 16:34:42 +0100
commit0b0b57d94d4f84805b86d4184aa1598c0d47f7d2 (patch)
treed253fa6548e4132f0cf004d8d3aa837ff52859f1
parentb6070420b2f4ef96a3f73987389b66aa0bbb1e7b (diff)
downloadrun64-0b0b57d94d4f84805b86d4184aa1598c0d47f7d2.tar.gz
run64-0b0b57d94d4f84805b86d4184aa1598c0d47f7d2.tar.lz
run64-0b0b57d94d4f84805b86d4184aa1598c0d47f7d2.zip
bin: Use (chibi match) instead of cdr.
-rwxr-xr-xbin/run6420
1 files changed, 15 insertions, 5 deletions
diff --git a/bin/run64 b/bin/run64
index 5334084..3e355bf 100755
--- a/bin/run64
+++ b/bin/run64
@@ -1,7 +1,7 @@
 #!r6rs
 ;;; -*- mode: scheme -*-
 ;;; run64 --- SRFI-64 test runner
-;;; Copyright © 2022 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2022, 2025 Arun Isaac <arunisaac@systemreboot.net>
 ;;;
 ;;; This file is part of run64.
 ;;;
@@ -18,12 +18,20 @@
 ;;; You should have received a copy of the GNU General Public License
 ;;; along with run64.  If not, see <https://www.gnu.org/licenses/>.
 
-(import (rnrs programs)
+(import (rnrs exceptions)
+        (rnrs programs)
         (srfi srfi-1)
-        (srfi srfi-64))
+        (srfi srfi-64)
+        ;; We prefix (chibi match) imports with chibi: so as to not
+        ;; conflict with match bindings provided by the
+        ;; implementation. We should find a better solution, if at all
+        ;; possible.
+        (prefix (chibi match) chibi:))
 
 (define (assq-ref alist key)
-  (cdr (assq key alist)))
+  (chibi:match (assq key alist)
+    ((_ . value) value)
+    (#f #f)))
 
 (define (color code str)
   (string-append (string #\esc)
@@ -90,7 +98,9 @@ given string in an ANSI escape code."
   (let ((runner (make-runner)))
     (headline "test session starts" bold)
     (test-with-runner runner
-      (for-each load (cdr args)))
+      (for-each load
+                (chibi:match args
+                  ((_ files ...) files))))
     (newline)
     (unless (zero? (test-runner-fail-count runner))
       (headline "FAILURES" red)