horse: fix TenThousandths formatting

This commit is contained in:
2026-01-16 20:47:01 -05:00
parent b0c555f547
commit dc2094bd50
2 changed files with 34 additions and 5 deletions
+22
View File
@@ -32,3 +32,25 @@ func TestSkillStrings(t *testing.T) {
}
}
}
func TestTenThousandthsString(t *testing.T) {
t.Parallel()
cases := []struct {
val horse.TenThousandths
want string
}{
{0, "0"},
{10000, "1"},
{-10000, "-1"},
{15000, "1.5"},
{-15000, "-1.5"},
{10001, "1.0001"},
{5000000, "500"},
}
for _, c := range cases {
got := c.val.String()
if got != c.want {
t.Errorf("%d: want %q, got %q", c.val, c.want, got)
}
}
}