-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
207 additions
and
4,116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Alonzo.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE OverloadedStrings #-} | ||
|
||
module Test.Cardano.Db.Mock.Unit.Alonzo ( | ||
unitTests, | ||
) where | ||
|
||
import Cardano.Mock.ChainSync.Server (IOManager) | ||
import Data.Text (Text) | ||
import Test.Tasty (TestTree, testGroup) | ||
import Test.Tasty.HUnit (Assertion, testCase) | ||
|
||
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.Config as AlzConfig | ||
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.Simple as AlzSimple | ||
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.Tx as AlzTx | ||
|
||
{- HLINT ignore "Reduce duplication" -} | ||
|
||
unitTests :: IOManager -> [(Text, Text)] -> TestTree | ||
unitTests iom knownMigrations = | ||
testGroup | ||
"Alonzo unit tests" | ||
[ testGroup | ||
"config" | ||
[ testCase "default insert config" AlzConfig.defaultInsertConfig | ||
, testCase "insert config" AlzConfig.insertConfig | ||
] | ||
, testGroup | ||
"simple" | ||
[ test "simple forge blocks" AlzSimple.forgeBlocks | ||
, test "sync one block" AlzSimple.addSimple | ||
, test "restart db-sync" AlzSimple.restartDBSync | ||
, test "sync small chain" AlzSimple.addSimpleChain | ||
] | ||
, testGroup | ||
"blocks with txs" | ||
[ test "simple tx" AlzTx.addSimpleTx | ||
, test "consume utxo same block" AlzTx.consumeSameBlock | ||
] | ||
] | ||
where | ||
test :: String -> (IOManager -> [(Text, Text)] -> Assertion) -> TestTree | ||
test str action = testCase str (action iom knownMigrations) |
Oops, something went wrong.