MCPcopy Create free account
hub / github.com/stretchr/testify / TestFormatUnequalValues

Function TestFormatUnequalValues

assert/assertions_test.go:790–814  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

788}
789
790func TestFormatUnequalValues(t *testing.T) {
791 expected, actual := formatUnequalValues("foo", "bar")
792 Equal(t, `"foo"`, expected, "value should not include type")
793 Equal(t, `"bar"`, actual, "value should not include type")
794
795 expected, actual = formatUnequalValues(123, 123)
796 Equal(t, `123`, expected, "value should not include type")
797 Equal(t, `123`, actual, "value should not include type")
798
799 expected, actual = formatUnequalValues(int64(123), int32(123))
800 Equal(t, `int64(123)`, expected, "value should include type")
801 Equal(t, `int32(123)`, actual, "value should include type")
802
803 expected, actual = formatUnequalValues(int64(123), nil)
804 Equal(t, `int64(123)`, expected, "value should include type")
805 Equal(t, `<nil>(<nil>)`, actual, "value should include type")
806
807 type testStructType struct {
808 Val string
809 }
810
811 expected, actual = formatUnequalValues(&testStructType{Val: "test"}, &testStructType{Val: "test"})
812 Equal(t, `&assert.testStructType{Val:"test"}`, expected, "value should not include type annotation")
813 Equal(t, `&assert.testStructType{Val:"test"}`, actual, "value should not include type annotation")
814}
815
816func TestNotNil(t *testing.T) {
817

Callers

nothing calls this directly

Calls 2

formatUnequalValuesFunction · 0.85
EqualFunction · 0.70

Tested by

no test coverage detected