Skip to content

Conversation

@mbrandonw
Copy link
Member

We found this while working off a feature branch, so just wanting to get it into master.

@mbrandonw mbrandonw requested a review from stephencelis May 25, 2020 19:06
let actionOutput = debugOutput(localAction).indent(by: 2)
let stateOutput =
debugDiff(previousState, nextState).map { "\($0)\n" } ?? " (No state changes)"
debugDiff(previousState, nextState).map { "\($0)\n" } ?? " (No state changes)\n"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seemed to need a newline, found it while writing a test

second.split(separator: "\n", omittingEmptySubsequences: false)[...]
)
guard !differences.isEmpty else { return nil }
if differences.count == 1, case .both = differences[0].which { return nil }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct logic


func testPrint() {
struct Unit: Equatable {}
enum Action: Equatable { case incr, noop }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated test for the "(no changes)" behavior

@mbrandonw mbrandonw changed the title Correct show (no state changes) in diff. Correctly show (no state changes) in diff. May 25, 2020
@mbrandonw mbrandonw merged commit b3d9270 into master May 25, 2020
@mbrandonw mbrandonw deleted the no-state-changes-fix branch May 25, 2020 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants