git.iko.soy/typeable/cabal2nix
on 1663fb8 help sign in
26 lines 950 B history raw
1module Main ( main ) where
3import Control.DeepSeq
4import Control.Exception
5import Data.Set ( empty )
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 let meta = Meta "" "" (Unknown Nothing) empty empty empty False
16 mapM_ hitsBottom
17 [ meta { homepage = undefined }
18 , meta { description = undefined }
19 , meta { license = undefined }
20 , meta { platforms = undefined }
21 , meta { maintainers = undefined }
22 , meta { broken = undefined }
23 ]
25hitsBottom :: NFData a => a -> Expectation
26hitsBottom x = evaluate (rnf x) `shouldThrow` anyErrorCall