@@ -47,31 +47,31 @@ final class ProtoDurationTests: XCTestCase {
4747 XCTAssertEqual ( duration. seconds, 120 )
4848 XCTAssertEqual ( duration. nanos, 123 )
4949
50- XCTAssertEqual ( duration. timeInterval, 120.000000123 )
50+ XCTAssertEqual ( duration. timeInterval, 120.000000123 , accuracy : 1e-9 )
5151 }
5252
5353 func testDecodeProtoDuration_withoutNanoseconds( ) throws {
5454 let duration = try decodeProtoDuration ( " 120s " )
5555 XCTAssertEqual ( duration. seconds, 120 )
5656 XCTAssertEqual ( duration. nanos, 0 )
5757
58- XCTAssertEqual ( duration. timeInterval, 120 )
58+ XCTAssertEqual ( duration. timeInterval, 120 , accuracy : 1e-9 )
5959 }
6060
6161 func testDecodeProtoDuration_maxNanosecondDigits( ) throws {
6262 let duration = try decodeProtoDuration ( " 15.123456789s " )
6363 XCTAssertEqual ( duration. seconds, 15 )
6464 XCTAssertEqual ( duration. nanos, 123_456_789 )
6565
66- XCTAssertEqual ( duration. timeInterval, 15.123456789 )
66+ XCTAssertEqual ( duration. timeInterval, 15.123456789 , accuracy : 1e-9 )
6767 }
6868
6969 func testDecodeProtoDuration_withMilliseconds( ) throws {
7070 let duration = try decodeProtoDuration ( " 15.123s " )
7171 XCTAssertEqual ( duration. seconds, 15 )
7272 XCTAssertEqual ( duration. nanos, 123_000_000 )
7373
74- XCTAssertEqual ( duration. timeInterval, 15.123000000 )
74+ XCTAssertEqual ( duration. timeInterval, 15.123 , accuracy : 1e-9 )
7575 }
7676
7777 func testDecodeProtoDuration_invalidSeconds( ) throws {
@@ -94,6 +94,6 @@ final class ProtoDurationTests: XCTestCase {
9494 XCTAssertEqual ( duration. seconds, 123 )
9595 XCTAssertEqual ( duration. nanos, 456_000_000 )
9696
97- XCTAssertEqual ( duration. timeInterval, 123.456 )
97+ XCTAssertEqual ( duration. timeInterval, 123.456 , accuracy : 1e-9 )
9898 }
9999}
0 commit comments