-
Notifications
You must be signed in to change notification settings - Fork 110
/
Copy pathpackage.lisp
53 lines (42 loc) · 1.4 KB
/
package.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
;;; -*- mode:lisp; coding:utf-8 -*-
(/debug "perform test/package.lisp!")
(test (listp (list-all-packages)))
(test (not (eq (list-all-packages) (list-all-packages))))
(test (equal (multiple-value-list (do-symbols (symbol *package* (values 1 2)))) '(1 2)))
(make-package 'fubar)
(test (find-package 'fubar))
(delete-package "FUBAR")
(test (null (find-package 'fubar)))
(make-package 'fubar)
(delete-package 'fubar)
(test (null (find-package 'fubar)))
(make-package 'fubar)
(delete-package (find-package 'fubar))
(test (null (find-package 'fubar)))
(when (find-package 'foo)
(delete-package (find-package 'foo)))
(test
(let ((package (make-package 'foo :use '(cl)))
foo-symbols
cl-symbols)
(do-symbols (symbol package)
(push symbol foo-symbols))
(do-external-symbols (symbol 'cl)
(push symbol cl-symbols))
(and (not (null foo-symbols))
(equal foo-symbols cl-symbols))))
(when (find-package 'bar)
(delete-package (find-package 'bar)))
(test
(let* ((package (make-package 'bar))
(baz (intern (string 'baz) package)))
(let (symbols)
(do-all-symbols (symbol)
(push symbol symbols))
(and (member 'car symbols)
(member baz symbols)))))
(test (member 'car (find-all-symbols (string 'car))))
;;; This test is failing. I have disabled temporarily.
;;; note: Fixed ? @vkm
(test (eq (eval '(in-package #:cl-user)) (find-package '#:cl-user)))
;;; EOF