testify
testify copied to clipboard
assert.NotSubset incorrecly formats with %q
Description
NotSubset (but not Subset) seems to be using %q to format error output, that doesn't work for many collection element types.
Step To Reproduce
package kata_test
import (
"testing"
"github.com/stretchr/testify/assert"
)
type User struct {
ID, Name string
Age int
}
func TestIfy(t *testing.T) {
assert.NotSubset(t, []bool{true}, []bool{true})
}
Expected behavior
Values of arguments to be formatted well.
Actual behavior
--- FAIL: TestIfy (0.00s)
/Users/brackendawson/src/github.com/brackendawson/kata/kata_test.go:15:
Error Trace: /Users/brackendawson/src/github.com/brackendawson/kata/kata_test.go:15
Error: [%!q(bool=true)] is a subset of [%!q(bool=true)]
Test: TestIfy
FAIL
coverage: 0.0% of statements
FAIL github.com/brackendawson/kata 0.202s
FAIL
I recommend waiting for #1646 before fixing this.