Skip to content

Instantly share code, notes, and snippets.

@rexcfnghk
Last active May 29, 2016 12:53
Show Gist options
  • Select an option

  • Save rexcfnghk/bcec6944607eaa81a086f34162c39a17 to your computer and use it in GitHub Desktop.

Select an option

Save rexcfnghk/bcec6944607eaa81a086f34162c39a17 to your computer and use it in GitHub Desktop.
open FsCheck
open FsCheck.Xunit
open Swensen.Unquote
[<Property>]
let ``tryConvertToChar converts successfully for one-character string`` () =
let validStringArb =
Arb.generate<char>
|> Gen.map string
|> Arb.fromGen
Prop.forAll validStringArb <| fun s ->
test <@ match tryConvertToChar s with Success _ -> true | Error _ -> false @>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment