;;-*- Lisp -*-

(register-directory (subpathname *test-directory* "package-inferred-system-test/"))
(load-system :package-inferred-system-test/a/x)
(load-system :package-inferred-system-test/d)

(signals package-inferred-system-missing-package-error (load-system :package-inferred-system-test/e))

;; No such file.
(signals missing-component
         (handler-bind ((system-out-of-date 'continue)) (load-system :package-inferred-system-test/f)))

;; Test that around-compile is inherited by inferred systems.
(assert-equal 3 (symbol-call :package-inferred-system-test/a :add10 1)) ;; add10 must have been compiled in base 2

;; Test that primary system name returns the correct value when called with a
;; package-inferred-system object.
(assert-equal "package-inferred-system-test" (primary-system-name (find-system :package-inferred-system-test/a/x)))

;; Test that SBCL's :local-nicknames are recognized
#+sbcl
(progn
  (load-system :package-inferred-system-test/local-nicknames-1)
  (assert-equal "g" (symbol-call :package-inferred-system-test/local-nicknames-1 :f)))
