[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #38776] Tests in private functions cannot be t
John W. Eaton
[Octave-bug-tracker] [bug #38776] Tests in private functions cannot be tested directly
Wed, 12 Jun 2013 03:48:43 +0000
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20100101 Firefox/10.0.12 Iceweasel/10.0.12
Follow-up Comment #2, bug #38776 (project octave):
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
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.
Reply to this item at:
Message sent via/by Savannah