aliyunpan/library/collection/queue_test.go
2022-06-04 13:20:33 +08:00

25 lines
341 B
Go

package collection
import (
"fmt"
"testing"
)
type item struct {
Name string
}
func (i *item) HashCode() string {
return i.Name
}
func TestRemove(t *testing.T) {
q := NewFifoQueue()
q.Push(&item{Name: "1"})
q.Push(&item{Name: "2"})
q.Push(&item{Name: "3"})
q.Push(&item{Name: "4"})
q.Remove(&item{Name: "3"})
fmt.Println(q)
}