aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Properties/Floating.hs
diff options
context:
space:
mode:
authorAdam Vogt <vogt.adam@gmail.com>2014-05-02 20:01:46 +0200
committerAdam Vogt <vogt.adam@gmail.com>2014-05-02 20:01:46 +0200
commit9660a7a64c749e181d2114cc4b66a8aa4f88be0f (patch)
tree1664b0ed1ee20f66cf3b7f550c33d49c897bed8c /tests/Properties/Floating.hs
parentb682eaf8fcbb548dacb35b4103e546cbd9fca3ed (diff)
downloadxmonad-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 'tests/Properties/Floating.hs')
-rw-r--r--tests/Properties/Floating.hs36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/Properties/Floating.hs b/tests/Properties/Floating.hs
new file mode 100644
index 0000000..a9afad7
--- /dev/null
+++ b/tests/Properties/Floating.hs
@@ -0,0 +1,36 @@
+{-# LANGUAGE ScopedTypeVariables #-}
+module Properties.Floating where
+
+import Test.QuickCheck
+import Instances
+
+import XMonad.StackSet hiding (filter)
+
+import qualified Data.Map as M
+
+------------------------------------------------------------------------
+-- properties for the floating layer:
+
+prop_float_reversible (nex :: NonEmptyWindowsStackSet) = do
+ let NonEmptyWindowsStackSet x = nex
+ w <- arbitraryWindow nex
+ return $ sink w (float w geom x) == x
+ where
+ geom = RationalRect 100 100 100 100
+
+prop_float_geometry (nex :: NonEmptyWindowsStackSet) = do
+ let NonEmptyWindowsStackSet x = nex
+ w <- arbitraryWindow nex
+ let s = float w geom x
+ return $ M.lookup w (floating s) == Just geom
+ where
+ geom = RationalRect 100 100 100 100
+
+prop_float_delete (nex :: NonEmptyWindowsStackSet) = do
+ let NonEmptyWindowsStackSet x = nex
+ w <- arbitraryWindow nex
+ let s = float w geom x
+ t = delete w s
+ return $ not (w `member` t)
+ where
+ geom = RationalRect 100 100 100 100