Fixes #23, adds Tests action

This commit is contained in:
chris
2020-11-23 12:30:11 -05:00
committed by Chris Marshall
parent c1229891a6
commit df74971b73
6 changed files with 85 additions and 18 deletions

View File

@ -43,11 +43,15 @@ maps:
`
const expectedConfig = `seta fraglimit "25"
seta bot_minplayers "0"
seta bot_nochat "0"
seta g_forcerespawn "0"
seta g_gametype "0"
seta g_log ""
seta g_motd "Welcome to Critical Stack"
seta g_password ""
seta g_quadfactor "3"
seta g_spSkill "0"
seta g_weaponrespawn "3"
seta fs_basegame ""
seta fs_basepath ""
@ -59,15 +63,16 @@ seta sv_allowDownload "0"
seta sv_hostname "quakekube"
seta sv_maxclients "12"
seta rconpassword "changeme"
seta g_inactivity 600
seta sv_timeout 120
set d0 "seta g_gametype 0 ; map q3dm7 ; set nextmap vstr d1"
set d1 "seta g_gametype 0 ; map q3dm17 ; set nextmap vstr d2"
set d2 "seta g_gametype 4 ; capturelimit 8 ; map q3wctf1 ; set nextmap vstr d3"
set d3 "seta g_gametype 1 ; map q3tourney2 ; set nextmap vstr d4"
set d4 "seta g_gametype 4 ; capturelimit 8 ; map q3wctf3 ; set nextmap vstr d5"
set d5 "seta g_gametype 1 ; map ztn3tourney1 ; set nextmap vstr d0"
vstr d0`
vstr d0
seta g_inactivity 600
seta sv_timeout 120
`
func TestConfigMarshal(t *testing.T) {
var cfg *Config
@ -82,5 +87,4 @@ func TestConfigMarshal(t *testing.T) {
if diff := cmp.Diff(string(data), expectedConfig); diff != "" {
t.Fatalf(diff)
}
}