@@ -73,7 +73,7 @@ describe('swift runner', function() {
7373 }
7474 }
7575
76- _XCTMain ([
76+ XCTMain ([
7777 testCase(CalculatorTest.allTests)
7878 ])
7979 ` ,
@@ -87,6 +87,41 @@ describe('swift runner', function() {
8787 } ) ;
8888 } ) ;
8989
90+ it ( 'should allow whitespace in "XCTMain ("' , function ( done ) {
91+ var code = `
92+ func add(_ a: Int, _ b: Int) -> Int {
93+ return a + b
94+ }
95+ ` ;
96+ runner . run ( {
97+ language : 'swift' ,
98+ languageVersion : '3' ,
99+ code : code ,
100+ fixture : `
101+ import XCTest
102+ class AddTest: XCTestCase {
103+ static var allTests = [
104+ ("testAddCheck", testAddCheck),
105+ ]
106+ func testAddCheck() {
107+ XCTAssertEqual(add(1, 1), 2, "add(1, 1) should be 2")
108+ }
109+ }
110+
111+ XCTMain ([
112+ testCase(AddTest.allTests)
113+ ])
114+ ` ,
115+ testFramework : 'xctest'
116+ } , function ( buffer ) {
117+ expect ( buffer . stdout ) . to . contain ( '<DESCRIBE::>AddTest' ) ;
118+ expect ( buffer . stdout ) . to . contain ( '<IT::>testAddCheck' ) ;
119+ expect ( buffer . stdout ) . to . contain ( '<PASSED::>Test Passed' ) ;
120+ expect ( buffer . stdout ) . to . contain ( '<COMPLETEDIN::>' ) ;
121+ done ( ) ;
122+ } ) ;
123+ } ) ;
124+
90125 it ( 'should replace newlines in error messages with <:LF:>' , function ( done ) {
91126 var code = `
92127 class Calculator {
@@ -113,7 +148,7 @@ describe('swift runner', function() {
113148 }
114149 }
115150
116- _XCTMain ([
151+ XCTMain ([
117152 testCase(CalculatorTest.allTests)
118153 ])
119154 ` ,
@@ -174,7 +209,7 @@ describe('swift runner', function() {
174209 }
175210 }
176211
177- _XCTMain ([
212+ XCTMain ([
178213 testCase(CalculatorTest.allTests)
179214 ])
180215 ` ,
@@ -227,7 +262,7 @@ describe('swift runner', function() {
227262 }
228263 }
229264
230- _XCTMain ([
265+ XCTMain ([
231266 testCase(CalculatorTest.allTests)
232267 ])
233268 ` ,
@@ -274,7 +309,7 @@ describe('swift runner', function() {
274309 }
275310 }
276311
277- _XCTMain ([
312+ XCTMain ([
278313 testCase(GreetingsTest.allTests)
279314 ])
280315 ` ,
@@ -332,7 +367,7 @@ describe('swift runner', function() {
332367 }
333368 }
334369
335- _XCTMain ([
370+ XCTMain ([
336371 testCase(CalculatorTest.allTests),
337372 testCase(PersonTest.allTests),
338373 ])
0 commit comments