1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 08:32:40 +08:00

collection

This commit is contained in:
2022-11-18 16:56:56 +08:00
parent f3ca69f159
commit cf30b4eb4c
8 changed files with 159 additions and 0 deletions

View File

@ -0,0 +1,24 @@
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)
}