mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 00:22:41 +08:00
容器
This commit is contained in:
22
collections/circlequeue_test.go
Normal file
22
collections/circlequeue_test.go
Normal file
@ -0,0 +1,22 @@
|
||||
package collections
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestCircleQueue(t *testing.T) {
|
||||
q := NewCircleQueue(10)
|
||||
|
||||
t.Log("Size:", q.Size())
|
||||
for i := 0; i < 10; i++ {
|
||||
t.Log(q.Push(i))
|
||||
}
|
||||
|
||||
t.Log("Size:", q.Size())
|
||||
t.Log("IsFull:", q.IsFull())
|
||||
t.Log("Show:", q.Show())
|
||||
|
||||
q.Pop()
|
||||
q.Push(11)
|
||||
q.Pop()
|
||||
|
||||
t.Log("Show:", q.Show())
|
||||
}
|
Reference in New Issue
Block a user