1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-04-04 02:54:30 +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 ( import (
"context" "context"
"log" "log"
"strconv"
"strings" "strings"
"sync" "sync"
"testing" "testing"
"time" "time"
"github.com/diamondburned/arikawa/v3/api"
"github.com/diamondburned/arikawa/v3/internal/testenv" "github.com/diamondburned/arikawa/v3/internal/testenv"
"github.com/diamondburned/arikawa/v3/utils/ws" "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 { if g.state.SessionID != data.SessionID {
t.Fatal("missing 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) log.Println("Bot's username is", data.User.Username)
reconnect() reconnect()
case *ResumedEvent: case *ResumedEvent: