HSlice
HSlice copied to clipboard
Playing with tests
A bit of stream of consciousness on what's happening here: when reviewing #42, I got confused and followed an itch to rewrite a few helpers. Then I wanted to test the new implementation against the old, and found it awkward to have to switch between /tests and /src, so I started to implement the test suite in the prod modules. I think this would only increase the binary sizes a little, not runtime performance, while on the other hand moving tests and tested code closer together, which would make it more accessible and easier to handle. Kinda what I like about doctests. Then I found that the types accomodate illegal values, and the tests fail because of my naive Arbitrary instances. Then I was calculating how much time I have left before I need to take an extensive break from this project again, and grew a bit weary.
So I decided to at least share how far I got. Maybe you like the idea of testing in prod, and maybe you like my alternative implementations of the helpers. Please steal any and all of it, or give me a thumbs up and I might get this into a mergeable shape at some point.
worth the read, thanks. :)