import "testing"
-
func TestZeroLen(t *testing.T) {
a := new(Vector)
if a.Len() != 0 {
}
}
-
func TestResize(t *testing.T) {
var a Vector
checkSize(t, &a, 0, 0)
checkSize(t, a.Resize(11, 100), 11, 100)
}
-
func TestResize2(t *testing.T) {
var a Vector
checkSize(t, &a, 0, 0)
}
}
-
func checkZero(t *testing.T, a *Vector, i int) {
for j := 0; j < i; j++ {
if a.At(j) == zero {
}
}
-
func TestTrailingElements(t *testing.T) {
var a Vector
for i := 0; i < 10; i++ {
checkZero(t, &a, 5)
}
-
func TestAccess(t *testing.T) {
const n = 100
var a Vector
}
}
-
func TestInsertDeleteClear(t *testing.T) {
const n = 100
var a Vector
}
}
-
func verify_slice(t *testing.T, x *Vector, elt, i, j int) {
for k := i; k < j; k++ {
if elem2Value(x.At(k)) != int2Value(elt) {
}
}
-
func verify_pattern(t *testing.T, x *Vector, a, b, c int) {
n := a + b + c
if x.Len() != n {
verify_slice(t, x, 0, a+b, n)
}
-
func make_vector(elt, len int) *Vector {
x := new(Vector).Resize(len, 0)
for i := 0; i < len; i++ {
return x
}
-
func TestInsertVector(t *testing.T) {
// 1
a := make_vector(0, 0)
verify_pattern(t, a, 8, 1000, 2)
}
-
func TestDo(t *testing.T) {
const n = 25
const salt = 17
}
-
func TestVectorCopy(t *testing.T) {
// verify Copy() returns a copy, not simply a slice of the original vector
const Len = 10