I come from the Java world, where you can hide variables and functions and then run unit tests against them using reflection. I have used nested functions to hide implement
I don't think that there is any chance to access inner() from the extern namespace.
However, in my opinion the fact that you keep inner() nested implies that the only "contract" that really matters is outer()'s one. inner() is part of the implementation, and you shouldn't want to test the implementation. If you really want to test inner(), do extensive tests on outer() with data that will involve all the functionalities of inner().