43 lines
1.2 KiB
Plaintext
43 lines
1.2 KiB
Plaintext
;;;; Test code for WHERE-IS
|
|
|
|
;;; Start with an XCL exec. Copy each non-commented statement
|
|
;;; from this file into the executive and observe that it behaves
|
|
;;; as described in the comments.
|
|
|
|
;;; These tests are meant to be done IN ORDER, and ONLY ONCE
|
|
;;; as many tests depend upon the sucess of previous tests.
|
|
|
|
(in-package "XCL")
|
|
|
|
;; turn off any databases currently on
|
|
(dolist (db *where-is-cash-files*)
|
|
(del-where-is-database db))
|
|
|
|
;; make a database of records used in TCP
|
|
(where-is-notice "{dsk}test.hash"
|
|
:files "{eris}<lispcore>library>tcp*.;"
|
|
:new t
|
|
:hash-file-size 500
|
|
:define-types '(il:records)))
|
|
;; should return #.(pathname "{dsk}test.hash")
|
|
|
|
;;; turn on the database & use it
|
|
(add-where-is-database "{dsk}test.hash")
|
|
;; should return #.(pathname "{dsk}test.hash")
|
|
(il:whereis 'il:ip 'il:records t)
|
|
;; should return (il:tcpllip)
|
|
(il:typesof 'il:ip)
|
|
;; should return (il:records)
|
|
|
|
;;; turn off the database
|
|
(del-where-is-database (probe-file "{dsk}test.hash"))
|
|
;; should return #.(pathname "{dsk}test.hash")
|
|
(il:whereis 'il:ip 'il:records t)
|
|
;; should return NIL
|
|
(il:typesof 'il:ip)
|
|
;; should return NIL
|
|
|
|
(dolist (file (directory "{dsk}test.hash") (values))
|
|
(princ (namestring file))
|
|
(delete-file file))
|