Skip to content

Commit 74e48db

Browse files
committed
Convert Duration extension tests
1 parent ee87339 commit 74e48db

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

Tests/FoundationInternationalizationTests/DurationExtensionTests.swift

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,28 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#if canImport(TestSupport)
14-
import TestSupport
15-
#endif
13+
import Testing
1614

1715
#if canImport(FoundationInternationalization)
1816
@testable import FoundationEssentials
1917
@testable import FoundationInternationalization
20-
#endif
21-
22-
#if FOUNDATION_FRAMEWORK
18+
#elseif FOUNDATION_FRAMEWORK
2319
@testable import Foundation
2420
#endif
2521

26-
final class DurationExtensionTests : XCTestCase {
22+
@Suite("Duration Extension")
23+
private struct DurationExtensionTests {
2724

28-
func testRoundingMode() {
25+
@Test func roundingMode() {
2926

30-
func verify(_ tests: [Int64], increment: Int64, expected: [FloatingPointRoundingRule: [Int64]], file: StaticString = #filePath, line: UInt = #line) {
27+
func verify(_ tests: [Int64], increment: Int64, expected: [FloatingPointRoundingRule: [Int64]], sourceLocation: SourceLocation = #_sourceLocation) {
3128
let modes: [FloatingPointRoundingRule] = [.down, .up, .towardZero, .awayFromZero, .toNearestOrEven, .toNearestOrAwayFromZero]
3229
for mode in modes {
3330
var actual: [Duration] = []
3431
for test in tests {
3532
actual.append(Duration.seconds(test).rounded(increment: Duration.seconds(increment), rule: mode))
3633
}
37-
XCTAssertEqual(actual, expected[mode]?.map { Duration.seconds($0) }, "\(mode) does not match", file: file, line: line)
34+
#expect(actual == expected[mode]?.map { Duration.seconds($0) }, "\(mode) does not match", sourceLocation: sourceLocation)
3835
}
3936
}
4037

0 commit comments

Comments
 (0)