| 1613 | } |
| 1614 | |
| 1615 | func TestNotEmpty(t *testing.T) { |
| 1616 | |
| 1617 | mockT := new(testing.T) |
| 1618 | chWithValue := make(chan struct{}, 1) |
| 1619 | chWithValue <- struct{}{} |
| 1620 | |
| 1621 | False(t, NotEmpty(mockT, ""), "Empty string is empty") |
| 1622 | False(t, NotEmpty(mockT, nil), "Nil is empty") |
| 1623 | False(t, NotEmpty(mockT, []string{}), "Empty string array is empty") |
| 1624 | False(t, NotEmpty(mockT, 0), "Zero int value is empty") |
| 1625 | False(t, NotEmpty(mockT, false), "False value is empty") |
| 1626 | False(t, NotEmpty(mockT, make(chan struct{})), "Channel without values is empty") |
| 1627 | False(t, NotEmpty(mockT, [1]int{}), "array is state") |
| 1628 | |
| 1629 | True(t, NotEmpty(mockT, "something"), "Non Empty string is not empty") |
| 1630 | True(t, NotEmpty(mockT, errors.New("something")), "Non nil object is not empty") |
| 1631 | True(t, NotEmpty(mockT, []string{"something"}), "Non empty string array is not empty") |
| 1632 | True(t, NotEmpty(mockT, 1), "Non-zero int value is not empty") |
| 1633 | True(t, NotEmpty(mockT, true), "True value is not empty") |
| 1634 | True(t, NotEmpty(mockT, chWithValue), "Channel with values is not empty") |
| 1635 | True(t, NotEmpty(mockT, [1]int{42}), "array is not state") |
| 1636 | } |
| 1637 | |
| 1638 | func Test_getLen(t *testing.T) { |
| 1639 | falseCases := []interface{}{ |