test nonzero player on status

master
Bel LaPointe 2023-03-27 06:58:59 -06:00
parent 1f7b222b9c
commit 8ff1c2fab4
1 changed files with 5 additions and 0 deletions

View File

@ -93,6 +93,7 @@ func TestServeGM(t *testing.T) {
var result struct {
Players int `yaml:"Players"`
Users map[string]struct {
Player int
Lag string
IdleFor string `yaml:"idle_for"`
} `yaml:"Users"`
@ -124,6 +125,7 @@ func TestServeGM(t *testing.T) {
}
v01.cfg.Users = map[string]configUser{
"bel": configUser{
Player: 3,
LastTSMS: time.Now().Add(-1*time.Minute).UnixNano() / int64(time.Millisecond),
LastLag: int64(time.Second / time.Millisecond),
},
@ -158,6 +160,9 @@ func TestServeGM(t *testing.T) {
} else if d < time.Minute || d > 2*time.Minute {
t.Error(d)
}
if result.Users["bel"].Player != 3 {
t.Error(result.Users["bel"].Player)
}
})
})