Testing Unexported functions

If I have a function in a package that I am working on, how do perform unit testing on a function that I don’t want to export?

When I try to test my_unexported_function via

pkg> test

I get the error

UndefVarError: my_unexported_function not defined

I can create MWE if question isn’t clear.

MyModule.my_unexported_function

If you would like examples, ForwardDiff doesn’t export any of its functions, so you can look at the examples to see how to call them. Or just look at its tests, where it also does things like:

using ForwardDiff: Partials, Dual, value, partials
3 Likes