MCPcopy
hub / github.com/expr-lang/expr / TestFormatUnequalValues

Function TestFormatUnequalValues

internal/testify/assert/assertions_test.go:720–744  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

718}
719
720func TestFormatUnequalValues(t *testing.T) {
721 expected, actual := formatUnequalValues("foo", "bar")
722 Equal(t, `"foo"`, expected, "value should not include type")
723 Equal(t, `"bar"`, actual, "value should not include type")
724
725 expected, actual = formatUnequalValues(123, 123)
726 Equal(t, `123`, expected, "value should not include type")
727 Equal(t, `123`, actual, "value should not include type")
728
729 expected, actual = formatUnequalValues(int64(123), int32(123))
730 Equal(t, `int64(123)`, expected, "value should include type")
731 Equal(t, `int32(123)`, actual, "value should include type")
732
733 expected, actual = formatUnequalValues(int64(123), nil)
734 Equal(t, `int64(123)`, expected, "value should include type")
735 Equal(t, `<nil>(<nil>)`, actual, "value should include type")
736
737 type testStructType struct {
738 Val string
739 }
740
741 expected, actual = formatUnequalValues(&testStructType{Val: "test"}, &testStructType{Val: "test"})
742 Equal(t, `&assert.testStructType{Val:"test"}`, expected, "value should not include type annotation")
743 Equal(t, `&assert.testStructType{Val:"test"}`, actual, "value should not include type annotation")
744}
745
746func TestNotNil(t *testing.T) {
747

Callers

nothing calls this directly

Calls 2

formatUnequalValuesFunction · 0.85
EqualFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…