mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 00:22:41 +08:00
容器
This commit is contained in:
24
collections/stack_test.go
Normal file
24
collections/stack_test.go
Normal 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)
|
||||
}
|
Reference in New Issue
Block a user