{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
module Test.Cardano.Ledger.Alonzo.GoldenTranslation (
tests,
)
where
import Cardano.Ledger.Alonzo (AlonzoEra)
import Paths_cardano_ledger_alonzo (getDataFileName)
import Test.Cardano.Ledger.Alonzo.Translation.Golden (assertTranslationResultsMatchGolden)
import Test.Cardano.Ledger.Common
import Test.HUnit (Assertion)
tests :: Spec
tests :: Spec
tests =
forall a. HasCallStack => String -> SpecWith a -> SpecWith a
describe String
"Golden translation tests" forall a b. (a -> b) -> a -> b
$ do
forall a.
(HasCallStack, Example a) =>
String -> a -> SpecWith (Arg a)
it String
"golden/translations.cbor" forall a b. (a -> b) -> a -> b
$
String -> Assertion
goldenAssertion String
"golden/translations.cbor"
goldenAssertion :: String -> Assertion
goldenAssertion :: String -> Assertion
goldenAssertion String
file = forall era.
(TranslatableGen era, Show (ContextError era), HasCallStack) =>
IO String -> Assertion
assertTranslationResultsMatchGolden @AlonzoEra (String -> IO String
getDataFileName String
file)