MCPcopy Create free account
hub / github.com/jmespath/go-jmespath / TestNotEmpty

Function TestNotEmpty

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

Source from the content-addressed store, hash-verified

1054}
1055
1056func TestNotEmpty(t *testing.T) {
1057
1058 mockT := new(testing.T)
1059 chWithValue := make(chan struct{}, 1)
1060 chWithValue <- struct{}{}
1061
1062 False(t, NotEmpty(mockT, ""), "Empty string is empty")
1063 False(t, NotEmpty(mockT, nil), "Nil is empty")
1064 False(t, NotEmpty(mockT, []string{}), "Empty string array is empty")
1065 False(t, NotEmpty(mockT, 0), "Zero int value is empty")
1066 False(t, NotEmpty(mockT, false), "False value is empty")
1067 False(t, NotEmpty(mockT, make(chan struct{})), "Channel without values is empty")
1068
1069 True(t, NotEmpty(mockT, "something"), "Non Empty string is not empty")
1070 True(t, NotEmpty(mockT, errors.New("something")), "Non nil object is not empty")
1071 True(t, NotEmpty(mockT, []string{"something"}), "Non empty string array is not empty")
1072 True(t, NotEmpty(mockT, 1), "Non-zero int value is not empty")
1073 True(t, NotEmpty(mockT, true), "True value is not empty")
1074 True(t, NotEmpty(mockT, chWithValue), "Channel with values is not empty")
1075}
1076
1077func Test_getLen(t *testing.T) {
1078 falseCases := []interface{}{

Callers

nothing calls this directly

Calls 3

FalseFunction · 0.70
NotEmptyFunction · 0.70
TrueFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…