(t *testing.T)
| 6 | ) |
| 7 | |
| 8 | func TestStackCountBool(t *testing.T) { |
| 9 | stack := NewStack() |
| 10 | stack.Push(1) |
| 11 | stack.Push(2) |
| 12 | n := stack.CountBool(false) |
| 13 | if n > 0 { |
| 14 | t.Errorf("Want %d, got %d", 0, n) |
| 15 | } |
| 16 | |
| 17 | stack.Push(false) |
| 18 | n = stack.CountBool(false) |
| 19 | if n != 1 { |
| 20 | t.Errorf("Want %d, got %d", 1, n) |
| 21 | } |
| 22 | |
| 23 | stack.Push(true) |
| 24 | n = stack.CountBool(true) |
| 25 | if n != 1 { |
| 26 | t.Errorf("Want %d, got %d", 1, n) |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | func TestStack(t *testing.T) { |
| 31 | stack := NewStack() |