@@ -13,7 +13,7 @@ class BasicTests: _TestCase
13
13
{
14
14
func testREADME( )
15
15
{
16
- let machine = Machine < MyState , MyEvent > ( state: . State0) { machine in
16
+ let machine = Machine < MyState , NoEvent > ( state: . State0) { machine in
17
17
18
18
machine. addRoute ( . State0 => . State1)
19
19
machine. addRoute ( . Any => . State2) { context in print ( " Any => 2, msg= \( context. userInfo) " ) }
@@ -49,7 +49,7 @@ class BasicTests: _TestCase
49
49
50
50
func testREADME_string( )
51
51
{
52
- let machine = Machine < String , String > ( state: " .State0 " ) { machine in
52
+ let machine = Machine < String , NoEvent > ( state: " .State0 " ) { machine in
53
53
54
54
machine. addRoute ( " .State0 " => " .State1 " )
55
55
machine. addRoute ( . Any => " .State2 " ) { context in print ( " Any => 2, msg= \( context. userInfo) " ) }
@@ -66,7 +66,7 @@ class BasicTests: _TestCase
66
66
}
67
67
}
68
68
69
- // tryState 0 => 1 => 2 => 1 => 0
69
+ // tryState 0 => 1 => 2 => 1 => 0
70
70
71
71
machine <- " .State1 "
72
72
XCTAssertTrue ( machine. state == " .State1 " )
@@ -83,9 +83,7 @@ class BasicTests: _TestCase
83
83
print ( " machine.state = \( machine. state) " )
84
84
}
85
85
86
-
87
-
88
-
86
+ // StateType + associated value
89
87
func testREADME_MyState2( )
90
88
{
91
89
let machine = Machine < MyState2 , MyEvent2 > ( state: . State0( " 0 " ) ) { machine in
@@ -122,10 +120,6 @@ class BasicTests: _TestCase
122
120
print ( " machine.state = \( machine. state) " )
123
121
}
124
122
125
-
126
-
127
-
128
-
129
123
func testExample( )
130
124
{
131
125
let machine = Machine < MyState , NoEvent > ( state: . State0) {
0 commit comments