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/stack_test.go
2022-11-18 16:56:56 +08:00

25 lines
499 B
Go

package stack_test
import (
"testing"
"github.com/charlienet/go-mixed/collections/stack"
)
func TestStack(t *testing.T) {
arrayStack := stack.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)
}