# Testing Unexported functions

**URL:** <https://discourse.julialang.org/t/testing-unexported-functions/25510>\
**Category:** General Usage\
**Tags:** package, testing\
**Created:** [June 21, 2019, 3:48am UTC](https://discourse.julialang.org/t/testing-unexported-functions/25510 "2019-06-21T03:48:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alec\_Loudenback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alec_loudenback/32/278_2.png) [@Alec\_Loudenback](https://discourse.julialang.org/u/Alec_Loudenback)\
**Post date:** [June 21, 2019, 3:48am UTC](https://discourse.julialang.org/t/testing-unexported-functions/25510/1 "2019-06-21T03:48:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [June 21, 2019, 4:12am UTC](https://discourse.julialang.org/t/testing-unexported-functions/25510/2 "2019-06-21T04:12:28Z")

</div>

`MyModule.my_unexported_function`

If you would like examples, [ForwardDiff](https://github.com/JuliaDiff/ForwardDiff.jl) 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:

```julia
using ForwardDiff: Partials, Dual, value, partials

```
