Add UniqueForFileExtension to allow snapshots with different extension to coexist
Fix https://github.com/VerifyTests/Verify/issues/1081
how would this work given a single call to Verify can produce multiple files with different file extensions?
how would this work given a single call to Verify can produce multiple files with different file extensions?
I think the concept that I'm trying to describe is that Verify should optionally leave files alone if they do not have an extension overlapping with the verified list of targets. The default behavior is that files with matching prefix but different extension are deleted as part of the verify process.
I added a couple of tests to ensure the behavior. In psuedo code Verify(txt, xml) followed by Verify(csv, log) should be workable since all of those snapshot files have different paths. But Verify(txt, xml) following by Verify(xml, log) (where the snapshot with xml extension is checked for two different contents) will fail as expected.
Is there another approach I should take with this PR? I'd like to use file extension as a differentiator in a snapshot file instead of having the verify process delete these different files.
what if i changed the behavior to "multiple test cannot produce the same verified file" ?
what if i changed the behavior to "multiple test cannot produce the same verified file" ?
This sounds like a "block" rather than "allow" behavior. For that idea, what would happen if Verify call 1 produces foo.verified.txt and Verify call 2 produces foo.verified.csv? Verify call 2 would fail? I think I'm a little unclear on what that means.
I'd be happy to give it a try if you have a POC or can guide me to implementing the behavior you're thinking of!
For that idea, what would happen if Verify call 1 produces foo.verified.txt and Verify call 2 produces foo.verified.csv? Verify call 2 would fail?
no it would not fail
i will put together the change and let u know tomorrow
closing this one. I suggest instead you submit a PR that meets your requirements with a single Verify call