test nonzero player on status
parent
1f7b222b9c
commit
8ff1c2fab4
|
|
@ -93,6 +93,7 @@ func TestServeGM(t *testing.T) {
|
||||||
var result struct {
|
var result struct {
|
||||||
Players int `yaml:"Players"`
|
Players int `yaml:"Players"`
|
||||||
Users map[string]struct {
|
Users map[string]struct {
|
||||||
|
Player int
|
||||||
Lag string
|
Lag string
|
||||||
IdleFor string `yaml:"idle_for"`
|
IdleFor string `yaml:"idle_for"`
|
||||||
} `yaml:"Users"`
|
} `yaml:"Users"`
|
||||||
|
|
@ -124,6 +125,7 @@ func TestServeGM(t *testing.T) {
|
||||||
}
|
}
|
||||||
v01.cfg.Users = map[string]configUser{
|
v01.cfg.Users = map[string]configUser{
|
||||||
"bel": configUser{
|
"bel": configUser{
|
||||||
|
Player: 3,
|
||||||
LastTSMS: time.Now().Add(-1*time.Minute).UnixNano() / int64(time.Millisecond),
|
LastTSMS: time.Now().Add(-1*time.Minute).UnixNano() / int64(time.Millisecond),
|
||||||
LastLag: int64(time.Second / 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 {
|
} else if d < time.Minute || d > 2*time.Minute {
|
||||||
t.Error(d)
|
t.Error(d)
|
||||||
}
|
}
|
||||||
|
if result.Users["bel"].Player != 3 {
|
||||||
|
t.Error(result.Users["bel"].Player)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue