diff --git a/Package.resolved b/Package.resolved index e4806c58..f939a104 100644 --- a/Package.resolved +++ b/Package.resolved @@ -36,6 +36,15 @@ "version" : "1.1.4" } }, + { + "identity" : "swift-custom-dump", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-custom-dump", + "state" : { + "revision" : "82645ec760917961cfa08c9c0c7104a57a0fa4b1", + "version" : "1.3.3" + } + }, { "identity" : "swift-identified-collections", "kind" : "remoteSourceControl", diff --git a/Package.swift b/Package.swift index 3d9d18c3..f9e3bd5a 100644 --- a/Package.swift +++ b/Package.swift @@ -64,6 +64,7 @@ let package = Package( .package(url: "https://github.com/pointfreeco/swift-identified-collections", from: "1.0.0"), .package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.4.0"), .package(url: "https://github.com/pointfreeco/swift-perception", from: "1.1.4"), + .package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "1.2.1"), ], targets: [ // MARK: Workflow @@ -80,7 +81,10 @@ let package = Package( ), .target( name: "WorkflowTesting", - dependencies: ["Workflow"], + dependencies: [ + "Workflow", + .product(name: "CustomDump", package: "swift-custom-dump"), + ], path: "WorkflowTesting/Sources", linkerSettings: [.linkedFramework("XCTest")] ), diff --git a/Samples/Project.swift b/Samples/Project.swift index 9ef3f582..29b691b6 100644 --- a/Samples/Project.swift +++ b/Samples/Project.swift @@ -192,7 +192,10 @@ let project = Project( .unitTest( for: "WorkflowReactiveSwift", sources: "../WorkflowReactiveSwift/Tests/**", - dependencies: [.external(name: "WorkflowReactiveSwift")] + dependencies: [ + .external(name: "WorkflowReactiveSwift"), + .external(name: "WorkflowReactiveSwiftTesting"), + ] ), .unitTest( for: "WorkflowReactiveSwiftTesting", @@ -205,6 +208,7 @@ let project = Project( sources: "../WorkflowRxSwift/Tests/**", dependencies: [ .external(name: "WorkflowRxSwift"), + .external(name: "WorkflowRxSwiftTesting"), .external(name: "WorkflowReactiveSwift"), ] ), diff --git a/Samples/Tuist/Package.resolved b/Samples/Tuist/Package.resolved index 3fb8bf8c..4de63908 100644 --- a/Samples/Tuist/Package.resolved +++ b/Samples/Tuist/Package.resolved @@ -45,6 +45,15 @@ "version" : "1.1.2" } }, + { + "identity" : "swift-custom-dump", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-custom-dump", + "state" : { + "revision" : "82645ec760917961cfa08c9c0c7104a57a0fa4b1", + "version" : "1.3.3" + } + }, { "identity" : "swift-identified-collections", "kind" : "remoteSourceControl", diff --git a/WorkflowTesting/Sources/RenderTesterResult.swift b/WorkflowTesting/Sources/RenderTesterResult.swift index b019d73d..ab71c92e 100644 --- a/WorkflowTesting/Sources/RenderTesterResult.swift +++ b/WorkflowTesting/Sources/RenderTesterResult.swift @@ -14,6 +14,7 @@ * limitations under the License. */ +import CustomDump import Workflow import XCTest @@ -135,7 +136,13 @@ extension RenderTesterResult where WorkflowType.State: Equatable { ) rethrows -> RenderTesterResult { var initialState = initialState try modifications(&initialState) - XCTAssertEqual(state, initialState, "Expected state does not match", file: file, line: line) + XCTAssertNoDifference( + initialState, + state, + "Expected state does not match", + file: file, + line: line + ) return self } } diff --git a/WorkflowTesting/Tests/WorkflowRenderTesterFailureTests.swift b/WorkflowTesting/Tests/WorkflowRenderTesterFailureTests.swift index ed7ed7c1..bb69d577 100644 --- a/WorkflowTesting/Tests/WorkflowRenderTesterFailureTests.swift +++ b/WorkflowTesting/Tests/WorkflowRenderTesterFailureTests.swift @@ -341,7 +341,7 @@ final class WorkflowRenderTesterFailureTests: XCTestCase { } } - func test_assertState() { + func test_assertStateModifications() { let result = TestWorkflow() .renderTester(initialState: .idle) .render { _ in }