Commit 4711ba3
test: comprehensive macro tests matching AGENTS.md quality bar
Expand from 20 to 47 tests (44 unit + 3 property-based) covering
all required categories:
Happy path: scalar, multi-param, string ops, boolean, CASE, table
macros, table macro in joins, redefine
Sad path: invalid SQL, mismatched params, wrong arity, zero args,
invalid table SQL, failed define doesn't leave partial registry
Adversarial: no params, 10 params, NULL handling, NULL propagation,
macro composition, SQL reserved words as params, single quotes,
Unicode, empty strings, 50 simultaneous macros
Wicked: 2000-row pipeline with filter+sort, group_by+summarise on
1000 rows, chained macros (double→shift→clamp), table macro
feeding into scalar macro pipeline, define/undefine/redefine cycle
Property-based: macro arithmetic matches inline SQL, define then
list always shows macro, undefine then list never shows macro
Distributed: worker replay on single worker, macro_setup_sqls
replayable on fresh connection, single-worker distributed matches
local result
Also fixes: quote macro params with qi() to support SQL reserved
words as parameter names.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 71d7efc commit 4711ba3
2 files changed
Lines changed: 400 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
856 | 856 | | |
857 | 857 | | |
858 | 858 | | |
859 | | - | |
| 859 | + | |
860 | 860 | | |
861 | 861 | | |
862 | 862 | | |
| |||
890 | 890 | | |
891 | 891 | | |
892 | 892 | | |
893 | | - | |
| 893 | + | |
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
| |||
0 commit comments