Sha256: 3f6d4e5317006f8a716933c9f010475cbb598cdd7bea77b47cd765a01948017d
Contents?: true
Size: 887 Bytes
Versions: 229
Compression:
Stored size: 887 Bytes
Contents
{-# OPTIONS_GHC -fno-warn-type-defaults #-} import Data.Foldable (for_) import Test.Hspec (Spec, describe, it, shouldBe) import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith) import Hexadecimal (hexToInt) main :: IO () main = hspecWith defaultConfig {configFastFail = True} specs specs :: Spec specs = describe "hexToInt" $ for_ cases test where test (input, expected) = it description assertion where description = show input assertion = hexToInt input `shouldBe` expected cases = [ ( "1", 1) , ( "c", 12) , ( "10", 16) , ( "af", 175) , ( "100", 256) , ("19ace" , 105166) , ("carrot", 0) , ("000000", 0) , ("ffffff", 16777215) , ("ffff00", 16776960) ]
Version data entries
229 entries across 229 versions & 1 rubygems