summaryrefslogtreecommitdiff
path: root/src/Test.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2025-09-21 22:49:21 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2025-09-21 22:49:21 +0200
commitc558b300a3353edf7c88a2c363cb6bc7b7c1dcb7 (patch)
treef8a21828219592a2a23289be74c7faaa95f8e3d0 /src/Test.hs
parent442bc3df9692edde632e3a1d7217e861bf85fd81 (diff)
Require result of TestBlock to be ExprType instanceHEADmaster
Diffstat (limited to 'src/Test.hs')
-rw-r--r--src/Test.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Test.hs b/src/Test.hs
index 1481b2b..9ba185b 100644
--- a/src/Test.hs
+++ b/src/Test.hs
@@ -12,7 +12,7 @@ import Control.Monad.Reader
import Data.Bifunctor
import Data.Scientific
-import Data.Text (Text)
+import Data.Text (Text, pack)
import Data.Typeable
import Network
@@ -57,7 +57,7 @@ data TestStep a where
PacketLoss :: Scientific -> Node -> TestStep a -> TestStep a
Wait :: TestStep ()
-instance Typeable a => ExprType (TestBlock a) where
+instance ExprType a => ExprType (TestBlock a) where
textExprType _ = "test block"
textExprValue _ = "<test block>"
@@ -67,6 +67,9 @@ data MultiplyTimeout = MultiplyTimeout Scientific
instance ObjectType TestRun MultiplyTimeout where
type ConstructorArgs MultiplyTimeout = Scientific
+ textObjectType _ _ = "MultiplyTimeout"
+ textObjectValue _ (MultiplyTimeout x) = pack (show x) <> "@MultiplyTimeout"
+
createObject oid timeout
| timeout >= 0 = do
var <- asks (teTimeout . fst)