mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-18 19:10:21 -07:00
Due to differences between random-1.1 and random-1.2, on newer systems stringToRatio returns numbers outside [0, 1] range, which breaks colorRangeFromClassName colorizers. This commit fixes the issue by using randomR to directly generate the random number. Also this fixes the compilation warning (genRange and next are deprecated in random-1.2).
16 lines
343 B
Haskell
16 lines
343 B
Haskell
module GridSelect where
|
|
|
|
import Test.Hspec
|
|
import Test.Hspec.QuickCheck
|
|
|
|
import XMonad.Actions.GridSelect
|
|
|
|
spec :: Spec
|
|
spec = do
|
|
prop "prop_stringToRatio_valuesInRange" prop_stringToRatio_valuesInRange
|
|
|
|
prop_stringToRatio_valuesInRange :: String -> Bool
|
|
prop_stringToRatio_valuesInRange s =
|
|
let r = stringToRatio s
|
|
in r >= 0 && r <= 1
|