Advertisement
Guest User

F# Assert module

a guest
Sep 24th, 2013
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.23 KB | None | 0 0
  1. module Assert =
  2.     let Throws<'a when 'a :> exn> f =
  3.         let wasThrown = ref false
  4.         try f () with :? 'a -> wasThrown := true
  5.        Assert.IsTrue (!wasThrown, sprintf "%s expected, but not thrown." typeof<'a>.Name)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement