mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-09 00:21:52 -07:00
added a quickcheck property
This commit is contained in:
@@ -10,6 +10,7 @@ import System.IO
|
|||||||
import System.Random
|
import System.Random
|
||||||
import Text.Printf
|
import Text.Printf
|
||||||
import Data.List (nub,sort,group,sort,intersperse)
|
import Data.List (nub,sort,group,sort,intersperse)
|
||||||
|
import Data.Map (keys,elems)
|
||||||
|
|
||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- QuickCheck properties for the StackSet
|
-- QuickCheck properties for the StackSet
|
||||||
@@ -80,6 +81,11 @@ prop_shiftshift r x =
|
|||||||
in shift n (shift r x) == x
|
in shift n (shift r x) == x
|
||||||
where _ = x :: T
|
where _ = x :: T
|
||||||
|
|
||||||
|
prop_fullcache x = cached == allvals where
|
||||||
|
cached = sort . keys $ cache x
|
||||||
|
allvals = sort . concat . elems $ stacks x
|
||||||
|
_ = x :: T
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
@@ -103,6 +109,7 @@ main = do
|
|||||||
,("delete idempotent", mytest prop_delete2)
|
,("delete idempotent", mytest prop_delete2)
|
||||||
,("rotate/rotate ", mytest prop_rotaterotate)
|
,("rotate/rotate ", mytest prop_rotaterotate)
|
||||||
,("view/view ", mytest prop_viewview)
|
,("view/view ", mytest prop_viewview)
|
||||||
|
,("fullcache ", mytest prop_fullcache)
|
||||||
]
|
]
|
||||||
|
|
||||||
debug = False
|
debug = False
|
||||||
|
Reference in New Issue
Block a user