This PR adds SnapshotTesting.diffToolBuilder closure for building complex diff tool command messages or clickable urls in Xcode. It takes the existing and the failure snapshot as arguments, and thus complex commands which are not just prefixed with the existing diffTool can be created.
For instance, to open Differati from a clickable link in Xcode the following diffToolBuilder closure can be provided, which URL encodes the paths (in case they contain spaces etc) and builds an url openable by the app:
This PR adds
SnapshotTesting.diffToolBuilder
closure for building complex diff tool command messages or clickable urls in Xcode. It takes the existing and the failure snapshot as arguments, and thus complex commands which are not just prefixed with the existingdiffTool
can be created.For instance, to open Differati from a clickable link in Xcode the following
diffToolBuilder
closure can be provided, which URL encodes the paths (in case they contain spaces etc) and builds an url openable by the app:Which gives us an Xcode test failure bubble like this, with a clickable url that takes us directly into the diffing app:![image](https://github.com/pointfreeco/swift-snapshot-testing/assets/23626/9f374199-93dc-465e-9374-e689695753a5)
Or it can be used to build a complex diff command with the path arguments aren't simply a suffix, as requested in #780: