| 1541 | } |
| 1542 | |
| 1543 | func Test_isEmpty(t *testing.T) { |
| 1544 | |
| 1545 | chWithValue := make(chan struct{}, 1) |
| 1546 | chWithValue <- struct{}{} |
| 1547 | |
| 1548 | True(t, isEmpty("")) |
| 1549 | True(t, isEmpty(nil)) |
| 1550 | True(t, isEmpty([]string{})) |
| 1551 | True(t, isEmpty(0)) |
| 1552 | True(t, isEmpty(int32(0))) |
| 1553 | True(t, isEmpty(int64(0))) |
| 1554 | True(t, isEmpty(false)) |
| 1555 | True(t, isEmpty(map[string]string{})) |
| 1556 | True(t, isEmpty(new(time.Time))) |
| 1557 | True(t, isEmpty(time.Time{})) |
| 1558 | True(t, isEmpty(make(chan struct{}))) |
| 1559 | True(t, isEmpty([1]int{})) |
| 1560 | False(t, isEmpty("something")) |
| 1561 | False(t, isEmpty(errors.New("something"))) |
| 1562 | False(t, isEmpty([]string{"something"})) |
| 1563 | False(t, isEmpty(1)) |
| 1564 | False(t, isEmpty(true)) |
| 1565 | False(t, isEmpty(map[string]string{"Hello": "World"})) |
| 1566 | False(t, isEmpty(chWithValue)) |
| 1567 | False(t, isEmpty([1]int{42})) |
| 1568 | } |
| 1569 | |
| 1570 | func TestEmpty(t *testing.T) { |
| 1571 | |