There's no tests :disappointed:
andreabedini opened this issue · 2 comments
I was thinking about this on a bike recently. I think we could write some decent property tests fairly easily. The key would be to have an intermediary representation of a foliage repository as a timestamped series of events (as discussed elsewhere). Then:
- It's easy to generate an event series
- No files, just do it in memory
- Easy-ish to shrink, just drop events (with the constraint that you can't drop the introduction of a package version while you still have revisions for it)
- Can do a round-trip test to the "syntax" i.e. the files
- Easy to do "modification" tests, e.g. build a repository and then add a revision event and check that the latest cabal file in the index changes
I like property testing but what I'd like like to start with is some sort of golden/integration testing at the cli level. I want to be able to test (and define) the behaviour of the whole thing from the user POV. I looked around for tooling to do this but I haven't quite found what I am looking for. I guess I can put toghether something on top of tasty-golden.
In any case I have no intention of blocking anyone from contributing any kind of testing 😂