File tree 1 file changed +22
-2
lines changed
stbx-protocol/test/Statebox/Protocol
1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 1
1
module Test.Statebox.Protocol.Fire where
2
2
3
3
import Prelude
4
+ import Data.Either (Either (..))
5
+ import Data.Maybe (Maybe (..))
6
+ import Data.NonEmpty (NonEmpty (..))
4
7
import Test.Spec (Spec , describe , it )
5
8
import Test.Spec.Assertions (shouldEqual )
6
9
10
+ import Statebox.Core.Wiring (NetsAndDiagramsIndex (..))
11
+ import Statebox.Protocol.Fire (FiringError (..), fire )
12
+
7
13
suite :: Spec Unit
8
14
suite = do
9
15
describe " Firing a firing" do
10
- it " should work" do
11
- 1 `shouldEqual` 1
16
+ it " fails if the wiring is not valid" do
17
+ -- the only relevant thing here is that the wiring is not valid
18
+ let wiring = { diagrams: [{ name: " diagram"
19
+ , names: []
20
+ , pixels: [1 , 2 ]
21
+ , width: 1
22
+ }]
23
+ , nets : []
24
+ , labels : [NetsAndDiagramsIndex 5 ]
25
+ }
26
+ firing = { execution : Nothing
27
+ , message: Nothing
28
+ , path: NonEmpty 3 []
29
+ }
30
+ marking = mempty
31
+ fire wiring firing marking `shouldEqual` Left FireInvalidWiringTree
You can’t perform that action at this time.
0 commit comments