Add formatUnequalValues struct test coverage

This expands the TestFormatUnequalValues test case to cover the behavior
of the function when provided two struct type'd values.
pull/327/head
Jordan Olshevski 2016-09-24 17:22:54 -07:00
parent a34cbb254a
commit d2b5f58808
1 changed files with 8 additions and 0 deletions

View File

@ -207,6 +207,14 @@ func TestFormatUnequalValues(t *testing.T) {
expected, actual = formatUnequalValues(int64(123), int32(123))
Equal(t, `int64(123)`, expected, "value should include type")
Equal(t, `int32(123)`, actual, "value should include type")
type testStructType struct {
Val string
}
expected, actual = formatUnequalValues(&testStructType{Val: "test"}, &testStructType{Val: "test"})
Equal(t, `&assert.testStructType{Val:"test"}`, expected, "value should not include type annotation")
Equal(t, `&assert.testStructType{Val:"test"}`, actual, "value should not include type annotation")
}
func TestNotNil(t *testing.T) {