1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-20 02:57:05 +00:00

Fixes #61 - monitor.history=0 panic

This commit is contained in:
James Hillyerd
2017-12-14 18:51:35 -08:00
parent a9b174bcb6
commit 7908e41212
3 changed files with 21 additions and 7 deletions

View File

@@ -60,6 +60,17 @@ func TestHubNew(t *testing.T) {
}
}
func TestHubZeroLen(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
hub := New(ctx, 0)
m := Message{}
for i := 0; i < 100; i++ {
hub.Dispatch(m)
}
// Just making sure Hub doesn't panic
}
func TestHubZeroListeners(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()