mirror of
https://github.com/mjl-/mox.git
synced 2025-01-14 01:06:27 +03:00
fix flaky test, event doesn't have to be set
This commit is contained in:
parent
55d05c6bea
commit
79d06184ab
1 changed files with 5 additions and 1 deletions
|
@ -8,6 +8,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -122,6 +123,9 @@ func TestAccount(t *testing.T) {
|
||||||
loop:
|
loop:
|
||||||
for {
|
for {
|
||||||
e := <-l.Events
|
e := <-l.Events
|
||||||
|
if e.Event == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
switch x := e.Event.(type) {
|
switch x := e.Event.(type) {
|
||||||
case importCount:
|
case importCount:
|
||||||
count += x.Count
|
count += x.Count
|
||||||
|
@ -132,7 +136,7 @@ func TestAccount(t *testing.T) {
|
||||||
case importAborted:
|
case importAborted:
|
||||||
t.Fatalf("unexpected aborted import")
|
t.Fatalf("unexpected aborted import")
|
||||||
default:
|
default:
|
||||||
panic("missing case")
|
panic(fmt.Sprintf("missing case for Event %#v", e))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if count != expect {
|
if count != expect {
|
||||||
|
|
Loading…
Reference in a new issue