mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 08:32:40 +08:00
list
This commit is contained in:
40
collections/list/array_list_test.go
Normal file
40
collections/list/array_list_test.go
Normal file
@ -0,0 +1,40 @@
|
||||
package list_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/charlienet/go-mixed/collections/list"
|
||||
)
|
||||
|
||||
func TestNewArrayList(t *testing.T) {
|
||||
l := list.NewArrayList[int]()
|
||||
|
||||
_ = l
|
||||
}
|
||||
|
||||
func TestArrayPushBack(t *testing.T) {
|
||||
l := list.NewArrayList[int]()
|
||||
|
||||
l.PushBack(1)
|
||||
l.PushBack(2)
|
||||
l.PushBack(3)
|
||||
|
||||
l.ForEach(func(i int) {
|
||||
t.Log(i)
|
||||
})
|
||||
}
|
||||
|
||||
func TestArrayPushFront(t *testing.T) {
|
||||
l := list.NewArrayList[int]()
|
||||
|
||||
l.PushFront(1)
|
||||
l.PushFront(2)
|
||||
l.PushFront(3)
|
||||
|
||||
l.PushBack(99)
|
||||
l.PushBack(88)
|
||||
|
||||
l.ForEach(func(i int) {
|
||||
t.Log(i)
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user