testify
testify copied to clipboard
Use %v when formatting objects in assert.Len
Summary
Fix assert.Len's error message for non-%sable values.
Details
It was using %s, which doesn't work if the thing being len'ed is not a
[]string or similar. For example, assert.Len(t, []int{1}, 0) says
that [%!s(int=1)] should have 1 item(s), but has 0. Now it uses %v
which will work for almost anything.
@glesica @boyan-soubachov @mvdkleijn could someone please have a look at this one?
@benjaminjkraft @k1ng440 @wwade Could you instead review #1485 which I plan to merge soon?