Skip to content
This repository was archived by the owner on Jan 31, 2022. It is now read-only.

Commit 0355a54

Browse files
committed
golint tests
1 parent 4306664 commit 0355a54

6 files changed

Lines changed: 11 additions & 0 deletions

File tree

test/common/db/alts/alts_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ var (
1313
playerID = "a1ddced8bb20466db456184d9de50346"
1414
)
1515

16+
// TestMain is for getting the database connection before testing.
1617
func TestMain(m *testing.M) {
1718
if store == nil {
1819
storeDB := db.GetStore(db2.TestConfig)
@@ -21,6 +22,7 @@ func TestMain(m *testing.M) {
2122
m.Run()
2223
}
2324

25+
// TestAlts tests the whole alt account management database table.
2426
func TestAlts(t *testing.T) {
2527
t.Run("AddAlt", testAddAlt)
2628
t.Run("GetAlt", testGetAlt)

test/common/db/authcodes/authcodes_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ var playerUUID = "5bce3068e4f3489fb66b5723b2a7cdb1"
1010
var authCode string
1111
var store *db.AuthTable
1212

13+
// TestMain is for getting the database connection before testing.
1314
func TestMain(m *testing.M) {
1415
if store == nil {
1516
storeDB := db.GetStore(db2.TestConfig)
@@ -18,6 +19,7 @@ func TestMain(m *testing.M) {
1819
m.Run()
1920
}
2021

22+
// TestAuthCodes tests the whole auth_codes database table.
2123
func TestAuthCodes(t *testing.T) {
2224
t.Run("NewAuthCode", testNewAuthCode)
2325
t.Run("GetAuthCode", testGetAuthCode)

test/common/db/constants.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import (
55
"time"
66
)
77

8+
// TestConfig is the database configuration for testing, please modify before
9+
// testing.
810
var TestConfig = db.Config{
911
Host: "localhost",
1012
Port: 5432,

test/common/db/links/links_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var (
1212
store *db.LinksTable
1313
)
1414

15+
// TestMain is for getting the database connection before testing.
1516
func TestMain(m *testing.M) {
1617
if store == nil {
1718
storeDB := db.GetStore(db2.TestConfig)
@@ -20,6 +21,7 @@ func TestMain(m *testing.M) {
2021
m.Run()
2122
}
2223

24+
// TestLinks tests the whole Links table
2325
func TestLinks(t *testing.T) {
2426
t.Run("NewLink", testNewLink)
2527
t.Run("SetLink", testSetLink)

test/common/db/store_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"testing"
66
)
77

8+
// TestGetStore tests connecting to the database.
89
func TestGetStore(t *testing.T) {
910
db.GetStore(TestConfig)
1011
}

test/common/minecraft_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const (
1010
playerUUID = "5bce3068e4f3489fb66b5723b2a7cdb1"
1111
)
1212

13+
// TestGetUUID checks if the player name can resolve the linked UUID.
1314
func TestGetUUID(t *testing.T) {
1415
result := common.GetPlayerID(playerName)
1516

@@ -22,6 +23,7 @@ func TestGetUUID(t *testing.T) {
2223
}
2324
}
2425

26+
// TestGetName checks if the player UUID can resolve the linked name.
2527
func TestGetName(t *testing.T) {
2628
result := common.GetPlayerName(playerUUID)
2729

0 commit comments

Comments
 (0)