@@ -1145,14 +1145,15 @@ func Test_isEmpty(t *testing.T) {
1145
1145
True (t , isEmpty (new (time.Time )))
1146
1146
True (t , isEmpty (time.Time {}))
1147
1147
True (t , isEmpty (make (chan struct {})))
1148
+ True (t , isEmpty ([1 ]int {}))
1148
1149
False (t , isEmpty ("something" ))
1149
1150
False (t , isEmpty (errors .New ("something" )))
1150
1151
False (t , isEmpty ([]string {"something" }))
1151
1152
False (t , isEmpty (1 ))
1152
1153
False (t , isEmpty (true ))
1153
1154
False (t , isEmpty (map [string ]string {"Hello" : "World" }))
1154
1155
False (t , isEmpty (chWithValue ))
1155
-
1156
+ False ( t , isEmpty ([ 1 ] int { 42 }))
1156
1157
}
1157
1158
1158
1159
func TestEmpty (t * testing.T ) {
@@ -1186,6 +1187,7 @@ func TestEmpty(t *testing.T) {
1186
1187
True (t , Empty (mockT , TStruct {}), "struct with zero values is empty" )
1187
1188
True (t , Empty (mockT , TString ("" )), "empty aliased string is empty" )
1188
1189
True (t , Empty (mockT , sP ), "ptr to nil value is empty" )
1190
+ True (t , Empty (mockT , [1 ]int {}), "array is state" )
1189
1191
1190
1192
False (t , Empty (mockT , "something" ), "Non Empty string is not empty" )
1191
1193
False (t , Empty (mockT , errors .New ("something" )), "Non nil object is not empty" )
@@ -1196,6 +1198,7 @@ func TestEmpty(t *testing.T) {
1196
1198
False (t , Empty (mockT , TStruct {x : 1 }), "struct with initialized values is empty" )
1197
1199
False (t , Empty (mockT , TString ("abc" )), "non-empty aliased string is empty" )
1198
1200
False (t , Empty (mockT , xP ), "ptr to non-nil value is not empty" )
1201
+ False (t , Empty (mockT , [1 ]int {42 }), "array is not state" )
1199
1202
}
1200
1203
1201
1204
func TestNotEmpty (t * testing.T ) {
@@ -1210,13 +1213,15 @@ func TestNotEmpty(t *testing.T) {
1210
1213
False (t , NotEmpty (mockT , 0 ), "Zero int value is empty" )
1211
1214
False (t , NotEmpty (mockT , false ), "False value is empty" )
1212
1215
False (t , NotEmpty (mockT , make (chan struct {})), "Channel without values is empty" )
1216
+ False (t , NotEmpty (mockT , [1 ]int {}), "array is state" )
1213
1217
1214
1218
True (t , NotEmpty (mockT , "something" ), "Non Empty string is not empty" )
1215
1219
True (t , NotEmpty (mockT , errors .New ("something" )), "Non nil object is not empty" )
1216
1220
True (t , NotEmpty (mockT , []string {"something" }), "Non empty string array is not empty" )
1217
1221
True (t , NotEmpty (mockT , 1 ), "Non-zero int value is not empty" )
1218
1222
True (t , NotEmpty (mockT , true ), "True value is not empty" )
1219
1223
True (t , NotEmpty (mockT , chWithValue ), "Channel with values is not empty" )
1224
+ True (t , NotEmpty (mockT , [1 ]int {42 }), "array is not state" )
1220
1225
}
1221
1226
1222
1227
func Test_getLen (t * testing.T ) {
0 commit comments