Tests: a printed zero is no divisor and prints unsigned, int64 refusals say so, and CSVLine allocates twice

This commit is contained in:
2026-09-15 15:08:14 +02:00
parent 8ca887aa7d
commit 1ad9418a76
6 changed files with 34 additions and 5 deletions
+2
View File
@@ -36,6 +36,7 @@ func TestCalcAuto(t *testing.T) {
`"{calc(10 / 3)}"`: "3.3333333333333335",
`"{calc(6 / 2)}"`: "3",
`"{calc(1 / 4)}"`: "0.25",
`"{calc(0 * -1)}"`: "0",
}
for tmpl, want := range cases {
if got := mustRender(t, f, tmpl); got != want {
@@ -52,6 +53,7 @@ func TestCalcDecimals(t *testing.T) {
`"{calc(10 / 3, 2)}"`: "3.33",
`"{calc(10 / 3, 0)}"`: "3",
`"{calc(2 * 3, 2)}"`: "6.00",
`"{calc(-0.001, 2)}"`: "0.00",
}
for tmpl, want := range cases {
if got := mustRender(t, f, tmpl); got != want {