@@ -16,17 +16,17 @@ class BasicTests: _TestCase
1616 let machine = StateMachine < MyState , MyEvent > ( state: . State0) { machine in
1717
1818 machine. addRoute ( . State0 => . State1)
19- machine. addRoute ( nil => . State2) { context in println ( " Any => 2, msg= \( context. userInfo!) " ) }
20- machine. addRoute ( . State2 => nil ) { context in println ( " 2 => Any, msg= \( context. userInfo!) " ) }
19+ machine. addRoute ( nil => . State2) { context in print ( " Any => 2, msg= \( context. userInfo!) " ) }
20+ machine. addRoute ( . State2 => nil ) { context in print ( " 2 => Any, msg= \( context. userInfo!) " ) }
2121
2222 // add handler (handlerContext = (event, transition, order, userInfo))
2323 machine. addHandler ( . State0 => . State1) { context in
24- println ( " 0 => 1 " )
24+ print ( " 0 => 1 " )
2525 }
2626
2727 // add errorHandler
2828 machine. addErrorHandler { ( event, transition, order, userInfo) in
29- println ( " [ERROR] \( transition. fromState) => \( transition. toState) " )
29+ print ( " [ERROR] \( transition. fromState) => \( transition. toState) " )
3030 }
3131 }
3232
@@ -36,7 +36,7 @@ class BasicTests: _TestCase
3636 machine <- ( . State1, " Bye " )
3737 machine <- . State0 // fail: no 1 => 0
3838
39- println ( " machine.state = \( machine. state) " )
39+ print ( " machine.state = \( machine. state) " )
4040 }
4141
4242 func testExample( )
@@ -45,19 +45,19 @@ class BasicTests: _TestCase
4545
4646 // add 0 => 1
4747 $0. addRoute ( . State0 => . State1) { context in
48- println ( " [Transition 0=>1] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) " )
48+ print ( " [Transition 0=>1] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) " )
4949 }
5050 // add 0 => 1 once more
5151 $0. addRoute ( . State0 => . State1) { context in
52- println ( " [Transition 0=>1b] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) " )
52+ print ( " [Transition 0=>1b] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) " )
5353 }
5454 // add 2 => Any
5555 $0. addRoute ( . State2 => nil ) { context in
56- println ( " [Transition exit 2] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) (Any) " )
56+ print ( " [Transition exit 2] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) (Any) " )
5757 }
5858 // add Any => 2
5959 $0. addRoute ( nil => . State2) { context in
60- println ( " [Transition Entry 2] \( context. transition. fromState. rawValue) (Any) => \( context. transition. toState. rawValue) " )
60+ print ( " [Transition Entry 2] \( context. transition. fromState. rawValue) (Any) => \( context. transition. toState. rawValue) " )
6161 }
6262 // add 1 => 0 (no handler)
6363 $0. addRoute ( . State1 => . State0)
@@ -94,35 +94,35 @@ class BasicTests: _TestCase
9494
9595 // error
9696 $0. addErrorHandler { context in
97- println ( " [ERROR 1] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) " )
97+ print ( " [ERROR 1] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) " )
9898 }
9999
100100 // entry
101101 $0. addEntryHandler ( . State0) { context in
102- println ( " [Entry 0] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) " ) // NOTE: this should not be called
102+ print ( " [Entry 0] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) " ) // NOTE: this should not be called
103103 }
104104 $0. addEntryHandler ( . State1) { context in
105- println ( " [Entry 1] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) " )
105+ print ( " [Entry 1] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) " )
106106 }
107107 $0. addEntryHandler ( . State2) { context in
108- println ( " [Entry 2] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) , userInfo = \( context. userInfo) " )
108+ print ( " [Entry 2] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) , userInfo = \( context. userInfo) " )
109109 }
110110 $0. addEntryHandler ( . State2) { context in
111- println ( " [Entry 2b] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) , userInfo = \( context. userInfo) " )
111+ print ( " [Entry 2b] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) , userInfo = \( context. userInfo) " )
112112 }
113113
114114 // exit
115115 $0. addExitHandler ( . State0) { context in
116- println ( " [Exit 0] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) " )
116+ print ( " [Exit 0] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) " )
117117 }
118118 $0. addExitHandler ( . State1) { context in
119- println ( " [Exit 1] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) " )
119+ print ( " [Exit 1] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) " )
120120 }
121121 $0. addExitHandler ( . State2) { context in
122- println ( " [Exit 2] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) , userInfo = \( context. userInfo) " )
122+ print ( " [Exit 2] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) , userInfo = \( context. userInfo) " )
123123 }
124124 $0. addExitHandler ( . State2) { context in
125- println ( " [Exit 2b] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) , userInfo = \( context. userInfo) " )
125+ print ( " [Exit 2b] \( context. transition. fromState. rawValue) => \( context. transition. toState. rawValue) , userInfo = \( context. userInfo) " )
126126 }
127127 }
128128
0 commit comments