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

Function TestNotEqualValues

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

Source from the content-addressed store, hash-verified

873}
874
875func TestNotEqualValues(t *testing.T) {
876 mockT := new(testing.T)
877
878 cases := []struct {
879 expected interface{}
880 actual interface{}
881 result bool
882 }{
883 // cases that are expected not to match
884 {"Hello World", "Hello World!", true},
885 {123, 1234, true},
886 {123.5, 123.55, true},
887 {[]byte("Hello World"), []byte("Hello World!"), true},
888 {nil, new(AssertionTesterConformingObject), true},
889
890 // cases that are expected to match
891 {nil, nil, false},
892 {"Hello World", "Hello World", false},
893 {123, 123, false},
894 {123.5, 123.5, false},
895 {[]byte("Hello World"), []byte("Hello World"), false},
896 {new(AssertionTesterConformingObject), new(AssertionTesterConformingObject), false},
897 {&struct{}{}, &struct{}{}, false},
898
899 // Different behavior from NotEqual()
900 {func() int { return 23 }, func() int { return 24 }, true},
901 {int(10), int(11), true},
902 {int(10), uint(10), false},
903
904 {struct{}{}, struct{}{}, false},
905 }
906
907 for _, c := range cases {
908 t.Run(fmt.Sprintf("NotEqualValues(%#v, %#v)", c.expected, c.actual), func(t *testing.T) {
909 res := NotEqualValues(mockT, c.expected, c.actual)
910
911 if res != c.result {
912 t.Errorf("NotEqualValues(%#v, %#v) should return %#v", c.expected, c.actual, c.result)
913 }
914 })
915 }
916}
917
918func TestContainsNotContains(t *testing.T) {
919

Callers

nothing calls this directly

Calls 4

RunMethod · 0.80
SprintfMethod · 0.80
NotEqualValuesFunction · 0.70
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…