Skip to content

Commit fb7aa9b

Browse files
committed
Convert PackageController_BuildsRoute_BuildInfoTests
1 parent b9554eb commit fb7aa9b

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

Tests/AppTests/PackageController+BuildsRoute+BuildInfoTests.swift

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,57 +14,57 @@
1414

1515
@testable import App
1616

17+
import Testing
1718
import Vapor
18-
import XCTest
1919

2020

21-
class PackageController_BuildsRoute_BuildInfoTests: AppTestCase {
21+
@Suite struct PackageController_BuildsRoute_BuildInfoTests {
2222

23-
func test_buildStatus() throws {
23+
@Test func buildStatus() throws {
2424
// Test build status aggregation, in particular see
2525
// https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/issues/666
2626
// setup
2727
// MUT & verification
28-
XCTAssertEqual([mkBuildInfo(.ok), mkBuildInfo(.failed)].compatibility, .compatible)
29-
XCTAssertEqual([mkBuildInfo(.triggered), mkBuildInfo(.triggered)].compatibility, .unknown)
30-
XCTAssertEqual([mkBuildInfo(.failed), mkBuildInfo(.triggered)].compatibility, .unknown)
31-
XCTAssertEqual([mkBuildInfo(.ok), mkBuildInfo(.triggered)].compatibility, .compatible)
28+
#expect([mkBuildInfo(.ok), mkBuildInfo(.failed)].compatibility == .compatible)
29+
#expect([mkBuildInfo(.triggered), mkBuildInfo(.triggered)].compatibility == .unknown)
30+
#expect([mkBuildInfo(.failed), mkBuildInfo(.triggered)].compatibility == .unknown)
31+
#expect([mkBuildInfo(.ok), mkBuildInfo(.triggered)].compatibility == .compatible)
3232
}
3333

34-
func test_noneSucceeded() throws {
35-
XCTAssertTrue([mkBuildInfo(.failed), mkBuildInfo(.failed)].noneSucceeded)
36-
XCTAssertFalse([mkBuildInfo(.ok), mkBuildInfo(.failed)].noneSucceeded)
34+
@Test func noneSucceeded() throws {
35+
#expect([mkBuildInfo(.failed), mkBuildInfo(.failed)].noneSucceeded)
36+
#expect(![mkBuildInfo(.ok), mkBuildInfo(.failed)].noneSucceeded)
3737
}
3838

39-
func test_anySucceeded() throws {
40-
XCTAssertTrue([mkBuildInfo(.ok), mkBuildInfo(.failed)].anySucceeded)
41-
XCTAssertFalse([mkBuildInfo(.failed), mkBuildInfo(.failed)].anySucceeded)
39+
@Test func anySucceeded() throws {
40+
#expect([mkBuildInfo(.ok), mkBuildInfo(.failed)].anySucceeded)
41+
#expect(![mkBuildInfo(.failed), mkBuildInfo(.failed)].anySucceeded)
4242
}
4343

44-
func test_nonePending() throws {
45-
XCTAssertTrue([mkBuildInfo(.ok), mkBuildInfo(.failed)].nonePending)
46-
XCTAssertFalse([mkBuildInfo(.ok), mkBuildInfo(.triggered)].nonePending)
44+
@Test func nonePending() throws {
45+
#expect([mkBuildInfo(.ok), mkBuildInfo(.failed)].nonePending)
46+
#expect(![mkBuildInfo(.ok), mkBuildInfo(.triggered)].nonePending)
4747
// timeouts will not be retried - therefore they are not pending
48-
XCTAssertTrue([mkBuildInfo(.ok), mkBuildInfo(.timeout)].nonePending)
48+
#expect([mkBuildInfo(.ok), mkBuildInfo(.timeout)].nonePending)
4949
// infrastructure errors _will_ be retried - they are pending
50-
XCTAssertFalse([mkBuildInfo(.ok), mkBuildInfo(.infrastructureError)].nonePending)
50+
#expect(![mkBuildInfo(.ok), mkBuildInfo(.infrastructureError)].nonePending)
5151
}
5252

53-
func test_anyPending() throws {
54-
XCTAssertFalse([mkBuildInfo(.ok), mkBuildInfo(.failed)].anyPending)
55-
XCTAssertTrue([mkBuildInfo(.ok), mkBuildInfo(.triggered)].anyPending)
53+
@Test func anyPending() throws {
54+
#expect(![mkBuildInfo(.ok), mkBuildInfo(.failed)].anyPending)
55+
#expect([mkBuildInfo(.ok), mkBuildInfo(.triggered)].anyPending)
5656
// timeouts will not be retried - therefore they are not pending
57-
XCTAssertTrue([mkBuildInfo(.ok), mkBuildInfo(.timeout)].nonePending)
57+
#expect([mkBuildInfo(.ok), mkBuildInfo(.timeout)].nonePending)
5858
// infrastructure errors _will_ be retried - they are pending
59-
XCTAssertFalse([mkBuildInfo(.ok), mkBuildInfo(.infrastructureError)].nonePending)
59+
#expect(![mkBuildInfo(.ok), mkBuildInfo(.infrastructureError)].nonePending)
6060
}
6161

62-
func test_Platform_isCompatible() throws {
63-
XCTAssertTrue(Build.Platform.iOS.isCompatible(with: .iOS))
64-
XCTAssertFalse(Build.Platform.iOS.isCompatible(with: .macOS))
62+
@Test func Platform_isCompatible() throws {
63+
#expect(Build.Platform.iOS.isCompatible(with: .iOS))
64+
#expect(!Build.Platform.iOS.isCompatible(with: .macOS))
6565

66-
XCTAssertTrue(Build.Platform.macosSpm.isCompatible(with: .macOS))
67-
XCTAssertTrue(Build.Platform.macosXcodebuild.isCompatible(with: .macOS))
66+
#expect(Build.Platform.macosSpm.isCompatible(with: .macOS))
67+
#expect(Build.Platform.macosXcodebuild.isCompatible(with: .macOS))
6868
}
6969

7070
}

0 commit comments

Comments
 (0)