1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-01-05 19:57:02 +00:00

gateway: Test ReadyEvent.Version

This commit is contained in:
diamondburned 2022-04-02 22:52:57 -07:00
parent 6b835a58c7
commit 816a53b1e1
No known key found for this signature in database
GPG key ID: D78C4471CE776659

View file

@ -3,11 +3,13 @@ package gateway
import (
"context"
"log"
"strconv"
"strings"
"sync"
"testing"
"time"
"github.com/diamondburned/arikawa/v3/api"
"github.com/diamondburned/arikawa/v3/internal/testenv"
"github.com/diamondburned/arikawa/v3/utils/ws"
)
@ -150,6 +152,9 @@ func gatewayOpenAndSpin(t *testing.T, ctx context.Context, g *Gateway) {
if g.state.SessionID != data.SessionID {
t.Fatal("missing SessionID")
}
if strconv.Itoa(data.Version) != api.Version {
t.Fatalf("mismatch version, got %d", data.Version)
}
log.Println("Bot's username is", data.User.Username)
reconnect()
case *ResumedEvent: