Changeset 15437
- Timestamp:
- 10/29/20 16:54:30 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/test/lisp/abcl/jar-pathname.lisp
r15399 r15437 108 108 (setf *tmp-jar-path-whitespace* 109 109 (merge-pathnames "baz.jar" *tmp-directory-whitespace*)) 110 (cl-fad-copy-file *tmp-jar-path* *tmp-jar-path-whitespace* )))110 (cl-fad-copy-file *tmp-jar-path* *tmp-jar-path-whitespace* :overwrite t))) 111 111 (values *tmp-jar-path* *tmp-jar-path-whitespace*)) 112 112 … … 123 123 124 124 (defun load-from-jar (jar entry) 125 (load (merge-jar-entry jar entry))) 126 127 (defun merge-jar-entry (jar entry) 125 128 (let ((jar-pathname (if (ext:pathname-jar-p jar) 126 129 jar 127 130 (make-pathname :device (list jar))))) 128 (load (merge-pathnames entry jar-pathname)))) 129 130 (deftest jar-pathname.load.1 131 (with-jar-file-init 132 (load-from-jar *tmp-jar-path* "__loader__._")) 133 t) 134 135 ;; Needs nested jars implementation 136 (pushnew 'jar-pathname.load.2 *expected-failures*) 131 (merge-pathnames entry jar-pathname))) 132 133 137 134 (deftest jar-pathname.load.2 138 135 (with-jar-file-init … … 140 137 t) 141 138 142 ;; Needs nested jars implementation143 (pushnew 'jar-pathname.load.3 *expected-failures*)144 139 (deftest jar-pathname.load.3 145 140 (with-jar-file-init 146 (load-from-jar *tmp-jar-path* "bar.abcl"))141 (load-from-jar *tmp-jar-path* "bar.abcl")) 147 142 t) 148 143 149 144 (deftest jar-pathname.load.4 150 145 (with-jar-file-init 151 (load-from-jar *tmp-jar-path* "eek"))146 (load-from-jar *tmp-jar-path* "eek")) 152 147 t) 153 148 … … 163 158 t) 164 159 165 ;; Needs nested jars implementation166 (pushnew 'jar-pathname.load.7 *expected-failures*)167 160 (deftest jar-pathname.load.7 168 161 (with-jar-file-init … … 170 163 t) 171 164 172 ;; Needs nested jars implementation173 (pushnew 'jar-pathname.load.8 *expected-failures*)174 165 (deftest jar-pathname.load.8 175 166 (with-jar-file-init … … 184 175 (deftest jar-pathname.load.10 185 176 (with-jar-file-init 186 (load-from-jar *tmp-jar-path* "a/b/eek.lisp")) 187 t) 188 189 ;; Needs nested jars implementation 190 (pushnew 'jar-pathname.load.11 *expected-failures*) 177 (load-from-jar *tmp-jar-path* "a/b/eek.lisp")) 178 t) 179 191 180 (deftest jar-pathname.load.11 192 181 (with-jar-file-init … … 194 183 t) 195 184 196 ;; Needs nested jars implementation 197 (pushnew 'jar-pathname.load.12 *expected-failures*) 185 186 #+(or) ;; URI encodings in namestring are not currently interpolated 198 187 (deftest jar-pathname.load.12 199 (with-jar-file-init 200 (load-from-jar *tmp-jar-path* "a/b/foo%20bar.abcl")) 201 t) 202 203 ;; Needs nested jars implementation 204 (pushnew 'jar-pathname.load.13 *expected-failures*) 188 (with-jar-file-init 189 (load-from-jar *tmp-jar-path* "a/b/foo%20bar.abcl")) 190 t) 191 205 192 (deftest jar-pathname.load.13 206 (signals-error 207 (load-from-jar *tmp-jar-path* "a/b/foo bar.abcl") 208 'error) 193 (with-jar-file-init 194 (load-from-jar *tmp-jar-path* "a/b/foo bar.abcl")) 209 195 t) 210 196 … … 219 205 t) 220 206 221 ;; Needs nested jars implementation 222 (pushnew 'jar-pathname.load.16 *expected-failures*) 207 #+(or) ;; URI encodings in namestring are not currently interpolated 223 208 (deftest jar-pathname.load.16 224 209 (load-from-jar *tmp-jar-path-whitespace* "a/b/foo%20bar.abcl") … … 229 214 230 215 (deftest jar-pathname.url.https.1 231 (equalp 232 *url-jar-pathname-base* 233 (probe-file *url-jar-pathname-base*)) 234 t) 235 216 (equalp 217 *url-jar-pathname-base* 218 (probe-file *url-jar-pathname-base*)) 219 t) 220 221 (deftest jar-pathname.url.https.2 222 (namestring (merge-pathnames "**" "jar:https://abcl.org/releases/1.7.1/abcl-contrib.jar!/")) 223 "jar:https://abcl.org/releases/1.7.1/abcl-contrib.jar!/**") 224 225 (deftest jar-pathname.url.https.3 226 (not (null (probe-file #p"jar:https://abcl.org/releases/1.7.1/abcl-contrib.jar!/README.markdown"))) 227 t) 228 229 (deftest jar-pathname.url.https.4 230 (< 1 (length (directory #p"jar:https://abcl.org/releases/1.7.1/abcl-contrib.jar!/**/"))) 231 t) 232 236 233 (deftest jar-pathname.probe-file.1 237 (with-jar-file-init 238 (let ((p 239 (merge-pathnames "eek.lisp" 240 (make-pathname :device (list *tmp-jar-path*))))) 234 (with-jar-file-init 235 (let ((p (merge-jar-entry *tmp-jar-path* "eek.lisp"))) 236 (not (null (probe-file p))))) 237 t) 238 239 (deftest jar-pathname.probe-file.2 240 (with-jar-file-init 241 (let ((p (merge-jar-entry *tmp-jar-path* "a/b/bar.abcl"))) 241 242 (not (null (probe-file p))))) 242 243 t) 243 244 244 (deftest jar-pathname.probe-file.2245 (with-jar-file-init246 (let ((p247 (merge-pathnames "a/b/bar.abcl"248 (make-pathname :device (list *tmp-jar-path*)))))249 (not (null (probe-file p)))))250 t)251 252 #+(or) ;; needs nested pathnames253 245 (deftest jar-pathname.probe-file.3 254 (let ((result 255 (with-jar-file-init 256 (probe-file "jar:jar:file:baz.jar!/a/b/bar.abcl!/bar._")))) 257 (string= 258 (if result (namestring result) "") 259 (format nil "jar:jar:file:~Abaz.jar!/a/b/bar.abcl!/bar._" 260 (namestring *tmp-directory*)))) 246 (with-jar-file-init 247 (let ((p (make-pathname :device (list (pathname *tmp-jar-path*) #p"a/b/bar.abcl") 248 :directory '(:absolute) 249 :name "bar_1" 250 :type "cls"))) 251 (not (null (probe-file p))))) 261 252 t) 262 253 263 254 (deftest jar-pathname.probe-file.4 264 255 (with-jar-file-init 265 (let ((p 266 (merge-pathnames "a/b/bar.abcl" 267 (make-pathname :device (list *tmp-jar-path*))))) 256 (let ((p (merge-jar-entry *tmp-jar-path* "a/b/bar.abcl"))) 257 (not (null (probe-file p))))) 258 t) 259 260 (deftest jar-pathname.probe-file.5 261 (with-jar-file-init 262 (let ((p (merge-jar-entry *tmp-jar-path* "a/b/" ))) 268 263 (not (null (probe-file p))))) 269 264 t) 270 265 271 (deftest jar-pathname.probe-file.5 272 (with-jar-file-init 273 (let ((p 274 (merge-pathnames "a/b/" 275 (make-pathname :device (list *tmp-jar-path*))))) 266 (deftest jar-pathname.probe-file.6 267 (with-jar-file-init 268 (let ((p (merge-jar-entry *tmp-jar-path* "d/e+f/bar.abcl"))) 276 269 (not (null (probe-file p))))) 277 270 t) 278 271 279 280 (deftest jar-pathname.probe-file.6 281 (with-jar-file-init 282 (let ((p 283 (merge-pathnames "d/e+f/bar.abcl/" 284 (make-pathname :device (list *tmp-jar-path*))))) 285 (not (null (probe-file p))))) 286 t) 287 288 272 (deftest jar-pathname.probe-file.7 273 (with-jar-file-init 274 (not (null (probe-file (merge-jar-entry *tmp-jar-path* "__loader__._"))))) 275 t) 276 277 278 #+(or) ;; abcl-1.8.0 behavior is not to merge absolute pathname with JAR-PATHNAME defaults 289 279 (deftest jar-pathname.merge-pathnames.1 290 (merge-pathnames 291 "/bar.abcl" #p"jar:file:/baz.jar!/foo") 280 (merge-pathnames "/bar.abcl" #p"jar:file:/baz.jar!/foo") 292 281 #p"jar:file:/baz.jar!/bar.abcl") 293 282 294 283 (deftest jar-pathname.merge-pathnames.2 295 (merge-pathnames 296 "bar.abcl" #p"jar:file:/baz.jar!/foo/baz") 297 #p"jar:file:/baz.jar!/foo/bar.abcl") 284 (namestring (merge-pathnames "bar.abcl" #p"jar:file:///baz.jar!/foo/baz")) 285 "jar:file:///baz.jar!/foo/bar.abcl") 298 286 299 287 (deftest jar-pathname.merge-pathnames.3 300 (merge-pathnames 301 "jar:file:/baz.jar!/foo" "bar") 302 #p"jar:file:/baz.jar!/foo") 288 (namestring (merge-pathnames "jar:file:///baz.jar!/foo" "bar")) 289 "jar:file:///baz.jar!/foo") 303 290 304 291 (deftest jar-pathname.merge-pathnames.4 305 (merge-pathnames 306 "jar:file:/baz.jar!/foo" "/a/b/c") 307 #p"jar:file:/a/b/baz.jar!/foo") 292 (namestring (merge-pathnames "jar:file:///baz.jar!/foo" "/a/b/c")) 293 "jar:file:///baz.jar!/foo") 308 294 309 295 ;;; Under win32, we get the device in the merged path … … 311 297 (push 'jar-pathname.merge-pathnames.5 *expected-failures*) 312 298 (deftest jar-pathname.merge-pathnames.5 313 ( merge-pathnames "jar:file:/a/b/c/foo.jar!/bar/baz.lisp")314 #p"jar:file:/a/b/c/foo.jar!/bar/baz.lisp")299 (namestring (merge-pathnames "jar:file:///a/b/c/foo.jar!/bar/baz.lisp")) 300 "jar:file:///a/b/c/foo.jar!/bar/baz.lisp") 315 301 316 302 (deftest jar-pathname.truename.1 … … 345 331 "foo" "abcl") 346 332 347 #+(or) ;;; FIXME 'Nested Jar URLs are not supported' regression from abcl-1.5.0348 333 (deftest jar-pathname.4 349 334 (let* ((p #p"jar:jar:file:a/baz.jar!/b/c/foo.abcl!/this/that/foo-20.cls") … … 358 343 (:absolute "this" "that") "foo-20" "cls") 359 344 360 #+(or) ;;; FIXME 'Nested Jar URLs are not supported' regression from abcl-1.5.0361 345 (deftest jar-pathname.5 362 346 (let* ((p #p"jar:jar:file:a/foo/baz.jar!/b/c/foo.abcl!/armed/bear/bar-1.cls") … … 371 355 (:absolute "armed" "bear") "bar-1" "cls") 372 356 373 #+(or) ;;; FIXME 'Nested Jar URLs are not supported' regression from abcl-1.5.0374 357 (deftest jar-pathname.6 375 358 (let* ((p #p"jar:http://example.org/abcl.jar!/org/armedbear/lisp/Version.class") … … 383 366 (:absolute "org" "armedbear" "lisp") "Version" "class") 384 367 385 #+(or) ;;; FIXME 'Nested Jar URLs are not supported' regression from abcl-1.5.0386 368 (deftest jar-pathname.7 387 369 (let* ((p #p"jar:jar:http://example.org/abcl.jar!/foo.abcl!/foo-1.cls") … … 415 397 (:absolute "c" "d") "foo" "lisp") 416 398 417 ;;; 'jar:file:' forms must be URI encoded, meaning whitespace is not allowed399 ;;; 'jar:file:' forms currently (abcl-1.8.0) can't be URI encoded, meaning whitespace is not allowed 418 400 (deftest jar-pathname.10 419 401 (signals-error … … 424 406 t) 425 407 408 #+(or) ;; URI escaping not returned 426 409 (deftest jar-pathname.11 427 410 (let ((s (string-downcase "jar:file:///foo/bar/a%20space%3f/that!/this")))
Note: See TracChangeset
for help on using the changeset viewer.