Skip to content

Instantly share code, notes, and snippets.

@medigor
Last active August 13, 2019 18:53
Show Gist options
  • Save medigor/5038426be116950b16b9590f285894bb to your computer and use it in GitHub Desktop.
Save medigor/5038426be116950b16b9590f285894bb to your computer and use it in GitHub Desktop.
// 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