mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-07 01:32:56 +08:00
add go reference
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
[](https://travis-ci.org/HDT3213/godis)
|
[](https://travis-ci.org/HDT3213/godis)
|
||||||
[](https://coveralls.io/github/HDT3213/godis?branch=master)
|
[](https://coveralls.io/github/HDT3213/godis?branch=master)
|
||||||
[](https://goreportcard.com/report/github.com/HDT3213/godis)
|
[](https://goreportcard.com/report/github.com/HDT3213/godis)
|
||||||
|
[](https://pkg.go.dev/github.com/hdt3213/godis)
|
||||||
|
|
||||||
[中文版](https://github.com/hdt3213/godis/blob/master/README_CN.md)
|
[中文版](https://github.com/hdt3213/godis/blob/master/README_CN.md)
|
||||||
|
|
||||||
|
@@ -316,11 +316,3 @@ func Make(vals ...interface{}) *LinkedList {
|
|||||||
}
|
}
|
||||||
return &list
|
return &list
|
||||||
}
|
}
|
||||||
|
|
||||||
func MakeBytesList(vals ...[]byte) *LinkedList {
|
|
||||||
list := LinkedList{}
|
|
||||||
for _, v := range vals {
|
|
||||||
list.Add(v)
|
|
||||||
}
|
|
||||||
return &list
|
|
||||||
}
|
|
||||||
|
@@ -30,6 +30,16 @@ func TestAdd(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestLinkedList_Contains(t *testing.T) {
|
||||||
|
list := Make(1, 2, 3, 4)
|
||||||
|
if !list.Contains(1) {
|
||||||
|
t.Error("expect true actual false")
|
||||||
|
}
|
||||||
|
if list.Contains(-1) {
|
||||||
|
t.Error("expect false actual true")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestGet(t *testing.T) {
|
func TestGet(t *testing.T) {
|
||||||
list := Make()
|
list := Make()
|
||||||
for i := 0; i < 10; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
|
Reference in New Issue
Block a user