Esempio n. 1
0
func TestListOfRefChunks(t *testing.T) {
	assert := assert.New(t)

	a := types.Float32(0)
	ra := a.Ref()

	l := gen.NewListOfRefOfFloat32()
	r := gen.NewRefOfFloat32(ra)

	assert.Len(l.Chunks(), 0)

	l2 := l.Append(r)
	assert.Len(l2.Chunks(), 1)
}
Esempio n. 2
0
func TestListOfRef(t *testing.T) {
	assert := assert.New(t)
	a := types.Float32(0)
	ra := a.Ref()

	l := gen.NewListOfRefOfFloat32()
	r := gen.NewRefOfFloat32(ra)
	l = l.Append(r)
	r2 := l.Get(0)
	assert.True(r.Equals(r2))

	def := l.Def()
	assert.EqualValues(ra, def[0])
}