Answer architecture round 1: exempt only a calc operand from the read-once refusal, run the name passes from one list, read every operand's leaves, show a name operand in a README example, and plan a path through a name as an operand

This commit is contained in:
2026-10-05 01:05:20 +02:00
committed by Lillem4n
parent d1b3b05a0c
commit 94cf741706
12 changed files with 76 additions and 43 deletions
+1 -2
View File
@@ -317,7 +317,7 @@ func TestCalcReadsANameItReadsNowhereElse(t *testing.T) {
}
}
func TestCalcRefusesANameNeverANumber(t *testing.T) {
func TestCalcRefusesABadOperand(t *testing.T) {
for card, want := range map[string]string{
`"{/word as w}{w}{calc(w * 2)}"`: `operand "w" is never a number: it renders "def"`,
`"{/zero as z}{z}{calc(1 / z)}"`: `divides by z, which is always zero`,
@@ -338,7 +338,6 @@ func TestCalcRefusesANameNeverANumber(t *testing.T) {
func TestATypedColumnProvesACalcOverAName(t *testing.T) {
dir := writeData(t, map[string]string{
"n": `"{int(1,9)}"`,
"word": `["1","x"]`,
"order": `{"format":"{/n as k}{k}","double":{"format":"{calc(k * 2)}","datatype":"integer"}}`,
})
f := newGenerator(t, dir, WithSeed(1))