▲ 2 ▼ tester - Lightweight utilities to use with Go's testing package
Testing is an integral part of Go; the language provides strong and opinionated support for testing. However, developers who moved from languages like C#, Java, and Python miss the convenience of test utilities like assertions and data providers for data-driven tests. That's why we started Tester: lightweight test utilities to use with Go's testing package. Features:
* Assertions that make tests easier to read, write, and debug
* Streamlined data providers for data-driven testing (DDT)
* Test hooks' hygiene check
Register to comment or vote on this story
I'm pretty happy with the standard library testing, an assertion is simply an if statement, and they're really building a DSL with things like: if assert.For(t).ThatActual(err).IsNil().Passed() - I'd rather just test the actual conditions I want explicitly.
Adding a testing library just means now the reader has 2 things to understand - your tests, and the testing library syntax.
I'm not convinced I find the first example more readable though:
I'm reading this as "assert that the check that err is nil passed". It certainly reads like a sentence but `if err == nil` seems much more idiomatic, is shorter, to me is also easier to write and conveys the same meaning.
That said, 10/10 for having an actually useful README with examples I can work from, and get a feel for what this is supposed to do and how it's supposed to work.
Adjusted comment to use code tags, hope that's ok. Will have better formatting soon.
I agree, just realised I posted pretty much the same comment as you!