Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Provide a way for unit tests to access functions and data hidden by the .mli file #7778
One of the purposes of .mli files is to define a public interface for a module that hides implementation details; the .mli hides functions and data that should not and cannot be accessed from other modules. However, for testing, frequently it would be very useful to be able to write tests against the hidden items, such as with OUnit.
Is there a reasonable, relatively easy way OCaml could make the hidden functions accessible in test code, such as through a command line flag when compiling the tests?
A few other approaches I considered and rejected:
Caveat: I've not used OUnit yet--I may have missed something in it that addresses my concerns.