- clarify vector comment

- adjusted a test to check claim

R=rsc
DELTA=3  (2 added, 0 deleted, 1 changed)
OCL=34454
CL=34456
This commit is contained in:
Robert Griesemer 2009-09-08 14:29:41 -07:00
parent a4448a97d8
commit 019e14e32e
2 changed files with 3 additions and 1 deletions

View File

@ -12,6 +12,7 @@ type Element interface {}
// Vector is the container itself.
// The zero value for Vector is an empty vector ready to use.
type Vector struct {
a []Element
}

View File

@ -52,7 +52,7 @@ func TestAccess(t *testing.T) {
func TestInsertDeleteClear(t *testing.T) {
const n = 100;
a := New(0);
var a Vector;
for i := 0; i < n; i++ {
if a.Len() != i { t.Errorf("A) wrong len %d (expected %d)", a.Len(), i) }
@ -189,6 +189,7 @@ func TestDo(t *testing.T) {
}
}
func TestIter(t *testing.T) {
const Len = 100;
x := New(Len);