Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
adamayoung committed Feb 26, 2024
1 parent c1a0660 commit 98c0e72
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ final class JSONDecoderDateDecodingStrategyPoliceDataAPITestsTests: XCTestCase {
}

func testDecodingDateTimeDateReturnsDate() throws {
let data = try XCTUnwrap("""
let data = Data("""
{
"date": "2021-05-24T11:28:00"
}
""".data(using: .utf8))
""".utf8)
let expectedResult = Date(timeIntervalSince1970: 1_621_855_680)

let container = try decoder.decode(Container.self, from: data)
Expand All @@ -50,11 +50,11 @@ final class JSONDecoderDateDecodingStrategyPoliceDataAPITestsTests: XCTestCase {
}

func testDecodingDateTimeWithTimeZoneOffsetDateReturnsDate() throws {
let data = try XCTUnwrap("""
let data = Data("""
{
"date": "2021-05-24T11:28:00-07:00"
}
""".data(using: .utf8))
""".utf8)
let expectedResult = Date(timeIntervalSince1970: 1_621_880_880)

let container = try decoder.decode(Container.self, from: data)
Expand All @@ -64,11 +64,11 @@ final class JSONDecoderDateDecodingStrategyPoliceDataAPITestsTests: XCTestCase {
}

func testDecodingYearMonthDateReturnsDate() throws {
let data = try XCTUnwrap("""
let data = Data("""
{
"date": "2021-05"
}
""".data(using: .utf8))
""".utf8)
let expectedResult = Date(timeIntervalSince1970: 1_619_827_200)

let container = try decoder.decode(Container.self, from: data)
Expand All @@ -78,11 +78,11 @@ final class JSONDecoderDateDecodingStrategyPoliceDataAPITestsTests: XCTestCase {
}

func testDecodingWhenInvalidDateThrowsDecodingError() throws {
let data = try XCTUnwrap("""
let data = Data("""
{
"date": "11111"
}
""".data(using: .utf8))
""".utf8)

XCTAssertThrowsError(try decoder.decode(Container.self, from: data))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class JSONSerialiserTests: XCTestCase {
}

func testDecodeWhenDataCannotBeDecodedThrowsDecodeError() async throws {
let data = try XCTUnwrap("aaa".data(using: .utf8))
let data = Data("aaa".utf8)

do {
_ = try await serialiser.decode(MockObject.self, from: data)
Expand Down

0 comments on commit 98c0e72

Please sign in to comment.