From c558b300a3353edf7c88a2c363cb6bc7b7c1dcb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 21 Sep 2025 22:49:21 +0200 Subject: Require result of TestBlock to be ExprType instance --- src/Test.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/Test.hs') 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 _ = "" @@ -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) -- cgit v1.2.3