diff options
author | Adam Vogt <vogt.adam@gmail.com> | 2014-05-02 20:01:46 +0200 |
---|---|---|
committer | Adam Vogt <vogt.adam@gmail.com> | 2014-05-02 20:01:46 +0200 |
commit | 9660a7a64c749e181d2114cc4b66a8aa4f88be0f (patch) | |
tree | 1664b0ed1ee20f66cf3b7f550c33d49c897bed8c /tests/Properties/Failure.hs | |
parent | b682eaf8fcbb548dacb35b4103e546cbd9fca3ed (diff) | |
download | xmonad-9660a7a64c749e181d2114cc4b66a8aa4f88be0f.tar.gz xmonad-9660a7a64c749e181d2114cc4b66a8aa4f88be0f.tar.xz xmonad-9660a7a64c749e181d2114cc4b66a8aa4f88be0f.zip |
update testsuite (mostly due Jesper Reenberg)
Ignore-this: a5e926aa4e397e70d56e3c9db7108d5b
* use quickcheck2
* run them using cabal's test-suite field
* split up Properties into separate files
darcs-hash:20140502180146-1499c-dc8c09c3ec76a42a0e146925adce960435dc81db.gz
Diffstat (limited to '')
-rw-r--r-- | tests/Properties/Failure.hs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/Properties/Failure.hs b/tests/Properties/Failure.hs new file mode 100644 index 0000000..fc7a359 --- /dev/null +++ b/tests/Properties/Failure.hs @@ -0,0 +1,26 @@ +module Properties.Failure where + +import XMonad.StackSet hiding (filter) + +import qualified Control.Exception.Extensible as C +import System.IO.Unsafe + +-- --------------------------------------------------------------------- +-- testing for failure + +-- and help out hpc +prop_abort x = unsafePerformIO $ C.catch (abort "fail") + (\(C.SomeException e) -> return $ show e == "xmonad: StackSet: fail" ) + where + _ = x :: Int + +-- new should fail with an abort +prop_new_abort x = unsafePerformIO $ C.catch f + (\(C.SomeException e) -> return $ show e == "xmonad: StackSet: non-positive argument to StackSet.new" ) + where + f = new undefined{-layout-} [] [] `seq` return False + + _ = x :: Int + +-- TODO: Fix this? +-- prop_view_should_fail = view {- with some bogus data -} |