swift-snapshot-testing icon indicating copy to clipboard operation
swift-snapshot-testing copied to clipboard

Returns a Diff for the same UIImage.

Open FelixNievelstein opened this issue 3 years ago • 0 comments

I have the problem that I get the error message for two identical images: "Snapshot does not match reference." That's why I took a closer look at the algorithm,

The method compare in the UIImage Extension returns true if the differentPixelsCount is 0 and the precision is 1. That leads to the failure message: "Newly-taken snapshot does not match reference." If I understand the algorithm correctly the following if statement should use >= instead of >. https://github.com/pointfreeco/swift-snapshot-testing/blob/567c66adf318612f9482fdaf62c09df1aa57ee87/Sources/SnapshotTesting/Snapshotting/UIImage.swift#L107

Is anyone able to help me?

FelixNievelstein avatar Jul 13 '22 10:07 FelixNievelstein