From 2de3b5dc3089e491a7eac6df695dca9c4980a424 Mon Sep 17 00:00:00 2001 From: Sho Ikeda Date: Sat, 9 Feb 2019 00:24:24 +0900 Subject: [PATCH] Address test failures on Swift 5.0 --- .../NimbleTests/Matchers/BeCloseToTest.swift | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Tests/NimbleTests/Matchers/BeCloseToTest.swift b/Tests/NimbleTests/Matchers/BeCloseToTest.swift index 009db83a5..f724be661 100644 --- a/Tests/NimbleTests/Matchers/BeCloseToTest.swift +++ b/Tests/NimbleTests/Matchers/BeCloseToTest.swift @@ -16,8 +16,8 @@ final class BeCloseToTest: XCTestCase, XCTestCaseProvider { func testBeCloseToWithin() { expect(1.2).to(beCloseTo(9.300, within: 10)) - failsWithErrorMessage("expected to not be close to <1.2001> (within 1), got <1.2>") { - expect(1.2).toNot(beCloseTo(1.2001, within: 1.0)) + failsWithErrorMessage("expected to not be close to <1.2001> (within 1.1), got <1.2>") { + expect(1.2).toNot(beCloseTo(1.2001, within: 1.1)) } } @@ -26,8 +26,8 @@ final class BeCloseToTest: XCTestCase, XCTestCaseProvider { expect(NSNumber(value: 1.2)).to(beCloseTo(NSNumber(value: 9.300), within: 10)) expect(1.2).to(beCloseTo(NSNumber(value: 9.300), within: 10)) - failsWithErrorMessage("expected to not be close to <1.2001> (within 1), got <1.2>") { - expect(NSNumber(value: 1.2)).toNot(beCloseTo(1.2001, within: 1.0)) + failsWithErrorMessage("expected to not be close to <1.2001> (within 1.1), got <1.2>") { + expect(NSNumber(value: 1.2)).toNot(beCloseTo(1.2001, within: 1.1)) } } @@ -35,8 +35,8 @@ final class BeCloseToTest: XCTestCase, XCTestCaseProvider { expect(CGFloat(1.2)).to(beCloseTo(1.2001)) expect(CGFloat(1.2)).to(beCloseTo(CGFloat(1.2001))) - failsWithErrorMessage("expected to not be close to <1.2001> (within 1), got <1.2>") { - expect(CGFloat(1.2)).toNot(beCloseTo(1.2001, within: 1.0)) + failsWithErrorMessage("expected to not be close to <1.2001> (within 1.1), got <1.2>") { + expect(CGFloat(1.2)).toNot(beCloseTo(1.2001, within: 1.1)) } } @@ -71,11 +71,11 @@ final class BeCloseToTest: XCTestCase, XCTestCaseProvider { expect(1.2) ≈ (9.300, 10) expect(1.2) == (9.300, 10) - failsWithErrorMessage("expected to be close to <1> (within 0.1), got <1.2>") { - expect(1.2) ≈ (1.0, 0.1) + failsWithErrorMessage("expected to be close to <1.1> (within 0.1), got <1.3>") { + expect(1.3) ≈ (1.1, 0.1) } - failsWithErrorMessage("expected to be close to <1> (within 0.1), got <1.2>") { - expect(1.2) == (1.0, 0.1) + failsWithErrorMessage("expected to be close to <1.1> (within 0.1), got <1.3>") { + expect(1.3) == (1.1, 0.1) } } @@ -83,11 +83,11 @@ final class BeCloseToTest: XCTestCase, XCTestCaseProvider { expect(1.2) ≈ 9.300 ± 10 expect(1.2) == 9.300 ± 10 - failsWithErrorMessage("expected to be close to <1> (within 0.1), got <1.2>") { - expect(1.2) ≈ 1.0 ± 0.1 + failsWithErrorMessage("expected to be close to <1.1> (within 0.1), got <1.3>") { + expect(1.3) ≈ 1.1 ± 0.1 } - failsWithErrorMessage("expected to be close to <1> (within 0.1), got <1.2>") { - expect(1.2) == 1.0 ± 0.1 + failsWithErrorMessage("expected to be close to <1.1> (within 0.1), got <1.3>") { + expect(1.3) == 1.1 ± 0.1 } } @@ -132,11 +132,11 @@ final class BeCloseToTest: XCTestCase, XCTestCaseProvider { expect([0.0, 1.1, 2.2]) ≈ [0.0001, 1.1001, 2.2001] expect([0.0, 1.1, 2.2]).to(beCloseTo([0.1, 1.2, 2.3], within: 0.1)) - failsWithErrorMessage("expected to be close to <[0, 1]> (each within 0.0001), got <[0, 1.1]>") { - expect([0.0, 1.1]) ≈ [0.0, 1.0] + failsWithErrorMessage("expected to be close to <[0.1, 1.1]> (each within 0.0001), got <[0.1, 1.2]>") { + expect([0.1, 1.2]) ≈ [0.1, 1.1] } - failsWithErrorMessage("expected to be close to <[0.2, 1.2]> (each within 0.1), got <[0, 1.1]>") { - expect([0.0, 1.1]).to(beCloseTo([0.2, 1.2], within: 0.1)) + failsWithErrorMessage("expected to be close to <[0.3, 1.3]> (each within 0.1), got <[0.1, 1.2]>") { + expect([0.1, 1.2]).to(beCloseTo([0.3, 1.3], within: 0.1)) } } }