Commit 019e14e3 authored by Robert Griesemer's avatar Robert Griesemer

- clarify vector comment

- adjusted a test to check claim

R=rsc
DELTA=3  (2 added, 0 deleted, 1 changed)
OCL=34454
CL=34456
parent a4448a97
...@@ -12,6 +12,7 @@ type Element interface {} ...@@ -12,6 +12,7 @@ type Element interface {}
// Vector is the container itself. // Vector is the container itself.
// The zero value for Vector is an empty vector ready to use.
type Vector struct { type Vector struct {
a []Element a []Element
} }
......
...@@ -52,7 +52,7 @@ func TestAccess(t *testing.T) { ...@@ -52,7 +52,7 @@ func TestAccess(t *testing.T) {
func TestInsertDeleteClear(t *testing.T) { func TestInsertDeleteClear(t *testing.T) {
const n = 100; const n = 100;
a := New(0); var a Vector;
for i := 0; i < n; i++ { for i := 0; i < n; i++ {
if a.Len() != i { t.Errorf("A) wrong len %d (expected %d)", a.Len(), 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) { ...@@ -189,6 +189,7 @@ func TestDo(t *testing.T) {
} }
} }
func TestIter(t *testing.T) { func TestIter(t *testing.T) {
const Len = 100; const Len = 100;
x := New(Len); x := New(Len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment