mirror of
https://github.com/lkmio/lkm.git
synced 2025-10-05 07:06:57 +08:00
20 lines
254 B
Go
20 lines
254 B
Go
package stream
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func TestQueue(t *testing.T) {
|
|
queue := NewQueue(1)
|
|
|
|
for i := 0; i < 100; i++ {
|
|
queue.Push(i)
|
|
}
|
|
|
|
for i := 0; i < 100; i++ {
|
|
pop := queue.PopBack()
|
|
println(fmt.Sprintf("element:%d", pop.(int)))
|
|
}
|
|
}
|