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

Function TestValueAssertionFunc

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

Source from the content-addressed store, hash-verified

2609}
2610
2611func TestValueAssertionFunc(t *testing.T) {
2612 tests := []struct {
2613 name string
2614 value interface{}
2615 assertion ValueAssertionFunc
2616 }{
2617 {"notNil", true, NotNil},
2618 {"nil", nil, Nil},
2619 {"empty", []int{}, Empty},
2620 {"notEmpty", []int{1}, NotEmpty},
2621 {"zero", false, Zero},
2622 {"notZero", 42, NotZero},
2623 }
2624
2625 for _, tt := range tests {
2626 t.Run(tt.name, func(t *testing.T) {
2627 tt.assertion(t, tt.value)
2628 })
2629 }
2630}
2631
2632func ExampleBoolAssertionFunc() {
2633 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…