You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[<assembly:InternalsVisibleTo("MyLibraryTests")>]
type internal MyDataStructure = ...
type LibraryAPI = ...
This library contains an internal data structure class, which despite being an implementation detail (as opined in the fourth bullet of #152 (comment)), but it's still a type whose behavior is worth verifying by itself, but irrelevant to the purpose of the library to warrant making it public.
Now, let's write a generator:
// We are at the MyLibraryTests assembly.
type Generators() =
static member MyDataStructure() = Arb.generate |> ...
The code above raises a compiler error because Generators is public but one of its methods returns an internal type. We could make Generators internal but FsCheck would complain, forcing us to make MyDataStructure internal.
The best way to actually solve such problems is to make FsCheck allow nonpublic generator classes. It might be done with a single-line change in Runner.fs but I'm not sure whether it would suffice.
The text was updated successfully, but these errors were encountered:
Consider a library like this:
This library contains an internal data structure class, which despite being an implementation detail (as opined in the fourth bullet of #152 (comment)), but it's still a type whose behavior is worth verifying by itself, but irrelevant to the purpose of the library to warrant making it public.
Now, let's write a generator:
The code above raises a compiler error because
Generators
is public but one of its methods returns an internal type. We could makeGenerators
internal but FsCheck would complain, forcing us to makeMyDataStructure
internal.The best way to actually solve such problems is to make FsCheck allow nonpublic generator classes. It might be done with a single-line change in
Runner.fs
but I'm not sure whether it would suffice.The text was updated successfully, but these errors were encountered: