Skip to content
Snippets Groups Projects
Commit 9278f28a authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

Tests: better support case-independent filesystems in assert-pathname-equal.

parent 0b0561a8
No related branches found
No related tags found
No related merge requests found
...@@ -167,8 +167,15 @@ Some constraints: ...@@ -167,8 +167,15 @@ Some constraints:
the other expression ~S yields that:~% ~S~% ~S~%" the other expression ~S yields that:~% ~S~% ~S~%"
qx x (pathname-components x) qx x (pathname-components x)
qy y (pathname-components y))) qy y (pathname-components y)))
;; accept equalp namestrings, to account for case-independent filesystems
((equalp (namestring x) (namestring y))
(warn "These two expressions yield pathnames that have equalp namestrings yet are not pathname-equal~%~
the first expression ~S yields this:~% ~S~% ~S~%
the other expression ~S yields that:~% ~S~% ~S~%"
qx x (pathname-components x)
qy y (pathname-components y)))
(t (t
(error "These two expressions yield paths that are not pathname-equal~%~ (error "These two expressions yield paths that are equal in any way:~%~
the first expression ~S yields this:~% ~S~% ~S~% the first expression ~S yields this:~% ~S~% ~S~%
the other expression ~S yields that:~% ~S~% ~S~%" the other expression ~S yields that:~% ~S~% ~S~%"
qx x (pathname-components x) qx x (pathname-components x)
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
:ensure-directory t)) :ensure-directory t))
(chdir *asdf-directory*) (chdir *asdf-directory*)
(assert (pathname-equal *asdf-directory* (getcwd))) (assert-pathname-equal *asdf-directory* (getcwd)))
(assert (pathname-equal *asdf-directory* (getcwd-from-run-program))) (assert-pathname-equal *asdf-directory* (getcwd-from-run-program)))
(assert (probe-file* "asdf.asd")) (assert (probe-file* "asdf.asd"))
(chdir *test-directory*) (chdir *test-directory*)
(assert (pathname-equal *test-directory* (getcwd))) (assert-pathname-equal *test-directory* (getcwd))
(assert (pathname-equal *test-directory* (getcwd-from-run-program))) (assert-pathname-equal *test-directory* (getcwd-from-run-program))
(assert (probe-file* "test-utilities.script")) (assert (probe-file* "test-utilities.script"))
(assert (assert
...@@ -280,10 +280,6 @@ ...@@ -280,10 +280,6 @@
(assert (not (base-string-p (strcat (basify "ab") #\c *last-char* (unbasify "d"))))) (assert (not (base-string-p (strcat (basify "ab") #\c *last-char* (unbasify "d")))))
(assert (base-string-p (strcat (basify "ab") #\c #\d)))) (assert (base-string-p (strcat (basify "ab") #\c #\d))))
(or #+os-windows ;; Avoid C:\Users vs C:\users on SBCL.
(equalp (namestring *test-directory*) (namestring (getcwd)))
(assert-pathname-equal *test-directory* (getcwd)))
(assert-equal +crlf+ (map 'string 'code-char '(13 10))) (assert-equal +crlf+ (map 'string 'code-char '(13 10)))
(assert-equal +lf+ (map 'string 'code-char '(10))) (assert-equal +lf+ (map 'string 'code-char '(10)))
(assert-equal +cr+ (map 'string 'code-char '(13))) (assert-equal +cr+ (map 'string 'code-char '(13)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment