@@ -62,6 +62,9 @@ public struct StatementHandler {
6262}
6363
6464public extension StatementHandler {
65+
66+ // MARK: - if -
67+
6568 static func `if`< T> ( _ statement: Regex < T > , timeout: TimeInterval ? = nil , handler: @escaping ( Input < T > ) throws -> Void ) -> StatementHandler {
6669 . init( statementType: . if, statement: statement, timeout: timeout, handler: handler, setup: nil )
6770 }
@@ -71,6 +74,9 @@ public extension StatementHandler {
7174 static func `if`( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( ) throws -> Void ) -> StatementHandler {
7275 . init( statementType: . if, statement: statement, timeout: timeout, handler: { _ in try handler ( ) } , setup: nil )
7376 }
77+
78+ // MARK: - given -
79+
7480 static func given< T> ( _ statement: Regex < T > , timeout: TimeInterval ? = nil , handler: @escaping ( Input < T > ) throws -> Void ) -> StatementHandler {
7581 . if( statement, timeout: timeout, handler: handler)
7682 }
@@ -80,18 +86,45 @@ public extension StatementHandler {
8086 static func given( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( ) throws -> Void ) -> StatementHandler {
8187 . init( statementType: . if, statement: statement, timeout: timeout, handler: { _ in try handler ( ) } , setup: nil )
8288 }
89+
90+ // MARK: - when -
91+
92+ static func when< T> ( _ statement: Regex < T > , timeout: TimeInterval ? = nil , handler: @escaping ( Input < T > ) throws -> Void , setup: @escaping ( Input < T > ) throws -> Void ) -> StatementHandler {
93+ . init( statementType: . when, statement: statement, timeout: timeout, handler: handler, setup: setup)
94+ }
95+ static func when< T> ( _ statement: Regex < T > , timeout: TimeInterval ? = nil , handler: @escaping ( Input < T > ) throws -> Void , setup: @escaping ( ) throws -> Void ) -> StatementHandler {
96+ . init( statementType: . when, statement: statement, timeout: timeout, handler: handler, setup: { _ in try setup ( ) } )
97+ }
98+ static func when< T> ( _ statement: Regex < T > , timeout: TimeInterval ? = nil , handler: @escaping ( ) throws -> Void , setup: @escaping ( Input < T > ) throws -> Void ) -> StatementHandler {
99+ . init( statementType: . when, statement: statement, timeout: timeout, handler: { _ in try handler ( ) } , setup: setup)
100+ }
101+ static func when< T> ( _ statement: Regex < T > , timeout: TimeInterval ? = nil , handler: @escaping ( ) throws -> Void , setup: @escaping ( ) throws -> Void ) -> StatementHandler {
102+ . init( statementType: . when, statement: statement, timeout: timeout, handler: { _ in try handler ( ) } , setup: { _ in try setup ( ) } )
103+ }
83104 static func when< T> ( _ statement: Regex < T > , timeout: TimeInterval ? = nil , handler: @escaping ( Input < T > ) throws -> Void ) -> StatementHandler {
84105 . init( statementType: . when, statement: statement, timeout: timeout, handler: handler, setup: nil )
85106 }
107+ static func when( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( Input < AnyRegexOutput > ) throws -> Void , setup: @escaping ( Input < AnyRegexOutput > ) throws -> Void ) -> StatementHandler {
108+ . init( statementType: . when, statement: statement, timeout: timeout, handler: handler, setup: setup)
109+ }
110+ static func when( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( Input < AnyRegexOutput > ) throws -> Void , setup: @escaping ( ) throws -> Void ) -> StatementHandler {
111+ . init( statementType: . when, statement: statement, timeout: timeout, handler: handler, setup: { _ in try setup ( ) } )
112+ }
113+ static func when( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( ) throws -> Void , setup: @escaping ( Input < AnyRegexOutput > ) throws -> Void ) -> StatementHandler {
114+ . init( statementType: . when, statement: statement, timeout: timeout, handler: { _ in try handler ( ) } , setup: setup)
115+ }
116+ static func when( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( ) throws -> Void , setup: @escaping ( ) throws -> Void ) -> StatementHandler {
117+ . init( statementType: . when, statement: statement, timeout: timeout, handler: { _ in try handler ( ) } , setup: { _ in try setup ( ) } )
118+ }
86119 static func when( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( Input < AnyRegexOutput > ) throws -> Void ) -> StatementHandler {
87120 . init( statementType: . when, statement: statement, timeout: timeout, handler: handler, setup: nil )
88121 }
89122 static func when( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( ) throws -> Void ) -> StatementHandler {
90123 . init( statementType: . when, statement: statement, timeout: timeout, handler: { _ in try handler ( ) } , setup: nil )
91124 }
92- static func expect < T > ( _ statement : Regex < T > , timeout : TimeInterval ? = nil , handler : @escaping ( Input < T > ) throws -> Void ) -> StatementHandler {
93- . init ( statementType : . expect, statement : statement , timeout : timeout , handler : handler , setup : nil )
94- }
125+
126+ // MARK: - expect -
127+
95128 static func expect< T> ( _ statement: Regex < T > , timeout: TimeInterval ? = nil , handler: @escaping ( Input < T > ) throws -> Void , setup: @escaping ( Input < T > ) throws -> Void ) -> StatementHandler {
96129 . init( statementType: . expect, statement: statement, timeout: timeout, handler: handler, setup: setup)
97130 }
@@ -104,21 +137,30 @@ public extension StatementHandler {
104137 static func expect< T> ( _ statement: Regex < T > , timeout: TimeInterval ? = nil , handler: @escaping ( ) throws -> Void , setup: @escaping ( ) throws -> Void ) -> StatementHandler {
105138 . init( statementType: . expect, statement: statement, timeout: timeout, handler: { _ in try handler ( ) } , setup: { _ in try setup ( ) } )
106139 }
107- static func expect< T> ( _ statement: Regex < T > , timeout: TimeInterval ? = nil , handler: @escaping ( ) throws -> Void ) -> StatementHandler {
108- . init( statementType: . expect, statement: statement, timeout: timeout, handler: { _ in try handler ( ) } , setup: nil )
140+ static func expect< T> ( _ statement: Regex < T > , timeout: TimeInterval ? = nil , handler: @escaping ( Input < T > ) throws -> Void ) -> StatementHandler {
141+ . init( statementType: . expect, statement: statement, timeout: timeout, handler: handler, setup: nil )
109142 }
110- static func expect( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( Input < AnyRegexOutput > ) throws -> Void , setup: ( ( Input < AnyRegexOutput > ) throws -> Void ) ? = nil ) -> StatementHandler {
143+ static func expect( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( Input < AnyRegexOutput > ) throws -> Void , setup: @escaping ( Input < AnyRegexOutput > ) throws -> Void ) -> StatementHandler {
111144 . init( statementType: . expect, statement: statement, timeout: timeout, handler: handler, setup: setup)
112145 }
113- static func expect( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( ) throws -> Void , setup: ( ( Input < AnyRegexOutput > ) throws -> Void ) ? = nil ) -> StatementHandler {
146+ static func expect( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( ) throws -> Void , setup: @escaping ( Input < AnyRegexOutput > ) throws -> Void ) -> StatementHandler {
114147 . init( statementType: . expect, statement: statement, timeout: timeout, handler: { _ in try handler ( ) } , setup: setup)
115148 }
116- static func expect( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( Input < AnyRegexOutput > ) throws -> Void , setup: ( ( ) throws -> Void ) ? = nil ) -> StatementHandler {
117- . init( statementType: . expect, statement: statement, timeout: timeout, handler: handler, setup: { _ in try setup ? ( ) } )
149+ static func expect( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( Input < AnyRegexOutput > ) throws -> Void , setup: @escaping ( ) throws -> Void ) -> StatementHandler {
150+ . init( statementType: . expect, statement: statement, timeout: timeout, handler: handler, setup: { _ in try setup ( ) } )
118151 }
119- static func expect( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( ) throws -> Void , setup: ( ( ) throws -> Void ) ? = nil ) -> StatementHandler {
120- . init( statementType: . expect, statement: statement, timeout: timeout, handler: { _ in try handler ( ) } , setup: { _ in try setup ? ( ) } )
152+ static func expect( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( ) throws -> Void , setup: @escaping ( ) throws -> Void ) -> StatementHandler {
153+ . init( statementType: . expect, statement: statement, timeout: timeout, handler: { _ in try handler ( ) } , setup: { _ in try setup ( ) } )
154+ }
155+ static func expect( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( Input < AnyRegexOutput > ) throws -> Void ) -> StatementHandler {
156+ . init( statementType: . expect, statement: statement, timeout: timeout, handler: handler, setup: nil )
157+ }
158+ static func expect( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( ) throws -> Void ) -> StatementHandler {
159+ . init( statementType: . expect, statement: statement, timeout: timeout, handler: { _ in try handler ( ) } , setup: nil )
121160 }
161+
162+ // MARK: - then -
163+
122164 static func then< T> ( _ statement: Regex < T > , timeout: TimeInterval ? = nil , handler: @escaping ( Input < T > ) throws -> Void , setup: @escaping ( Input < T > ) throws -> Void ) -> StatementHandler {
123165 . expect( statement, timeout: timeout, handler: handler, setup: setup)
124166 }
@@ -143,13 +185,12 @@ public extension StatementHandler {
143185 static func then( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( Input < AnyRegexOutput > ) throws -> Void , setup: @escaping ( ) throws -> Void ) -> StatementHandler {
144186 . init( statementType: . expect, statement: statement, timeout: timeout, handler: handler, setup: { _ in try setup ( ) } )
145187 }
146- static func then( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( Input < AnyRegexOutput > ) throws -> Void ) -> StatementHandler {
147- . init( statementType: . expect, statement: statement, timeout: timeout, handler: handler, setup: nil )
148- }
149188 static func then( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( ) throws -> Void , setup: @escaping ( ) throws -> Void ) -> StatementHandler {
150189 . init( statementType: . expect, statement: statement, timeout: timeout, handler: { _ in try handler ( ) } , setup: { _ in try setup ( ) } )
151190 }
152-
191+ static func then( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( Input < AnyRegexOutput > ) throws -> Void ) -> StatementHandler {
192+ . init( statementType: . expect, statement: statement, timeout: timeout, handler: handler, setup: nil )
193+ }
153194 static func then( _ statement: String ... , timeout: TimeInterval ? = nil , handler: @escaping ( ) throws -> Void ) -> StatementHandler {
154195 . init( statementType: . expect, statement: statement, timeout: timeout, handler: { _ in try handler ( ) } , setup: nil )
155196 }
0 commit comments