Skip to content

Commit 0bf83cb

Browse files
committed
Convert MiscTests
1 parent db676a6 commit 0bf83cb

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

Tests/AppTests/MiscTests.swift

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,45 +12,43 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
import Foundation
16+
1517
@testable import App
1618

17-
import XCTest
19+
import Testing
1820

1921

2022
/// Tests for utilities and extesions that don't each need a full separate test class
21-
class MiscTests: XCTestCase {
23+
@Suite struct MiscTests {
2224

23-
func test_Array_queryString() throws {
25+
@Test func Array_queryString() throws {
2426
// Single parameter
25-
XCTAssertEqual([QueryParameter(key: "foo", value: "bar")].queryString(), "?foo=bar")
27+
#expect([QueryParameter(key: "foo", value: "bar")].queryString() == "?foo=bar")
2628

2729
// Multiple parameters
28-
XCTAssertEqual([
30+
#expect([
2931
QueryParameter(key: "foo", value: "bar"),
3032
QueryParameter(key: "baz", value: "erp")
31-
].queryString(), "?foo=bar&baz=erp")
33+
].queryString() == "?foo=bar&baz=erp")
3234

3335
// Single parameter without separator
34-
XCTAssertEqual([QueryParameter(key: "foo", value: "bar")].queryString(includeSeparator: false), "foo=bar")
36+
#expect([QueryParameter(key: "foo", value: "bar")].queryString(includeSeparator: false) == "foo=bar")
3537
}
3638

37-
func test_Date_init_yyyyMMdd() throws {
38-
XCTAssertEqual(Date("1970-01-01"),
39-
Date(timeIntervalSince1970: 0))
40-
XCTAssertEqual(Date("foo"), nil)
39+
@Test func Date_init_yyyyMMdd() throws {
40+
#expect(Date("1970-01-01") == Date(timeIntervalSince1970: 0))
41+
#expect(Date("foo") == nil)
4142
}
4243

43-
func test_Date_iso8691() throws {
44-
XCTAssertEqual(Date("1970-01-01T0:01:23Z"),
45-
Date(timeIntervalSince1970: 83))
44+
@Test func Date_iso8691() throws {
45+
#expect(Date("1970-01-01T0:01:23Z") == Date(timeIntervalSince1970: 83))
4646
}
4747

48-
func test_Date_LosslessStringConvertible() throws {
49-
XCTAssertEqual(Date("1970-01-01"),
50-
Date(timeIntervalSince1970: 0))
51-
XCTAssertEqual(Date("1970-01-01T0:01:23Z"),
52-
Date(timeIntervalSince1970: 83))
53-
XCTAssertEqual(Date("foo"), nil)
48+
@Test func Date_LosslessStringConvertible() throws {
49+
#expect(Date("1970-01-01") == Date(timeIntervalSince1970: 0))
50+
#expect(Date("1970-01-01T0:01:23Z") == Date(timeIntervalSince1970: 83))
51+
#expect(Date("foo") == nil)
5452
}
5553

5654
}

0 commit comments

Comments
 (0)