Answer prose round 1: delete two false comments, plainer SplitPath, evalCalc and decision wording, a shorter comprehension floor title, and item 110 owes a changelog entry

This commit is contained in:
2026-10-05 12:31:58 +02:00
committed by Lillem4n
parent 199cb577c5
commit 177dd4b50b
8 changed files with 21 additions and 24 deletions
+2 -2
View File
@@ -105,11 +105,11 @@ func TestCalcReproducible(t *testing.T) {
func TestParsedCallReadsOnlyAnOperandBuiltin(t *testing.T) {
for _, format := range []string{"{luhn()}", "{calc()}", "{calc(1 +)}", "{calc(()}"} {
if toks, err := grammar.ParseFormat(format); err != nil || len(toks) != 1 || tokenReads(toks[0]) != nil {
t.Errorf("tokenReads(%q) = %+v, %v, want one call reading no operand", format, toks, err)
t.Errorf("ParseFormat(%q) = %+v, %v, want one call reading no operand", format, toks, err)
}
}
if toks, err := grammar.ParseFormat("{calc(net * qty)}"); err != nil || len(toks) != 1 || len(tokenReads(toks[0])) != 2 {
t.Errorf("tokenReads({calc(net * qty)}) = %+v, %v, want both operands", toks, err)
t.Errorf("ParseFormat({calc(net * qty)}) = %+v, %v, want both operands", toks, err)
}
}