I have (at least) one package where my main program lives. I have another package for running tests. I :use the package of the main program in the defpackage form of the test package but that only imports the exported symbols. So I can't test all of functions, only the ones I have explicitly exported (the public API). How to I solve this issue?
You can always refer to internal (un-exported) symbols with a double-colon qualifier:
(package-name::function-name)
You can also import a symbol into your test package (regardless of whether it's been exported from the main package) with import. For instance:
(import 'package-name::function-name)
(fboundp 'function-name) ;; => t
Here's the CLHS entry on import.
Also, if you haven't read it, I recommend the Programming in the Large: Packages and Symbols chapter from Practical Common Lisp. It doesn't directly address your question, but I mention it because I've found it very helpful regrading packages and symbols in general.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With