{-# 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 =
String -> Spec -> Spec
forall a. HasCallStack => String -> SpecWith a -> SpecWith a
describe String
"Golden translation tests" (Spec -> Spec) -> Spec -> Spec
forall a b. (a -> b) -> a -> b
$ do
String -> Assertion -> SpecM (Arg Assertion) ()
forall a.
(HasCallStack, Example a) =>
String -> a -> SpecWith (Arg a)
it String
"golden/translations.cbor" (Assertion -> SpecM (Arg Assertion) ())
-> Assertion -> SpecM (Arg Assertion) ()
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, HasCallStack) =>
IO String -> Assertion
assertTranslationResultsMatchGolden @AlonzoEra (String -> IO String
getDataFileName String
file)