1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 00:22:41 +08:00
This commit is contained in:
2022-03-27 10:23:06 +08:00
parent 4dc4f7ad11
commit 38d75633d9
6 changed files with 246 additions and 0 deletions

24
collections/stack_test.go Normal file
View File

@ -0,0 +1,24 @@
package collections_test
import (
"testing"
"github.com/charlienet/go-mixed/collections"
)
func TestStack(t *testing.T) {
arrayStack := new(collections.ArrayStack)
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().(string)
t.Log(s)
}