optomization in getting game system

This commit is contained in:
2026-01-28 05:39:51 +01:00
parent c77f5202b6
commit 34c6e31200
5 changed files with 89 additions and 26 deletions
+23
View File
@@ -0,0 +1,23 @@
package gsmaster
import (
"testing"
"bamort/database"
"github.com/stretchr/testify/assert"
)
func TestGetGameSystem(t *testing.T) {
// Initialize test DB and migrations
database.SetupTestDB(true)
defer database.ResetTestDB()
t.Run("GetGameSystem", func(t *testing.T) {
gs := GetGameSystem(1, "")
assert.Equal(t, "M5", gs.Code)
gs = GetGameSystem(0, "midgard")
assert.Equal(t, "M5", gs.Code)
gs = GetGameSystem(1, "M5")
assert.Equal(t, "M5", gs.Code)
})
}