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

Function TestExactly

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

Source from the content-addressed store, hash-verified

872}
873
874func TestExactly(t *testing.T) {
875
876 mockT := new(testing.T)
877
878 a := float32(1)
879 b := float64(1)
880 c := float32(1)
881 d := float32(2)
882 cases := []struct {
883 expected interface{}
884 actual interface{}
885 result bool
886 }{
887 {a, b, false},
888 {a, d, false},
889 {a, c, true},
890 {nil, a, false},
891 {a, nil, false},
892 }
893
894 for _, c := range cases {
895 t.Run(fmt.Sprintf("Exactly(%#v, %#v)", c.expected, c.actual), func(t *testing.T) {
896 res := Exactly(mockT, c.expected, c.actual)
897
898 if res != c.result {
899 t.Errorf("Exactly(%#v, %#v) should return %#v", c.expected, c.actual, c.result)
900 }
901 })
902 }
903}
904
905func TestNotEqual(t *testing.T) {
906

Callers

nothing calls this directly

Calls 3

ExactlyFunction · 0.70
RunMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected