MCPcopy Index your code
hub / github.com/expr-lang/expr / TestExactly

Function TestExactly

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

Source from the content-addressed store, hash-verified

802}
803
804func TestExactly(t *testing.T) {
805
806 mockT := new(testing.T)
807
808 a := float32(1)
809 b := float64(1)
810 c := float32(1)
811 d := float32(2)
812 cases := []struct {
813 expected interface{}
814 actual interface{}
815 result bool
816 }{
817 {a, b, false},
818 {a, d, false},
819 {a, c, true},
820 {nil, a, false},
821 {a, nil, false},
822 }
823
824 for _, c := range cases {
825 t.Run(fmt.Sprintf("Exactly(%#v, %#v)", c.expected, c.actual), func(t *testing.T) {
826 res := Exactly(mockT, c.expected, c.actual)
827
828 if res != c.result {
829 t.Errorf("Exactly(%#v, %#v) should return %#v", c.expected, c.actual, c.result)
830 }
831 })
832 }
833}
834
835func TestNotEqual(t *testing.T) {
836

Callers

nothing calls this directly

Calls 4

RunMethod · 0.80
SprintfMethod · 0.80
ExactlyFunction · 0.70
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…