{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeApplications #-}

module Main where

import Cardano.Ledger.Babbage (BabbageEra)
import Data.Proxy (Proxy (..))
import System.Environment (lookupEnv)
import qualified Test.Cardano.Ledger.Babbage.Serialisation.Tripping as Tripping
import Test.Cardano.Ledger.Babbage.TxInfo (txInfoTests)
import Test.Tasty (TestTree, defaultMain, testGroup)

main :: IO ()
IO ()
main = do
  Maybe String
nightly <- String -> IO (Maybe String)
lookupEnv String
"NIGHTLY"
  TestTree -> IO ()
defaultMain forall a b. (a -> b) -> a -> b
$ case Maybe String
nightly of
    Maybe String
Nothing -> TestTree
defaultTests
    Just String
_ -> TestTree
nightlyTests

defaultTests :: TestTree
defaultTests :: TestTree
defaultTests =
  String -> [TestTree] -> TestTree
testGroup
    String
"Babbage tests"
    [ TestTree
Tripping.tests
    , forall era.
(EraTx era, BabbageEraTxBody era, Value era ~ MaryValue,
 Inject (BabbageContextError era) (ContextError era),
 EraPlutusTxInfo 'PlutusV1 era, EraPlutusTxInfo 'PlutusV2 era) =>
Proxy era -> TestTree
txInfoTests (forall {k} (t :: k). Proxy t
Proxy @BabbageEra)
    ]

nightlyTests :: TestTree
nightlyTests :: TestTree
nightlyTests =
  String -> [TestTree] -> TestTree
testGroup
    String
"Babbage tests - nightly"
    []