MCPcopy
hub / github.com/stretchr/testify / TestExactly

Function TestExactly

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

Source from the content-addressed store, hash-verified

908}
909
910func TestExactly(t *testing.T) {
911 t.Parallel()
912 mockT := new(testing.T)
913
914 a := float32(1)
915 b := float64(1)
916 c := float32(1)
917 d := float32(2)
918 cases := []struct {
919 expected interface{}
920 actual interface{}
921 result bool
922 }{
923 {a, b, false},
924 {a, d, false},
925 {a, c, true},
926 {nil, a, false},
927 {a, nil, false},
928 }
929
930 for _, c := range cases {
931 t.Run(fmt.Sprintf("Exactly(%#v, %#v)", c.expected, c.actual), func(t *testing.T) {
932 res := Exactly(mockT, c.expected, c.actual)
933
934 if res != c.result {
935 t.Errorf("Exactly(%#v, %#v) should return %#v", c.expected, c.actual, c.result)
936 }
937 })
938 }
939}
940
941func TestNotEqual(t *testing.T) {
942 t.Parallel()

Callers

nothing calls this directly

Calls 3

ExactlyFunction · 0.70
ErrorfMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected