source: trunk/abcl/test/lisp/abcl/jar-file.lisp @ 12343

Last change on this file since 12343 was 12343, checked in by Mark Evenson, 11 years ago

Adjust tests for jar:file syntax should work with TRUENAME.

File size: 2.0 KB
Line 
1(in-package #:abcl.test.lisp)
2
3#-:unix (error "Load test setup currently needs UNIX shell script support.")
4
5(defun load-init ()
6  (let* ((*default-pathname-defaults* *this-directory*)
7         (asdf::*verbose-out* *standard-output*)
8         (package-command (format nil "cd ~A; sh ~A" 
9                                  *this-directory*
10                                  (merge-pathnames "package-load.sh"))))
11    (compile-file "foo.lisp")
12    (compile-file "bar.lisp")
13    (compile-file "eek.lisp")
14    (asdf:run-shell-command package-command))
15  (setf *jar-file-init* t))
16
17(defvar *jar-file-init* nil)
18
19(defmacro with-jar-file-init (&rest body)
20  `(let ((*default-pathname-defaults* *this-directory*))
21     (progn
22       (unless *jar-file-init*
23         (load-init))
24       ,@body)))
25 
26
27(deftest jar-file-load.1
28    (with-jar-file-init
29        (load "foo"))
30  t)
31
32(deftest jar-file-load.2
33    (with-jar-file-init
34      (load "foo.lisp"))
35  t)
36
37(deftest jar-file-load.3
38    (with-jar-file-init
39      (load "foo.abcl"))
40  t)
41
42(deftest jar-file-load.4
43    (with-jar-file-init
44      (load "jar:file:baz.jar!/foo"))
45  t)
46
47(deftest jar-file-load.6
48    (with-jar-file-init
49      (load "jar:file:baz.jar!/bar"))
50  t)
51
52(deftest jar-file-load.7
53    (with-jar-file-init
54      (load "jar:file:baz.jar!/bar.abcl"))
55  t)
56
57(deftest jar-file-load.8
58    (with-jar-file-init
59      (load "jar:file:baz.jar!/eek"))
60  t)
61
62(deftest jar-file-load.9
63    (with-jar-file-init
64      (load "jar:file:baz.jar!/eek.lisp"))
65  t)
66
67
68(deftest jar-file-probe-file.1
69    (with-jar-file-init
70        (probe-file "jar:file:baz.jar!/eek.lisp"))
71  #p"jar:file:baz.jar!/eek.lisp") ; WRONG: PROBE-FILE should return
72                                  ; TRUENAME on existence.
73
74
75(deftest jar-file-merge-pathnames.1
76    (merge-pathnames 
77     "!/foo" #p"jar:file:baz.jar")
78  #p"jar:file:baz.jar!/foo")
79
80(deftest jar-file-truename.1
81    (truename "jar:file:baz.jar!/foo")
82  (format nil "jar:file:~S/baz.jar!/foo" 
83          *this-directory*))
84         
85
86
87
88 
Note: See TracBrowser for help on using the repository browser.