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

Function ExampleBoolAssertionFunc

internal/testify/assert/assertions_test.go:2632–2655  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2630}
2631
2632func ExampleBoolAssertionFunc() {
2633 t := &testing.T{} // provided by test
2634
2635 isOkay := func(x int) bool {
2636 return x >= 42
2637 }
2638
2639 tests := []struct {
2640 name string
2641 arg int
2642 assertion BoolAssertionFunc
2643 }{
2644 {"-1 is bad", -1, False},
2645 {"42 is good", 42, True},
2646 {"41 is bad", 41, False},
2647 {"45 is cool", 45, True},
2648 }
2649
2650 for _, tt := range tests {
2651 t.Run(tt.name, func(t *testing.T) {
2652 tt.assertion(t, isOkay(tt.arg))
2653 })
2654 }
2655}
2656
2657func TestBoolAssertionFunc(t *testing.T) {
2658 tests := []struct {

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…