git.iko.soy/typeable/cabal2nix
on 9d40586 help sign in
25 lines 877 B history raw
1module Main ( main ) where
3import Control.Lens
4import Control.DeepSeq
5import Control.Exception
6import Distribution.Nixpkgs.License
7import Distribution.Nixpkgs.Meta
8import Test.Hspec
10main :: IO ()
11main = do
12 hspec $ do
13 describe "DeepSeq instances work properly for" $ do
14 it "License" $ mapM_ hitsBottom [Known undefined, Unknown (Just undefined)]
15 it "Meta" $ do mapM_ hitsBottom
16 [ nullMeta & homepage .~ undefined
17 , nullMeta & description .~ undefined
18 , nullMeta & license .~ undefined
19 , nullMeta & platforms .~ undefined
20 , nullMeta & maintainers .~ undefined
21 , nullMeta & broken .~ undefined
22 ]
24hitsBottom :: NFData a => a -> Expectation
25hitsBottom x = evaluate (rnf x) `shouldThrow` anyErrorCall