mirror of
https://github.com/tfausak/witch.git
synced 2024-11-22 14:58:13 +03:00
Test the Show
instance for TryFromException
This commit is contained in:
parent
8c3ad74485
commit
d312023851
@ -1,6 +1,7 @@
|
||||
{-# OPTIONS_GHC -Wno-error=overflowed-literals #-}
|
||||
|
||||
{-# LANGUAGE MultiParamTypeClasses #-}
|
||||
{-# LANGUAGE NegativeLiterals #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE TypeApplications #-}
|
||||
|
||||
@ -91,6 +92,12 @@ main = runTestTTAndExit $ "Witch" ~:
|
||||
[ $$(Witch.liftedInto @Int.Int8 (1 :: Int.Int16)) ~?= 1
|
||||
]
|
||||
]
|
||||
, "TryFromException" ~:
|
||||
[ "show" ~:
|
||||
[ show (Witch.TryFromException @Int @Int 0 Nothing) ~?= "TryFromException @Int @Int 0 Nothing"
|
||||
, show (Witch.TryFromException @(Seq.Seq Int) @(Seq.Seq Int) (Seq.fromList []) (Just (Exception.toException Exception.Overflow))) ~?= "TryFromException @(Seq Int) @(Seq Int) (fromList []) (Just arithmetic overflow)"
|
||||
]
|
||||
]
|
||||
, "Instances" ~:
|
||||
[ "From a a" ~:
|
||||
let f = Witch.from @Int @Int in
|
||||
|
Loading…
Reference in New Issue
Block a user