aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/container/vector/stringvector_test.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2010-07-12 13:51:42 -0700
committerRobert Griesemer <gri@golang.org>2010-07-12 13:51:42 -0700
commit345f9c9eb283dafb0724e0ebc53f1412e0b97dad (patch)
treed20a793947400a04761d512e2a93bb7e1d7be847 /src/pkg/container/vector/stringvector_test.go
parent89192ce4fefbd618d91823bd7c4deb7d45786d9c (diff)
downloadgo-345f9c9eb283dafb0724e0ebc53f1412e0b97dad.tar.xz
container/vector: remove Iter() from interface
(Iter() is almost never the right mechanism to call. Per discussion with rsc.) R=rsc CC=golang-dev https://golang.org/cl/1771043
Diffstat (limited to 'src/pkg/container/vector/stringvector_test.go')
-rw-r--r--src/pkg/container/vector/stringvector_test.go47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/pkg/container/vector/stringvector_test.go b/src/pkg/container/vector/stringvector_test.go
index 859dac2fde..1c05145a24 100644
--- a/src/pkg/container/vector/stringvector_test.go
+++ b/src/pkg/container/vector/stringvector_test.go
@@ -326,53 +326,6 @@ func TestStrDo(t *testing.T) {
}
-func TestStrIter(t *testing.T) {
- const Len = 100
- x := new(StringVector).Resize(Len, 0)
- for i := 0; i < Len; i++ {
- x.Set(i, int2StrValue(i*i))
- }
- i := 0
- for v := range x.Iter() {
- if elem2StrValue(v) != int2StrValue(i*i) {
- t.Error(tname(x), "Iter expected", i*i, "got", elem2StrValue(v))
- }
- i++
- }
- if i != Len {
- t.Error(tname(x), "Iter stopped at", i, "not", Len)
- }
- y := new(StringVector).Resize(Len, 0)
- for i := 0; i < Len; i++ {
- (*y)[i] = int2StrValue(i * i)
- }
- i = 0
- for v := range y.Iter() {
- if elem2StrValue(v) != int2StrValue(i*i) {
- t.Error(tname(y), "y, Iter expected", i*i, "got", elem2StrValue(v))
- }
- i++
- }
- if i != Len {
- t.Error(tname(y), "y, Iter stopped at", i, "not", Len)
- }
- var z StringVector
- z.Resize(Len, 0)
- for i := 0; i < Len; i++ {
- z[i] = int2StrValue(i * i)
- }
- i = 0
- for v := range z.Iter() {
- if elem2StrValue(v) != int2StrValue(i*i) {
- t.Error(tname(z), "z, Iter expected", i*i, "got", elem2StrValue(v))
- }
- i++
- }
- if i != Len {
- t.Error(tname(z), "z, Iter stopped at", i, "not", Len)
- }
-}
-
func TestStrVectorData(t *testing.T) {
// verify Data() returns a slice of a copy, not a slice of the original vector
const Len = 10