Skip to content

Commit

Permalink
Improved test to allow lisp with versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
svetlyak40wt committed Jan 27, 2024
1 parent 4942d64 commit 64abaf9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test.ros
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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."
Expand Down

0 comments on commit 64abaf9

Please sign in to comment.