4 ms·
I'm curious what benefits you would gain in the testify API by adding generics?
by ivanvanderbyl 3y ago
I'm curious what benefits you would gain in the testify API by adding generics?
- peter_l_downs 3y agoFinished, take a look if you're curious -- https://github.com/peterldowns/testy https://github.com/peterldowns/testy
- peter_l_downs 3y agoIt's not that large of a benefit, but when performing tests comparing two objects, I sometimes pass the wrong object type in. Most of the times this is happening, I'm refactoring existing code and updating tests as I go. It would be nice to see all the errors at compile time (and therefore in my editor's problems/quickfix view) rather than having to run the full test suite to find all the tests I forgot to update. I think it's possible to keep the implementation of testify almost (or exactly) the same, but update the type signatures of the methods to use generics, and shift-left a lot of errors to compile time. Just a nice-to-have.