MCPcopy
hub / github.com/stretchr/testify / Test_isEmpty

Function Test_isEmpty

assert/assertions_test.go:1734–1855  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1732}
1733
1734func Test_isEmpty(t *testing.T) {
1735 t.Parallel()
1736
1737 chWithValue := make(chan struct{}, 1)
1738 chWithValue <- struct{}{}
1739
1740 True(t, isEmpty(""))
1741 True(t, isEmpty(nil))
1742 True(t, isEmpty(error(nil)))
1743 True(t, isEmpty((*int)(nil)))
1744 True(t, isEmpty((*string)(nil)))
1745 True(t, isEmpty(new(string)))
1746 True(t, isEmpty([]string{}))
1747 True(t, isEmpty([]string(nil)))
1748 True(t, isEmpty([]byte(nil)))
1749 True(t, isEmpty([]byte{}))
1750 True(t, isEmpty([]byte("")))
1751 True(t, isEmpty([]bool(nil)))
1752 True(t, isEmpty([]bool{}))
1753 True(t, isEmpty([]interface{}(nil)))
1754 True(t, isEmpty([]interface{}{}))
1755 True(t, isEmpty(struct{}{}))
1756 True(t, isEmpty(&struct{}{}))
1757 True(t, isEmpty(struct{ A int }{A: 0}))
1758 True(t, isEmpty(struct{ a int }{a: 0}))
1759 True(t, isEmpty(struct {
1760 a int
1761 B int
1762 }{a: 0, B: 0}))
1763 True(t, isEmpty(0))
1764 True(t, isEmpty(int(0)))
1765 True(t, isEmpty(int8(0)))
1766 True(t, isEmpty(int16(0)))
1767 True(t, isEmpty(uint16(0)))
1768 True(t, isEmpty(int32(0)))
1769 True(t, isEmpty(uint32(0)))
1770 True(t, isEmpty(int64(0)))
1771 True(t, isEmpty(uint64(0)))
1772 True(t, isEmpty('\u0000')) // rune => int32
1773 True(t, isEmpty(float32(0)))
1774 True(t, isEmpty(float64(0)))
1775 True(t, isEmpty(0i)) // complex
1776 True(t, isEmpty(0.0i)) // complex
1777 True(t, isEmpty(false))
1778 True(t, isEmpty(new(bool)))
1779 True(t, isEmpty(map[string]string{}))
1780 True(t, isEmpty(map[string]string(nil)))
1781 True(t, isEmpty(new(time.Time)))
1782 True(t, isEmpty(time.Time{}))
1783 True(t, isEmpty(make(chan struct{})))
1784 True(t, isEmpty(chan struct{}(nil)))
1785 True(t, isEmpty(chan<- struct{}(nil)))
1786 True(t, isEmpty(make(chan struct{})))
1787 True(t, isEmpty(make(chan<- struct{})))
1788 True(t, isEmpty(make(chan struct{}, 1)))
1789 True(t, isEmpty(make(chan<- struct{}, 1)))
1790 True(t, isEmpty([1]int{0}))
1791 True(t, isEmpty([2]int{0, 0}))

Callers

nothing calls this directly

Calls 3

isEmptyFunction · 0.85
TrueFunction · 0.70
FalseFunction · 0.70

Tested by

no test coverage detected