@@ -33,14 +33,14 @@ class OptionDescriptorTests: XCTestCase {
33
33
testName: String = #function)
34
34
{
35
35
var options = FormatOptions . default
36
- expectations. forEach {
36
+ for expectation in expectations {
37
37
do {
38
- try descriptor. toOptions ( $0 . argumentValue, & options)
39
- XCTAssertEqual ( options [ keyPath: keyPath] , $0 . optionValue, " \( testName) : Argument \( $0 . argumentValue) map to option \( $0 . optionValue) " )
40
- try descriptor. toOptions ( $0 . argumentValue. uppercased ( ) , & options)
41
- XCTAssertEqual ( options [ keyPath: keyPath] , $0 . optionValue, " \( testName) : Argument Uppercased \( $0 . argumentValue) map to option \( $0 . optionValue) " )
42
- try descriptor. toOptions ( $0 . argumentValue. capitalized, & options)
43
- XCTAssertEqual ( options [ keyPath: keyPath] , $0 . optionValue, " \( testName) : Argument capitalized \( $0 . argumentValue) map to option \( $0 . optionValue) " )
38
+ try descriptor. toOptions ( expectation . argumentValue, & options)
39
+ XCTAssertEqual ( options [ keyPath: keyPath] , expectation . optionValue, " \( testName) : Argument \( expectation . argumentValue) map to option \( expectation . optionValue) " )
40
+ try descriptor. toOptions ( expectation . argumentValue. uppercased ( ) , & options)
41
+ XCTAssertEqual ( options [ keyPath: keyPath] , expectation . optionValue, " \( testName) : Argument Uppercased \( expectation . argumentValue) map to option \( expectation . optionValue) " )
42
+ try descriptor. toOptions ( expectation . argumentValue. capitalized, & options)
43
+ XCTAssertEqual ( options [ keyPath: keyPath] , expectation . optionValue, " \( testName) : Argument capitalized \( expectation . argumentValue) map to option \( expectation . optionValue) " )
44
44
} catch {
45
45
XCTFail ( " \( testName) : error: \( error) " )
46
46
}
@@ -54,16 +54,16 @@ class OptionDescriptorTests: XCTestCase {
54
54
testName: String = #function)
55
55
{
56
56
var options = FormatOptions . default
57
- expectations. forEach {
57
+ for expectation in expectations {
58
58
do {
59
- try descriptor. toOptions ( $0 . argumentValue, & options)
60
- XCTAssertEqual ( options [ keyPath: keyPath] , $0 . optionValue, " \( testName) : Argument \( $0 . argumentValue) map to option \( String ( describing: $0 . optionValue) ) " )
59
+ try descriptor. toOptions ( expectation . argumentValue, & options)
60
+ XCTAssertEqual ( options [ keyPath: keyPath] , expectation . optionValue, " \( testName) : Argument \( expectation . argumentValue) map to option \( String ( describing: expectation . optionValue) ) " )
61
61
if testCaseVariation {
62
62
do {
63
- try descriptor. toOptions ( $0 . argumentValue. uppercased ( ) , & options)
64
- XCTAssertEqual ( options [ keyPath: keyPath] , $0 . optionValue, " \( testName) : Argument Uppercased \( $0 . argumentValue) map to option \( String ( describing: $0 . optionValue) ) " )
65
- try descriptor. toOptions ( $0 . argumentValue. capitalized, & options)
66
- XCTAssertEqual ( options [ keyPath: keyPath] , $0 . optionValue, " \( testName) : Argument capitalized \( $0 . argumentValue) map to option \( String ( describing: $0 . optionValue) ) " )
63
+ try descriptor. toOptions ( expectation . argumentValue. uppercased ( ) , & options)
64
+ XCTAssertEqual ( options [ keyPath: keyPath] , expectation . optionValue, " \( testName) : Argument Uppercased \( expectation . argumentValue) map to option \( String ( describing: expectation . optionValue) ) " )
65
+ try descriptor. toOptions ( expectation . argumentValue. capitalized, & options)
66
+ XCTAssertEqual ( options [ keyPath: keyPath] , expectation . optionValue, " \( testName) : Argument capitalized \( expectation . argumentValue) map to option \( String ( describing: expectation . optionValue) ) " )
67
67
} catch {
68
68
XCTFail ( " \( testName) : error: \( error) " )
69
69
}
@@ -106,9 +106,9 @@ class OptionDescriptorTests: XCTestCase {
106
106
expectations: [ FreeTextValidationExpectation ] ,
107
107
testName: String = #function)
108
108
{
109
- expectations. forEach {
110
- let isValid = descriptor. validateArgument ( $0 . input)
111
- XCTAssertEqual ( isValid, $0 . isValid, " \( testName) : \( isValid) != \( $0 . isValid) " )
109
+ for expectation in expectations {
110
+ let isValid = descriptor. validateArgument ( expectation . input)
111
+ XCTAssertEqual ( isValid, expectation . isValid, " \( testName) : \( isValid) != \( expectation . isValid) " )
112
112
}
113
113
}
114
114
0 commit comments