new operator 'filter'

This commit is contained in:
2026-04-24 22:42:46 +02:00
parent 6ee365bacc
commit 6e98bdd16b
6 changed files with 91 additions and 11 deletions
+5 -4
View File
@@ -33,12 +33,13 @@ func TestOperator(t *testing.T) {
/* 20 */ {`a=1; a^=2`, int64(3), nil},
/* 21 */ {`a=1; ++a`, int64(2), nil},
/* 22 */ {`a=1; --a`, int64(0), nil},
/* 23 */ {`[1,2,3] map var("_")`, []any{1, 2, 3}, nil},
/* 24 */ {`[1,2,3] map $_`, newList([]any{1, 2, 3}), nil},
/* 23 */ {`[1,2,3] map var("_")`, newList([]any{int64(1), int64(2), int64(3)}), nil},
/* 24 */ {`[1,2,3] map $_`, newList([]any{int64(1), int64(2), int64(3)}), nil},
/* 25 */ {`[1,2,3,4] filter ($_ % 2 == 0)`, newList([]any{int64(2), int64(4)}), nil},
}
// t.Setenv("EXPR_PATH", ".")
runTestSuiteSpec(t, section, inputs, 24)
// runTestSuite(t, section, inputs)
// runTestSuiteSpec(t, section, inputs, 25)
runTestSuite(t, section, inputs)
}