The idiomatic practice for unit tests seems to be to put unit tests in a "tests" submodule at the end of the file. Ok, sounds good.
But what if you want to unit test private functions/methods? Unless I've missed something major, private functions aren't visible in a submodule, which makes the hard to test.
I've considered the following solutions:
Push private function tests out of the submodule. Seems like the best option.
Make everything public. Sort of defeats the point scoping.
Make them doc tests. I don't want private functions in my documentation, and the code repetition involved is ugly.
Make me long for Euclid's visibility rules. But is there a better option I've missed?
Because ::A is not actually valid, even in the parent module. Try changing A to ::A in main to see.
My mental model here is that the use statement creates A in the current lexical scope as an alias to ::Bar::A, but lexical scopes do not propagate into mod-blocks, so if you want to use A unqualified inside the submodule you would need to say use super::Bar::{A, B} or use ::Bar::{A,B}. If you were to use a pub use instead of a simple use, then ::A would be created as an alias in the module namespace in addition to the lexical A alias; then use super::* would find it in the module namespace.
Disclaimer: I have not seen any code or documentation for this behavior, I've just done experiments.