Closed Jmaharman closed 2 years ago
I think that is a terrific use case for Verify.
The only downside I can think of is that the generated output includes a version number at the first line which will cause the verify tests to fail every time the version is incremented. 🤔
@simoncropp
awesome. a couple of points
The only downside I can think of is that the generated output includes a version number at the first line which will cause the verify tests to fail every time the version is incremented
you should be able to fix that with a scrubber. perhaps ScrubLinesWithReplace? https://github.com/VerifyTests/Verify/blob/main/docs/scrubbers.md#scrublineswithreplace
awesome. a couple of points
- files should be excluded from source control https://github.com/VerifyTests/Verify#received-and-verified
- to help debug CI issues, export received as assets on failure https://github.com/VerifyTests/Verify/blob/main/docs/build-server.md#github-actions
Thanks. I totally missed the part about excluding .received.txt files from source control, but that makes sense. Scrubbing the data before verifying it is a good idea.
.received.txt files from source control
.received.*
since verify can output any format
Cool, I'll try and make those tweaks later today.
Can you also add the same sort to Sqlite while you're in there?
Sorry for the delay, hopefully these complete the loop. Interesting that Sqlite already seemed to be in the expected order, perhaps that is always expected with Sqlite?
This looks great! It will also cut down on some of the verbosity of the unit tests by removing all the printf
output.
I wanted to verify the output of the code in a more automated way, so I've added the Verify.Expecto package to the test project and changed "Print Code" to "Generated Code" so we can acceptance test against that.
If you don't want that reference added just let me know and I'll go with the simpler option of making the ordinal position change.
This is an attempted fix for #11