18 lines
322 B
Go
18 lines
322 B
Go
package content
|
|
|
|
import "testing"
|
|
|
|
func TestBalanceValidation(t *testing.T) {
|
|
b, err := Load()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
b.PlayerSpeed = -1
|
|
if b.Validate() == nil {
|
|
t.Fatal("negative speed accepted")
|
|
}
|
|
if _, err = Parse([]byte("unexpected: 1")); err == nil {
|
|
t.Fatal("unknown content key accepted")
|
|
}
|
|
}
|