Skip to content

Commit 4b04f73

Browse files
committed
Add test for Test module.
Check that Package.xctest are generated.
1 parent 76416da commit 4b04f73

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

Fixtures/SwiftTesting/SingleTarget/Package.swift

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
func ten() -> Int {
2+
return 10
3+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@testable import Foo
2+
import XCTest
3+
4+
class SimpleGetTests: XCTestCase {
5+
6+
func testGetRequestStatusCode() {
7+
XCTAssertEqual(ten(), 10)
8+
}
9+
}

Tests/Functional/TestMiscellaneous.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,4 +303,12 @@ class MiscellaneousTestCase: XCTestCase {
303303
XCTAssertEqual(output, "Goodbye\n")
304304
}
305305
}
306+
307+
func testModuleWithTests() {
308+
fixture(name: "SwiftTesting/SingleTarget", file: #file, line: #line) { prefix in
309+
XCTAssertBuilds(prefix)
310+
XCTAssertDirectoryExists(prefix, ".build", "debug", "Package.xctest")
311+
XCTAssertFileExists(prefix, ".build", "debug", "Foo.swiftmodule")
312+
}
313+
}
306314
}

0 commit comments

Comments
 (0)