We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First of all, thanks for the awesome library!
We have written a custom Nimble <-> swift-snapshot-testing integration that essentially looks like this:
public func matchSnapshot<T, Format>(named name: String? = nil, as format: Snapshotting<T, Format>, file: StaticString = #file, line: UInt = #line) -> Predicate<T> { return Predicate { (actualExpression: Expression<T>) throws -> PredicateResult in let msg = ExpectationMessage.expectedTo(name != nil ? "match snapshot '\(name!)'" : "match snapshot") if let actualValue = try actualExpression.evaluate() { if let failure = verifySnapshot(matching: actualValue, as: format, named: name, file: file, testName: QuickSpec.current.shortName, line: line) { return PredicateResult( status: .fail, message: msg.appended(details: failure) // ^^^^^^^^^^^^^^^^^ // expected appended `details` to preserve newlines ) } return PredicateResult(status: .matches, message: msg) } else { return PredicateResult( status: .fail, message: msg.appendedBeNilHint() ) } } }
When not nil, failure is a multi-line string diff between the actual value and the snapshot.
nil
failure
We expected that Nimble would preserve the newlines in the extended failure message.
Instead, newlines in the extended failure message appear to be unconditionally stripped, which renders the snapshot diffs unusable:
Nimble/Sources/Nimble/FailureMessage.swift
Line 59 in 0bf627c
This also seems to violate the documented intent of appended(details: String):
appended(details: String)
For a more comprehensive message that spans multiple lines, use appended(details: String) instead
List the software versions you're using:
Please also mention which package manager you used and its version. Delete the other package managers in this list:
The text was updated successfully, but these errors were encountered:
Going to prioritize this for v11 (assuming this is something we can actually fix and not, like, an Xcode/xctest limitation).
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
What did you do?
First of all, thanks for the awesome library!
We have written a custom Nimble <-> swift-snapshot-testing integration that essentially looks like this:
When not
nil
,failure
is a multi-line string diff between the actual value and the snapshot.What did you expect to happen?
We expected that Nimble would preserve the newlines in the extended failure message.
What actually happened instead?
Instead, newlines in the extended failure message appear to be unconditionally stripped, which renders the snapshot diffs unusable:
Nimble/Sources/Nimble/FailureMessage.swift
Line 59 in 0bf627c
This also seems to violate the documented intent of
appended(details: String)
:Environment
List the software versions you're using:
Please also mention which package manager you used and its version. Delete the
other package managers in this list:
The text was updated successfully, but these errors were encountered: