summaryrefslogtreecommitdiff
path: root/src/Test.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2021-08-07 22:28:53 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2021-08-10 22:14:35 +0200
commitf0d6957a0b1cbc0bf35d2d82225c4221f9c50927 (patch)
treed4ef8922af2d05094596cbcc8c4f61af4801ecda /src/Test.hs
parent8e1259ba31f312024a6644c112f0e0f1bbd891f5 (diff)
Test data type
Diffstat (limited to 'src/Test.hs')
-rw-r--r--src/Test.hs33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/Test.hs b/src/Test.hs
new file mode 100644
index 0000000..f26e67a
--- /dev/null
+++ b/src/Test.hs
@@ -0,0 +1,33 @@
+module Test (
+ Test(..),
+ TestStep(..),
+
+ ProcName(..), unpackProcName,
+ NodeName(..), unpackNodeName,
+) where
+
+import Data.Text (Text)
+import qualified Data.Text as T
+
+import Text.Regex.TDFA
+
+data Test = Test
+ { testName :: Text
+ , testSteps :: [TestStep]
+ }
+
+data TestStep = Spawn ProcName NodeName
+ | Send ProcName Text
+ | Expect ProcName Regex
+
+newtype ProcName = ProcName Text
+ deriving (Eq, Ord)
+
+unpackProcName :: ProcName -> String
+unpackProcName (ProcName tname) = T.unpack tname
+
+newtype NodeName = NodeName Text
+ deriving (Eq, Ord)
+
+unpackNodeName :: NodeName -> String
+unpackNodeName (NodeName tname) = T.unpack tname