Closed baynezy closed 8 months ago
Not familiar enough with the C# consumption model, but f you're using V3, string
s are never null
? (The docs are per V3 -rc1
already anyway, and most people use that)
@bartelink - I am using version 2.16.6 of FsCheck.Xunit
Yes - as mentioned, its not impossible to make it work, but I don't know what's going wrong
But I'm telling you that one way to resolve it is to sidestep it by going to V3, which would never pass you null
for a String
input.
Obviously moving to V3 may entail navigating some breaking changes though
StringNoNulls
just removes \000
characters: https://github.com/fscheck/FsCheck/blob/f1bd17add9fc8ac82e58b59ef3b09e522973e83e/src/FsCheck/Internals.DefaultArbs.fs#L620
Try NonEmptyString
instead, or the generic NonNull<string>
.
@kurtschelfthout - thanks so much.
NonNull<string>
was just the ticket.
StringNoNulls
just removes\000
characters:
Then it should be called StringNoNuls
😆
Here is an example reproduction case:
When I run this I still seem to get:
I am very confused as the
StringNoNulls
type is not supposed to return a null value.What am I doing wrong?