blob: 498809870121ef207859a3009eb24f1472d01544 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
module Test (
Test(..),
TestStep(..),
ProcName(..), textProcName, unpackProcName,
NodeName(..), textNodeName, 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 Text
| Wait
newtype ProcName = ProcName Text
deriving (Eq, Ord)
textProcName :: ProcName -> Text
textProcName (ProcName name) = name
unpackProcName :: ProcName -> String
unpackProcName (ProcName tname) = T.unpack tname
newtype NodeName = NodeName Text
deriving (Eq, Ord)
textNodeName :: NodeName -> Text
textNodeName (NodeName name) = name
unpackNodeName :: NodeName -> String
unpackNodeName (NodeName tname) = T.unpack tname
|