Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ddssff committed Dec 4, 2024
1 parent 08228bf commit 7066f5a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/instances.hs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ main = defaultMain $ testGroup "SafeCopy instances"
, deriveTests ]


-- | A smattering of test cases.
deriveTests =
testGroup "deriveSafeCopy'"
testGroup "deriveSafeCopy"
[ testCase "deriveSafeCopy 0 'base ''(,,,,,,,)" $ do
let decs = $(do addDependentFile "src/Data/SafeCopy/Derive.hs"
lift =<< deriveSafeCopy 0 'base ''(,,,,,,,))
Expand All @@ -135,6 +136,7 @@ deriveTests =
" version = 0",
" kind = base",
" errorTypeName _ = \"GHC.Tuple.(,,,,,,,)\""]
-- Test passing a type to deriveSafeCopy' instead of a Name.
, testCase "deriveSafeCopy' 0 'base [t(,,,,,,,)|]" $ do
let decs = $(do addDependentFile "src/Data/SafeCopy/Derive.hs"
lift =<< deriveSafeCopy' 0 'base [t|forall a b c d e f g h. (Show a, Typeable a) => (a,b,c,d,e,f,g,h)|])
Expand All @@ -145,6 +147,7 @@ deriveTests =
" version = 0",
" kind = base",
" errorTypeName _ = \"GHC.Tuple.(,,,,,,,)\""]
-- A type with a type parameter results in some context.
, testCase "deriveSafeCopy' 0 'base (ClientView db)" $ do
let decs = $(do addDependentFile "src/Data/SafeCopy/Derive.hs"
lift =<< deriveSafeCopy' 0 'base [t|forall db. ClientView db|])
Expand All @@ -155,6 +158,8 @@ deriveTests =
" version = 0",
" kind = base",
" errorTypeName _ = \"Types.ClientView\""]
-- There is a hidden forall type parameter inside SearchTerm, so
-- context is generated here.
, testCase "deriveSafeCopy' 0 'base SearchTerm" $ do
let decs = $(do addDependentFile "src/Data/SafeCopy/Derive.hs"
lift =<< deriveSafeCopy' 0 'base [t|SearchTerm|])
Expand Down

0 comments on commit 7066f5a

Please sign in to comment.