MCPcopy Create free account
hub / github.com/expr-lang/expr / TestComparisonAssertionFunc

Function TestComparisonAssertionFunc

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

Source from the content-addressed store, hash-verified

2548}
2549
2550func TestComparisonAssertionFunc(t *testing.T) {
2551 type iface interface {
2552 Name() string
2553 }
2554
2555 tests := []struct {
2556 name string
2557 expect interface{}
2558 got interface{}
2559 assertion ComparisonAssertionFunc
2560 }{
2561 {"implements", (*iface)(nil), t, Implements},
2562 {"isType", (*testing.T)(nil), t, IsType},
2563 {"equal", t, t, Equal},
2564 {"equalValues", t, t, EqualValues},
2565 {"notEqualValues", t, nil, NotEqualValues},
2566 {"exactly", t, t, Exactly},
2567 {"notEqual", t, nil, NotEqual},
2568 {"notContains", []int{1, 2, 3}, 4, NotContains},
2569 {"subset", []int{1, 2, 3, 4}, []int{2, 3}, Subset},
2570 {"notSubset", []int{1, 2, 3, 4}, []int{0, 3}, NotSubset},
2571 {"elementsMatch", []byte("abc"), []byte("bac"), ElementsMatch},
2572 {"regexp", "^t.*y$", "testify", Regexp},
2573 {"notRegexp", "^t.*y$", "Testify", NotRegexp},
2574 }
2575
2576 for _, tt := range tests {
2577 t.Run(tt.name, func(t *testing.T) {
2578 tt.assertion(t, tt.expect, tt.got)
2579 })
2580 }
2581}
2582
2583func ExampleValueAssertionFunc() {
2584 t := &testing.T{} // provided by test

Callers

nothing calls this directly

Calls 1

RunMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…