mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
parent
219e59dc4f
commit
612182f4ab
2 changed files with 6 additions and 6 deletions
|
|
@ -29,7 +29,7 @@ func TestSubCloseUnsub(t *testing.T) {
|
||||||
// the point of this test is **not** to panic
|
// the point of this test is **not** to panic
|
||||||
var mux TypeMux
|
var mux TypeMux
|
||||||
mux.Stop()
|
mux.Stop()
|
||||||
sub := mux.Subscribe(int(0))
|
sub := mux.Subscribe(0)
|
||||||
sub.Unsubscribe()
|
sub.Unsubscribe()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@ import (
|
||||||
func TestFeedPanics(t *testing.T) {
|
func TestFeedPanics(t *testing.T) {
|
||||||
{
|
{
|
||||||
var f Feed
|
var f Feed
|
||||||
f.Send(int(2))
|
f.Send(2)
|
||||||
want := feedTypeError{op: "Send", got: reflect.TypeOf(uint64(0)), want: reflect.TypeOf(int(0))}
|
want := feedTypeError{op: "Send", got: reflect.TypeOf(uint64(0)), want: reflect.TypeOf(0)}
|
||||||
if err := checkPanic(want, func() { f.Send(uint64(2)) }); err != nil {
|
if err := checkPanic(want, func() { f.Send(uint64(2)) }); err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
|
|
@ -38,14 +38,14 @@ func TestFeedPanics(t *testing.T) {
|
||||||
var f Feed
|
var f Feed
|
||||||
ch := make(chan int)
|
ch := make(chan int)
|
||||||
f.Subscribe(ch)
|
f.Subscribe(ch)
|
||||||
want := feedTypeError{op: "Send", got: reflect.TypeOf(uint64(0)), want: reflect.TypeOf(int(0))}
|
want := feedTypeError{op: "Send", got: reflect.TypeOf(uint64(0)), want: reflect.TypeOf(0)}
|
||||||
if err := checkPanic(want, func() { f.Send(uint64(2)) }); err != nil {
|
if err := checkPanic(want, func() { f.Send(uint64(2)) }); err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
var f Feed
|
var f Feed
|
||||||
f.Send(int(2))
|
f.Send(2)
|
||||||
want := feedTypeError{op: "Subscribe", got: reflect.TypeOf(make(chan uint64)), want: reflect.TypeOf(make(chan<- int))}
|
want := feedTypeError{op: "Subscribe", got: reflect.TypeOf(make(chan uint64)), want: reflect.TypeOf(make(chan<- int))}
|
||||||
if err := checkPanic(want, func() { f.Subscribe(make(chan uint64)) }); err != nil {
|
if err := checkPanic(want, func() { f.Subscribe(make(chan uint64)) }); err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
|
|
@ -59,7 +59,7 @@ func TestFeedPanics(t *testing.T) {
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
var f Feed
|
var f Feed
|
||||||
if err := checkPanic(errBadChannel, func() { f.Subscribe(int(0)) }); err != nil {
|
if err := checkPanic(errBadChannel, func() { f.Subscribe(0) }); err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue