diff options
author | Adam Vogt <vogt.adam@gmail.com> | 2011-06-09 06:02:20 +0200 |
---|---|---|
committer | Adam Vogt <vogt.adam@gmail.com> | 2011-06-09 06:02:20 +0200 |
commit | cae4a749afe9b9928ce50f2dbb6414c595cfcb4b (patch) | |
tree | d56c110f3e562e6cd3c67dc5fe8c634b55fd1dd7 /tests | |
parent | 3cfa0ed22425b56f895abe2104643f8d83634566 (diff) | |
download | XMonadContrib-cae4a749afe9b9928ce50f2dbb6414c595cfcb4b.tar.gz XMonadContrib-cae4a749afe9b9928ce50f2dbb6414c595cfcb4b.tar.xz XMonadContrib-cae4a749afe9b9928ce50f2dbb6414c595cfcb4b.zip |
Move tests from ManageDocks to tests/
Ignore-this: 31d51fae83d88e15cdb69f29da003bf7
The change to use a newtype for RectC is kind of ugly, but this way instances
are less likely to conflict in the tests.
darcs-hash:20110609040220-1499c-3a64ffa1d978d1dcebf648774619b192b3b244e3.gz
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ManageDocks.hs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ManageDocks.hs b/tests/ManageDocks.hs new file mode 100644 index 0000000..dd1e4d2 --- /dev/null +++ b/tests/ManageDocks.hs @@ -0,0 +1,21 @@ +module ManageDocks where +import XMonad +import XMonad.Hooks.ManageDocks +import Test.QuickCheck +import Foreign.C.Types +import Properties + +instance Arbitrary CLong where + arbitrary = fromIntegral `fmap` (arbitrary :: Gen Int) +instance Arbitrary RectC where + arbitrary = do + (x,y) <- arbitrary + NonNegative w <- arbitrary + NonNegative h <- arbitrary + return $ RectC (x,y,x+w,y+h) + +prop_r2c_c2r :: RectC -> Bool +prop_r2c_c2r r = r2c (c2r r) == r + +prop_c2r_r2c :: Rectangle -> Bool +prop_c2r_r2c r = c2r (r2c r) == r |