Skip to content

test(params): add params.rs covering all positions where $param can appear - #29

Merged
protosphinx merged 1 commit into
mainfrom
bot/param-expr-tests
Sep 9, 2026
Merged

protosphinx merged 1 commit into
mainfrom
bot/param-expr-tests

Conversation

@protosphinx

Copy link
Copy Markdown
Member

Why

Expr::Param(String) is a first-class AST node (grammar rule: param = ${ "$" ~ ident }) but the test suite had only one param case in parse.rs (WHERE equality). All other positions where a param can legally appear -- LIMIT, SKIP, ORDER BY, list literals, arithmetic, boolean conjunctions, the lhs of a comparison, and multi-param queries -- were untested. This closes that gap without touching any source files.

What

  • New file tests/params.rs with 12 focused integration tests covering:
    • $param on the lhs of a <= comparison
    • $param in AND-chained conjunctions (two distinct param names)
    • $param as the rhs of IN
    • $param as a standalone RETURN item
    • $param in arithmetic (u.score + $bonus)
    • $param elements inside a list literal (IN [$a, $b, $c])
    • $param in LIMIT
    • $param in SKIP
    • $param in LIMIT and SKIP together
    • $param in ORDER BY expression
    • Param names with underscores preserved exactly
    • Multiple distinct params in a single query

Tests

  • cargo test -- all 12 new tests pass, 0 regressions across 186 existing tests
  • cargo clippy --all-targets -- -D warnings -- clean
  • cargo fmt --check -- clean

Self-merge gate

  • all CI checks pass
  • LOC delta < 250 (200 lines added, 0 removed)
  • no public-API surface change (src/lib.rs not modified)
  • no runtime-dependency additions
  • no workflow file changes
  • tests added (tests/params.rs, 12 new tests)

https://claude.ai/code/session_011bbaY2nq45AHdK694aMSuw


Generated by Claude Code

…appear

Existing parse.rs covered only one param case (WHERE equality).
This suite adds 12 tests for: lhs comparison, boolean conjunction,
IN expression, standalone RETURN, arithmetic, list literal,
LIMIT, SKIP, LIMIT+SKIP together, ORDER BY, underscore names,
and multiple distinct params in a single query.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-09T16:09:22.677481Z 3cebfb2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@protosphinx protosphinx added the automated Opened by the daily bot label Sep 9, 2026 — with Claude
@protosphinx
protosphinx merged commit f89f9dc into main Sep 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated Opened by the daily bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant