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

Function TestValueOf

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

Source from the content-addressed store, hash-verified

16}
17
18func TestValueOf(t *testing.T) {
19 t.Parallel()
20
21 assert := internal.NewAssert(t, "TestValueOf")
22
23 list := NewList([]int{1, 2, 3})
24 v, ok := list.ValueOf(0)
25 assert.Equal(1, *v)
26 assert.Equal(true, ok)
27
28 _, ok = list.ValueOf(3)
29 assert.Equal(false, ok)
30}
31
32func TestIndexOf(t *testing.T) {
33 t.Parallel()

Callers

nothing calls this directly

Calls 4

EqualMethod · 0.95
NewAssertFunction · 0.92
NewListFunction · 0.85
ValueOfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…