1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 00:22:41 +08:00
Files
go-mixed/collections/stack_test.go
2022-05-04 23:46:48 +08:00

25 lines
505 B
Go

package collections_test
import (
"testing"
"github.com/charlienet/go-mixed/collections"
)
func TestStack(t *testing.T) {
arrayStack := collections.NewArrayStack[string]()
arrayStack.Push("cat")
arrayStack.Push("dog")
arrayStack.Push("hen")
t.Log("size:", arrayStack.Size())
t.Log("pop:", arrayStack.Pop())
t.Log("pop:", arrayStack.Pop())
t.Log("size:", arrayStack.Size())
arrayStack.Push("drag")
t.Log("pop:", arrayStack.Pop())
arrayStack.Push("test")
s := arrayStack.Pop()
t.Log(s)
}