Wed 12 Jun 2013 03:48:43 AM UTC, comment #2:
It's not generally possible to call private functions, subfunctions, or nested functions directly, so how do you propose to test them individually?
For private functions, you could temporarily place a wrapper function in the directory that contains the private subdirectory, but that's messy (for one thing, it won't work when running the _run_test_suite_ function if the user running the tests can't write in the directory where the functions are stored). Oh, but any private function that can be used at all already has a wrapper function of some kind in the parent directory. Otherwise it could not be called at all. So test those functions thoroughly and that should be sufficient.
For subfunctions, there's just no general way to properly call them directly. So I don't see how you could test them individually. Again, I think the solution is to test the parent functions thoroughly, and let it go at that.
Likewise for nested functions. There is definitely no general way to properly call them directly outside their nested context.
There are still many user-callable functions that do not have any tests, or that have insufficient tests. So rather than worrying about whether we can test private functions, subfunctions, or nested functions individually, perhaps it would be a better use of our time to write more tests for the functions that users do call directly.
|