Skip to content

test(wasm): 04_functions expects the counter to count - #14667

Open
raliclo wants to merge 1 commit into
PerryTS:mainfrom
raliclo:fix/wasm-04-functions-expected
Open

raliclo wants to merge 1 commit into
PerryTS:mainfrom
raliclo:fix/wasm-04-functions-expected

Conversation

@raliclo

@raliclo raliclo commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

tests/integration/wasm/04_functions.expected still expected makeCounter() to print 1, 1, 1. Since #14634 (closures share the variables they capture and mutate), the web build correctly prints 1, 2, 3, which is also what Node prints, so the case fails on main. The expectation now holds Node's output: 7, 55, 1, 2, 3. This is the same kind of fix as the two expectations in #14631.

Only tests/integration/wasm/04_functions.expected changes. No crate changes, so there is no changelog fragment.

Test plan

  • bash tests/integration/wasm/run_wasm_tests.sh (run locally on macOS arm64): 31 passed / 2 failed (10_higher_order, 19_ffi_imports). On main it is 30 / 3, with 04_functions the third failure. The compiled program's output is identical to node --experimental-strip-types tests/integration/wasm/04_functions.ts (Node 26.12.1).
  • This suite is not in any test.yml job, so CI does not exercise this file. The run above is the evidence.
  • BASE_SHA=<merge-base> SKIP_COMPILE_GATES=1 bash scripts/run_lint_gates.sh: FAIL set identical to main's.

Checklist

  • I have NOT bumped the workspace version or edited CHANGELOG.md
  • My commits follow the loose feat: / fix: / docs: / chore: prefix convention used in the log
  • I've read CONTRIBUTING.md and agree to the Code of Conduct

🤖 Generated with Claude Code

https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p

Summary by CodeRabbit

  • Tests
    • Updated the expected results for WebAssembly function integration coverage. The test now checks for outputs of 2 and 3 rather than 1 and 1, keeping automated validation aligned with the updated results. This change affects test expectations only; it does not add or remove user-facing functionality.

Closures share the variables they capture (PerryTS#14634), so makeCounter's counter
prints 1, 2, 3 on --target web, as Node does. The expectation still said 1, 1, 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The expected output values for a WASM integration test change from 1, 1 to 2, 3.

Changes: WASM integration output

Layer / File(s) Summary
Update expected output
tests/integration/wasm/04_functions.expected
The expected output values change from 1, 1 to 2, 3.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Suggested reviewers: thehypnoo

Merge Risk: Minimal · up to 30ed0

This updates a test's expected output to match the current closure behavior. It has no production impact and is low risk to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the changed test and its new expectation. The PR changes only the expected output of the wasm 04_functions test, from 1, 1 to 2, 3. The title is specific and matches the main change, t…
Description check Passed The description covers the summary, the test plan, and the checklist from the template. It explains why the expectation changed and gives the test results. The Changes section and the related issue se…
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 names the changed test and its new expectation. The PR changes only the expected output of the wasm 04_functions test, from 1, 1 to 2, 3. The title is specific and matches the main change, though it is terse. It uses a conventional test(wasm): prefix, which fits the repository's commit convention.

Full details: Description check

Explanation

The description covers the summary, the test plan, and the checklist from the template. It explains why the expectation changed and gives the test results. The Changes section and the related issue section are not filled in. The Related issue section should name #14634 or #14631, or state n/a. The description also omits the template's required Test plan checklist items, such as the cargo build and cargo test commands. The author did not state whether the cargo build and workspace test steps were run.

Resolution

Optional improvements: add a Changes bullet (for example, the one-file change to tests/integration/wasm/04_functions.expected), fill in the Related issue section (Refs #14634 or n/a), and state whether cargo build --release and the workspace cargo test pass, since the template's checklist asks for them.

Finishing Touches

Generate unit tests (beta)

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ae061a78-66e1-4823-8c97-1baa02d15545
Commits

Reviewing files that changed from the base of the PR and between 908ecff and 30ed0d1.

Files selected for processing: 1

  • tests/integration/wasm/04_functions.expected

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review.

This branch has not been deployed

No deployments
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.

2 participants