mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-17 01:53:36 -05:00
test case for sized queue
This commit is contained in:
parent
ea080b2ebf
commit
559eadcaf1
18
common/collect/sized_queue_test.go
Normal file
18
common/collect/sized_queue_test.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
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)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user