update to new go-steam version

This commit is contained in:
2025-10-26 05:20:47 +01:00
parent ab8b0b983c
commit df22705679
8 changed files with 364 additions and 312 deletions

View File

@@ -1,41 +1,45 @@
package csgo
package csgo_test
import "testing"
import (
"testing"
func TestGoodSharecodes(t *testing.T) {
eMatchId := uint64(3505575050994516382)
eOutcomeId := uint64(3505581094013501947)
eTokenId := uint16(12909)
"somegit.dev/csgowtf/csgowtfd/csgo"
)
matchId, outcomeId, tokenId, err := DecodeSharecode("CSGO-P9k3F-eVL9n-LZLXN-DrBGF-VKD7K")
func TestGoodSharecodes(t *testing.T) { //nolint:paralleltest
eMatchID := uint64(3505575050994516382)
eOutcomeID := uint64(3505581094013501947)
eTokenID := uint16(12909)
matchID, outcomeId, tokenId, err := csgo.DecodeSharecode("CSGO-P9k3F-eVL9n-LZLXN-DrBGF-VKD7K")
if err != nil {
t.Log("error should be nil", err)
t.Fail()
}
if matchId != eMatchId {
t.Logf("matchID should be %d, is %d", eMatchId, matchId)
if matchID != eMatchID {
t.Logf("matchID should be %d, is %d", eMatchID, matchID)
t.Fail()
}
if outcomeId != eOutcomeId {
t.Logf("outcomeID should be %d, is %d", eOutcomeId, outcomeId)
if outcomeId != eOutcomeID {
t.Logf("outcomeID should be %d, is %d", eOutcomeID, outcomeId)
t.Fail()
}
if tokenId != eTokenId {
t.Logf("tokenID should be %d, is %d", eTokenId, tokenId)
if tokenId != eTokenID {
t.Logf("tokenID should be %d, is %d", eTokenID, tokenId)
t.Fail()
}
}
func TestBadSharecodes(t *testing.T) {
matchId, outcomeId, tokenId, err := DecodeSharecode("CSGO-AAAAA-AAAAA-AAAAA-AAAAA-AAAAA")
matchID, outcomeId, tokenId, err := csgo.DecodeSharecode("CSGO-AAAAA-AAAAA-AAAAA-AAAAA-AAAAA")
if err != nil {
t.Log("error should not be set", err)
t.Fail()
}
if matchId != 0 {
t.Logf("matchID should be 0, is %d", matchId)
if matchID != 0 {
t.Logf("matchID should be 0, is %d", matchID)
t.Fail()
}
if outcomeId != 0 {
@@ -47,14 +51,14 @@ func TestBadSharecodes(t *testing.T) {
t.Fail()
}
matchId, outcomeId, tokenId, err = DecodeSharecode("CSGO-99999-99999-99999-99999-99999")
matchID, outcomeId, tokenId, err = csgo.DecodeSharecode("CSGO-99999-99999-99999-99999-99999")
if err == nil {
t.Log("error should be set", err)
t.Fail()
}
if matchId != 0 {
t.Logf("matchID should be 0, is %d", matchId)
if matchID != 0 {
t.Logf("matchID should be 0, is %d", matchID)
t.Fail()
}
if outcomeId != 0 {