|
|
@ -130,15 +130,24 @@ func (s streamTest) run(t *testing.T) {
|
|
|
|
c, e := make(chan value), make(chan error)
|
|
|
|
c, e := make(chan value), make(chan error)
|
|
|
|
r := strings.NewReader(s[0].(string))
|
|
|
|
r := strings.NewReader(s[0].(string))
|
|
|
|
go streamValues(r, c, e)
|
|
|
|
go streamValues(r, c, e)
|
|
|
|
for i := 1; i < len(s); i++ {
|
|
|
|
count := 1
|
|
|
|
|
|
|
|
for {
|
|
|
|
select {
|
|
|
|
select {
|
|
|
|
case v := <-c:
|
|
|
|
case v, ok := <-c:
|
|
|
|
if !eq(s[i], v) {
|
|
|
|
if !ok {
|
|
|
|
t.Errorf("expected %v, got %v", s[i], v)
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if !eq(s[count], v) {
|
|
|
|
|
|
|
|
t.Errorf("expected %q, got %q", s[count], v)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
case err, ok := <-e:
|
|
|
|
|
|
|
|
if !ok {
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case err := <-e:
|
|
|
|
|
|
|
|
t.Error(err)
|
|
|
|
t.Error(err)
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
count++
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|