summaryrefslogtreecommitdiff
path: root/src/Test.hs
diff options
context:
space:
mode:
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