packages feed

checked-literals-0.1.0.0: tests/Tests/Integer/Case.hs

{-# LANGUAGE QuasiQuotes #-}

module Tests.Integer.Case (tests) where

import Test.Tasty (TestTree, testGroup)
import Tests.Common (toCaseTestCases)

{- FOURMOLU_DISABLE -}
tests :: TestTree
tests = testGroup "Case" $
  toCaseTestCases
    [ ("Data.Word", "Word8", "255", [])
    , ("Data.Word", "Word8", "256", ["Literal 256 is out of bounds.", "Word8 has bounds: [0 .. 255]."])
    , ("Data.Word", "Word8", "-1", ["Literal -1 is out of bounds.", "Word8 has bounds: [0 .. 255]."])
    , ("Data.Word", "Word8", "(uncheckedLiteral -> 256)", [])
    , ("Data.Int", "Int8", "127", [])
    , ("Data.Int", "Int8", "128", ["Literal 128 is out of bounds.", "Int8 has bounds: [-128 .. 127]."])
    ]
{- FOURMOLU_ENABLE -}