MCPcopy Index your code
hub / github.com/CodisLabs/codis / TestMakeGoSlice

Function TestMakeGoSlice

pkg/utils/unsafe2/slice_test.go:12–23  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestMakeGoSlice(t *testing.T) {
13 n := MinOffheapSlice - 1
14 s := MakeSlice(n)
15 assert.Must(s != nil)
16 _, ok := s.(*goSlice)
17 assert.Must(ok)
18
19 c1 := s.Slice2(0, 1)
20 c2 := s.Slice2(0, 2)
21 assert.Must(c1.Parent() == nil)
22 assert.Must(c2.Parent() == nil)
23}
24
25func TestMakeCGoSlice(t *testing.T) {
26 n := MinOffheapSlice * 2

Callers

nothing calls this directly

Calls 3

MakeSliceFunction · 0.85
Slice2Method · 0.65
ParentMethod · 0.65

Tested by

no test coverage detected