Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/runners/swift.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module.exports.run = function run(opts, cb) {
args.push('/workspace/setup.swift');
}
fs.writeFileSync('/workspace/solution.swift', opts.solution);
fs.writeFileSync('/workspace/main.swift', opts.fixture);
fs.writeFileSync('/workspace/main.swift', opts.fixture.replace(/^\s*XCTMain\(/m, '_XCTMain('));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may or may not want to support both with and without a leading _. We should probably support whitespace in between n( just in case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added whitespace flexibility, but no leading _ allowed. There shouldn't be any content using _XCTMain yet right?

args.push('/workspace/solution.swift', '/workspace/main.swift');

return exec(args.join(' '), (err, stdout, stderr) => {
Expand Down
12 changes: 6 additions & 6 deletions test/runners/swift_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('swift runner', function() {
}
}

_XCTMain([
XCTMain([
testCase(CalculatorTest.allTests)
])
`,
Expand Down Expand Up @@ -113,7 +113,7 @@ describe('swift runner', function() {
}
}

_XCTMain([
XCTMain([
testCase(CalculatorTest.allTests)
])
`,
Expand Down Expand Up @@ -174,7 +174,7 @@ describe('swift runner', function() {
}
}

_XCTMain([
XCTMain([
testCase(CalculatorTest.allTests)
])
`,
Expand Down Expand Up @@ -227,7 +227,7 @@ describe('swift runner', function() {
}
}

_XCTMain([
XCTMain([
testCase(CalculatorTest.allTests)
])
`,
Expand Down Expand Up @@ -274,7 +274,7 @@ describe('swift runner', function() {
}
}

_XCTMain([
XCTMain([
testCase(GreetingsTest.allTests)
])
`,
Expand Down Expand Up @@ -332,7 +332,7 @@ describe('swift runner', function() {
}
}

_XCTMain([
XCTMain([
testCase(CalculatorTest.allTests),
testCase(PersonTest.allTests),
])
Expand Down