| 1054 | } |
| 1055 | |
| 1056 | func 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 | |
| 1077 | func Test_getLen(t *testing.T) { |
| 1078 | falseCases := []interface{}{ |