1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-19 10:56:06 -05:00
v2fly/common/collect/sized_queue_test.go
2016-01-11 23:04:24 +01:00

19 lines
401 B
Go

package collect_test
import (
"testing"
"github.com/v2ray/v2ray-core/common/collect"
v2testing "github.com/v2ray/v2ray-core/testing"
"github.com/v2ray/v2ray-core/testing/assert"
)
func TestSizedQueue(t *testing.T) {
v2testing.Current(t)
queue := collect.NewSizedQueue(2)
assert.Pointer(queue.Put(1)).IsNil()
assert.Pointer(queue.Put(2)).IsNil()
assert.Int(queue.Put(3).(int)).Equals(1)
}