Example #1
0
func TestPVectorAssocNBig(t *testing.T) {
	v, _ := makeRangePVector(100000)
	var nv iseq.PVector = v
	for i := 0; i < 110000; i++ {
		nv = nv.AssocN(i, i+20)
	}

	if nv.Count() != 110000 {
		t.Error("PVector.AssocN: lots of appends at end of big vector: wrong number of items")
	}
	for i := 0; i < nv.Count(); i++ {
		if nv.Nth(i) != i+20 {
			t.Errorf("PVector.AssocN: lots of appends at end of big vector: bad value at %v", i)
		}
	}
}