Add a "Version" field to GameMap Meta (#83)

* initial concept for versioning
* simple uint version implementation
* tidy up dependencies
This commit is contained in:
Torben 2022-06-15 15:51:42 -07:00 committed by GitHub
parent 0f15f34bdf
commit e8e20c53ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 23 additions and 5 deletions

View file

@ -1,6 +1,7 @@
package maps
import (
"fmt"
"testing"
"github.com/BattlesnakeOfficial/rules"
@ -22,7 +23,7 @@ func TestRegisteredMaps(t *testing.T) {
for mapName, gameMap := range globalRegistry {
t.Run(mapName, func(t *testing.T) {
require.Equalf(t, mapName, gameMap.ID(), "%#v game map doesn't return its own ID", mapName)
require.True(t, gameMap.Meta().Version > 0, fmt.Sprintf("registered maps must have a valid version (>= 1) - '%d' is invalid", gameMap.Meta().Version))
var setupBoardState *rules.BoardState
for width := 0; width < maxBoardWidth; width++ {