MCPcopy Create free account
hub / github.com/copernet/copernicus / TestStackCountBool

Function TestStackCountBool

util/stack_test.go:8–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6)
7
8func 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
30func TestStack(t *testing.T) {
31 stack := NewStack()

Callers

nothing calls this directly

Calls 3

PushMethod · 0.95
CountBoolMethod · 0.95
NewStackFunction · 0.85

Tested by

no test coverage detected