diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2025-06-18 20:32:45 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2025-06-19 22:37:34 +0200 |
commit | da73a6777c2e4b7b4a54830c781a6e5bb2cb86fe (patch) | |
tree | cbdfe6ecc2c61e3a568af1c316a52032d574cc6c /src/Test.hs | |
parent | 9d3982e6909956c99244fc86756f2476c9a3fe4a (diff) |
Explicit Scope constructor in TestStep data type
Diffstat (limited to 'src/Test.hs')
-rw-r--r-- | src/Test.hs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/Test.hs b/src/Test.hs index ff51ebe..a9a2cdb 100644 --- a/src/Test.hs +++ b/src/Test.hs @@ -15,7 +15,7 @@ import Script.Shell data Test = Test { testName :: Text - , testSteps :: Expr (TestBlock ()) + , testSteps :: Expr (TestStep ()) } data TestBlock a where @@ -31,18 +31,19 @@ instance Monoid (TestBlock ()) where mempty = EmptyTestBlock data TestStep a where - Subnet :: TypedVarName Network -> Network -> (Network -> TestBlock a) -> TestStep a - DeclNode :: TypedVarName Node -> Network -> (Node -> TestBlock a) -> TestStep a - Spawn :: TypedVarName Process -> Either Network Node -> [ Text ] -> (Process -> TestBlock a) -> TestStep a - SpawnShell :: Maybe (TypedVarName Process) -> Node -> ShellScript -> (Process -> TestBlock a) -> TestStep a + Scope :: TestBlock a -> TestStep a + Subnet :: TypedVarName Network -> Network -> (Network -> TestStep a) -> TestStep a + DeclNode :: TypedVarName Node -> Network -> (Node -> TestStep a) -> TestStep a + Spawn :: TypedVarName Process -> Either Network Node -> [ Text ] -> (Process -> TestStep a) -> TestStep a + SpawnShell :: Maybe (TypedVarName Process) -> Node -> ShellScript -> (Process -> TestStep a) -> TestStep a Send :: Process -> Text -> TestStep () - Expect :: SourceLine -> Process -> Traced Regex -> [ TypedVarName Text ] -> ([ Text ] -> TestBlock a) -> TestStep a + Expect :: SourceLine -> Process -> Traced Regex -> [ TypedVarName Text ] -> ([ Text ] -> TestStep a) -> TestStep a Flush :: Process -> Maybe Regex -> TestStep () Guard :: SourceLine -> EvalTrace -> Bool -> TestStep () - DisconnectNode :: Node -> TestBlock a -> TestStep a - DisconnectNodes :: Network -> TestBlock a -> TestStep a - DisconnectUpstream :: Network -> TestBlock a -> TestStep a - PacketLoss :: Scientific -> Node -> TestBlock a -> TestStep a + DisconnectNode :: Node -> TestStep a -> TestStep a + DisconnectNodes :: Network -> TestStep a -> TestStep a + DisconnectUpstream :: Network -> TestStep a -> TestStep a + PacketLoss :: Scientific -> Node -> TestStep a -> TestStep a Wait :: TestStep () instance Typeable a => ExprType (TestBlock a) where |