packages-00.lsp 1.34 KB
Newer Older
1 2 3 4 5 6 7 8
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sat Apr 25 08:07:31 1998
;;;; Contains: Package test code (common code)

(in-package :cl-test)
(declaim (optimize (safety 3)))

9
(report-and-ignore-errors
10 11 12 13
  (defpackage "A"
    (:use)
    (:nicknames "Q")
    (:export "FOO")))
14

15
(report-and-ignore-errors
16 17 18
  (defpackage "B"
    (:use "A")
    (:export "BAR")))
19

20 21 22 23 24 25 26 27 28 29 30 31
(defun set-up-packages ()
  (safely-delete-package "A")
  (safely-delete-package "B")
  (safely-delete-package "Q")
  (defpackage "A"
    (:use)
    (:nicknames "Q")
    (:export "FOO"))
  (defpackage "B"
    (:use "A")
    (:export "BAR")))

32 33 34 35 36 37 38 39 40 41 42
(report-and-ignore-errors
  (defpackage "FS-A"
    (:use)
    (:nicknames "FS-Q")
    (:export "FOO")))

(report-and-ignore-errors
  (defpackage "FS-B"
    (:use "FS-A")
    (:export "BAR")))

43
(report-and-ignore-errors
44 45 46 47
  (defpackage "DS1"
    (:use)
    (:intern "C" "D")
    (:export "A" "B")))
48

49
(report-and-ignore-errors
50 51 52 53
  (defpackage "DS2"
    (:use)
    (:intern "E" "F")
    (:export "G" "H" "A")))
54

55
(report-and-ignore-errors
56 57 58 59 60 61 62
  (defpackage "DS3"
    (:shadow "B")
    (:shadowing-import-from "DS1" "A")
    (:use "DS1" "DS2")
    (:export "A" "B" "G" "I" "J" "K")
    (:intern "L" "M")))

63
(report-and-ignore-errors
64 65 66 67 68
  (defpackage "DS4"
    (:shadowing-import-from "DS1" "B")
    (:use "DS1" "DS3")
    (:intern "X" "Y" "Z")
    (:import-from "DS2" "F")))