🧪 Add tests for complex source constructs in canonicalize_in_source - #264
🧪 Add tests for complex source constructs in canonicalize_in_source#264undivisible wants to merge 1 commit into
Conversation
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_643ced55-b356-419b-9db8-66bb87f88f98) |
|
Tick the box to add this pull request to the merge queue (same as
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f84aa0ec7e
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| assert!(canonical.contains("while p.x < 10 {")); | ||
| assert!(canonical.contains("match p.y {")); | ||
| assert!(canonical.contains("if p.x == 10 {")); | ||
| assert!(canonical.contains("while true {")); |
There was a problem hiding this comment.
Assert that break survives canonicalization
When this input is canonicalized, Stmt::Break is currently rendered as an empty string in format_stmt, so the while true { break; } block becomes an infinite empty loop. This assertion checks only the loop header, allowing the new test to pass despite that semantic corruption; assert the rendered break (and ideally reparse the complete output) so the construct included by this test is actually covered.
Useful? React with 👍 / 👎.
🎯 What: Added tests covering more syntax forms (field/index assignment, loops, match, if) in
canonicalize_in_sourcefor.infiles.📊 Coverage: Now tests constructs like
while true,match, field assignment, and conditional if-else statements.✨ Result: Increased confidence in the correctness of the formatter.
PR created automatically by Jules for task 7223696179011002812 started by @undivisible
Note
Low Risk
Test-only change with no production or formatter logic modifications.
Overview
Adds
canonicalizes_complex_source_constructsinin_canonical.rsto exercisecanonicalize_in_sourceon a richer.insample than existing tests.The fixture includes a struct, field and index assignment, conditional
while,match,if/else, an infinitewhile truewithbreak, and returns. Assertions check that the canonical string still contains the expected formatted fragments (structs, lets, assignments, and control-flow headers).Reviewed by Cursor Bugbot for commit f84aa0e. Configure here.