Skip to content

test(deparser): add TypeCast kitchen-sink fixtures - #401

Merged
pyramation merged 1 commit into
mainfrom
feat/typecast-kitchen-sink-fixtures
Nov 23, 2026
Merged

pyramation merged 1 commit into
mainfrom
feat/typecast-kitchen-sink-fixtures

Conversation

@pyramation

@pyramation pyramation commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #398: adds its 17 TypeCast cases as a kitchen-sink fixture so they get the generated compact/pretty AST round-trip tests.

  • __fixtures__/kitchen-sink/misc/typecast.sql (new fixture)
  • Regenerated __fixtures__/generated/generated.json, packages/deparser/__tests__/kitchen-sink/misc-typecast.test.ts, and the transform-ast kitchen-sink fixtures.json entries.

The hand-written output assertions in __tests__/misc/typecast.test.ts stay as-is. Test-only; no source or version changes.


libpg-query and parser opened this PR for Dan
Implemented in session Redo parse-tree-based TypeCast deparsing
Review with Devin · Open in Devin Desktop


Summary by CodeRabbit

  • Tests
    • Added coverage for SQL CAST syntax, including edge cases involving expressions, function calls, type names, and negative values.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@luxor-code-review

luxor-code-review Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Review complete. No issues found — approved ✅.


This PR is a fixtures-only change: it adds a new misc/typecast.sql kitchen-sink fixture exercising TypeCast round-trips (CAST vs ::, negative constants, qualified/typmod/array type names), regenerates the deparser's generated.json and its misc-typecast.test.ts test file, and refreshes the transform-ast fixtures.json snapshot. No deparser or other production source was modified. Static review traced the new fixtures against the existing TypeCast deparse logic (bpchar branch, negative-constant guard, pg_catalog type handling) and found them consistent with the reparse-equality test contract.

Files Change
__fixtures__/kitchen-sink/misc/typecast.sql, __fixtures__/generated/generated.json New typecast fixture SQL and regenerated parse-output fixture data.
packages/deparser/__tests__/kitchen-sink/misc-typecast.test.ts Generated kitchen-sink test covering the new typecast fixtures.
packages/transform-ast/__tests__/kitchen-sink/fixtures.json Regenerated transform-ast fixture snapshot to match the new statements.

Reviewed commit: 2d619dd

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The pull request adds SQL fixtures for CAST and :: syntax edge cases. It registers 17 numbered fixtures in the manifest and adds a deparser test that runs them.

Changes: Typecast Fixture Coverage

Layer / File(s) Summary
Add and register typecast fixtures
__fixtures__/kitchen-sink/misc/typecast.sql, packages/transform-ast/__tests__/kitchen-sink/fixtures.json, packages/deparser/__tests__/kitchen-sink/misc-typecast.test.ts
Adds fixtures for typecast syntax and edge cases. Registers 17 fixture paths and adds a test that runs them.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: luxor-code-review

Merge Risk: Minimal · up to 2d619 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Security architecture risk: Minimal · up to 2d619

The change expands test coverage without changing how applications call, run, or deploy the deparser.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "test(deparser): add TypeCast kitchen-sink fixtures" matches the main change. The PR adds a typecast.sql kitchen-sink fixture with 17 TypeCast cases, a misc-typecast test file, and fixtures.…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "test(deparser): add TypeCast kitchen-sink fixtures" matches the main change. The PR adds a typecast.sql kitchen-sink fixture with 17 TypeCast cases, a misc-typecast test file, and fixtures.json manifest entries. The title names the change type, the scope, and the fixture purpose. It does not mention the generated.json regeneration, but that detail is not required.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 3
  • Waived: $0.75 (charged $0.00)
  • View usage details

Note

This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1ea4939 and 2d619dd.

Files ignored due to path filters: 1

  • __fixtures__/generated/generated.json is excluded by !**/generated/**, !__fixtures__/generated/**
Files selected for processing: 3

  • __fixtures__/kitchen-sink/misc/typecast.sql
  • packages/deparser/__tests__/kitchen-sink/misc-typecast.test.ts
  • packages/transform-ast/__tests__/kitchen-sink/fixtures.json

Limit details: You’ve used all 10 included reviews currently available.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@pyramation
pyramation merged commit c4e7734 into main Nov 23, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant