3 ms·
> Nobody wants to write and maintain matchers that > look like: Expect(foo).To(EqualInt64(3)) And nobody does do that. Idiomatic Go is to write if fo
by redbad 13y ago
> Nobody wants to write and maintain matchers that
> look like: Expect(foo).To(EqualInt64(3))
And nobody does do that. Idiomatic Go is to write
if foo != 3 {
t.Errorf("foo: expected 3, got %d", foo)
}
I truly cannot explain why _so many people_ find this style of testing _so objectionable_ that they invent entire DSLs to avoid it.
- onsi 13y agoDoing this for every test: t.Errorf("foo: expected 3, got %d", foo) gets old quickly.