MCPcopy
hub / github.com/duke-git/lancet / TestInsertAt

Function TestInsertAt

datastructure/list/list_test.go:139–157  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

137}
138
139func TestInsertAt(t *testing.T) {
140 t.Parallel()
141
142 assert := internal.NewAssert(t, "TestInsertAt")
143
144 list := NewList([]int{1, 2, 3})
145
146 list.InsertAt(-1, 0)
147 assert.Equal([]int{1, 2, 3}, list.Data())
148
149 list.InsertAt(4, 0)
150 assert.Equal([]int{1, 2, 3}, list.Data())
151
152 list.InsertAt(0, 0)
153 assert.Equal([]int{0, 1, 2, 3}, list.Data())
154
155 list.InsertAt(4, 4)
156 assert.Equal([]int{0, 1, 2, 3, 4}, list.Data())
157}
158
159func TestPopFirst(t *testing.T) {
160 t.Parallel()

Callers

nothing calls this directly

Calls 5

EqualMethod · 0.95
NewAssertFunction · 0.92
NewListFunction · 0.85
InsertAtMethod · 0.45
DataMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…