From 64abaf9ef1fd7d141b74152a93bc587fb9fde517 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Sat, 27 Jan 2024 14:33:16 +0300 Subject: [PATCH] Improved test to allow lisp with versions. --- test.ros | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test.ros b/test.ros index 4374b2c..16d9ece 100755 --- a/test.ros +++ b/test.ros @@ -29,6 +29,13 @@ exec ros -Q -- $0 "$@" ("ecl" . "ECL"))) +(defun cut-before (char text) + (let ((pos (position char text))) + (if pos + (subseq text 0 pos) + text))) + + (defun main (&rest argv) (declare (ignorable argv)) (handler-bind ((error (lambda (c) @@ -41,7 +48,8 @@ exec ros -Q -- $0 "$@" (unless needed-lisp (error "Env variable LISP was not set.")) - (let ((expected (cdr (assoc needed-lisp *lisps* :test #'string-equal))) + (let ((expected (or (cdr (assoc needed-lisp *lisps* :test #'string-equal)) + (cdr (assoc (cut-before #\/ needed-lisp) *lisps* :test #'string-equal)))) (real-implementation (lisp-implementation-type))) (unless expected (error "This test does not support LISP=~A. The real-implementation=~A."