Last active
August 13, 2019 18:53
-
-
Save medigor/5038426be116950b16b9590f285894bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In *.fsproj add: | |
// <PropertyGroup > | |
// <WarningsAsErrors>FS0025</WarningsAsErrors> | |
// </PropertyGroup> | |
module Tests | |
open System | |
open Xunit | |
type TestDU = | |
| DUCase1 of int | |
| DUCase2 of int | |
| Unknown | |
let inline (|UnwrapDU|) x = | |
match x with | |
| DUCase1 y -> y | |
| DUCase2 y -> y | |
| Unknown -> failwith "Panic!" | |
[<Fact>] | |
let ``My test`` () = | |
let du1 = DUCase1 1 | |
let du2 = DUCase2 2 | |
let (UnwrapDU u) = du1 | |
printfn "%i" u | |
let (UnwrapDU u) = du2 | |
printfn "%i" u |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment