Raymond Toy pushed to branch issue-193-nil-unspecific-equivalent at cmucl / cmucl
Commits: c487a6cf by Raymond Toy at 2023-04-29T18:53:42-07:00 Treat NIL, :NEWEST, and :UNSPECIFIC as equivalent for :version
Add tests for this too.
- - - - -
2 changed files:
- src/code/pathname.lisp - tests/issues.lisp
Changes:
===================================== src/code/pathname.lisp ===================================== @@ -505,11 +505,13 @@ (eq that :unspecific)))))))
;; Compare the version component. We treat NIL to be EQUAL to -;; :NEWEST. +;; :NEWEST or :UNSPECIFIC. (defun compare-version-component (this that) (or (eql this that) - (and (null this) (eq that :newest)) - (and (null that) (eq this :newest)))) + (if (and (member this '(nil :newest :unspecific) :test #'eq) + (member that '(nil :newest :unspecific) :test #'eq)) + t + nil))) ;;;; Pathname functions.
===================================== tests/issues.lisp ===================================== @@ -962,3 +962,18 @@ (make-pathname :type nil))) (assert-true (equal (make-pathname :type nil) (make-pathname :type :unspecific)))) + +(define-test issue.192.version + (assert-true (equal (make-pathname :version :newest) + (make-pathname :version nil))) + (assert-true (equal (make-pathname :version nil) + (make-pathname :version :newest))) + (assert-true (equal (make-pathname :version :unspecific) + (make-pathname :version nil))) + (assert-true (equal (make-pathname :version nil) + (make-pathname :version :unspecific))) + (assert-true (equal (make-pathname :version :unspecific) + (make-pathname :version :newest))) + (assert-true (equal (make-pathname :version :newest) + (make-pathname :version :unspecific))) +)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/c487a6cf06ef73aaa361fe08...