Add string literal regression coverage - #8605
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 59ed00eacc
ℹ️ 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".
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8605 +/- ##
==========================================
+ Coverage 76.97% 77.00% +0.03%
==========================================
Files 467 467
Lines 62452 62461 +9
==========================================
+ Hits 48070 48100 +30
+ Misses 14382 14361 -21
🚀 New features to boost your workflow:
|
|
@codex review |
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97fb7655a4
ℹ️ 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".
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-8605 |
Signed-off-by: Christoph Knittel <ck@cca.io>
97fb765 to
0e82fe3
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
cristianoc
left a comment
There was a problem hiding this comment.
Reviewed as the base of the two-PR stack. Test-only: the diff outside tests/ is empty, and CI is green across the board.
The structure is the part worth calling out. These are characterization tests that pin the current, wrong behaviour and say so explicitly in comments — "Known bug: constant folding compares the encoded spelling instead of the decoded string value", and "This characterization intentionally expects the incorrect result, 4; the JavaScript UTF-16 length is 2". Landing them first means every behaviour change in #8606 shows up as an expectation flip in a diff rather than as new tests appearing alongside the code that makes them pass. That is a much easier thing to audit, and I would like to see more changes of this shape split this way.
I checked that the pins actually flip: constantSwitch() 4 -> 1, stringLength(semanticEmoji) 4 -> 2, and the classifyEquivalentEscape guards 5,5,,5,5 -> 0,1,,3,4, each with the "known bug" comment removed in #8606. The coverage also reaches the places that turned out to matter — the ast0 bridge, raw/ffi/re payload spelling, and constant folding — which is why the follow-up PR's behaviour changes were straightforward to reason about.
Incidentally, this branch got a lot of unintended exercise: I used it as the baseline for all of my differential testing of #8606, so it has been built from scratch, had the runtime and the 356-module tests/tests/src corpus compiled against it, and been run through identity-PPX round trips. Nothing anomalous surfaced.
One caveat on my own coverage: I did not run make test locally, so for the suite actually passing I am relying on CI rather than on my own run.
This is the first PR in the String Theory series and the base of a two-PR stack addressing #8602.
It adds characterization and regression coverage for string literals before changing their compiler representation. Some tests intentionally capture existing incorrect behavior and document the corresponding JavaScript semantics.
Coverage includes:
The second PR in the stack, #8606, normalizes the representation and updates the expectations for the bugs fixed there.
Testing
make testmake test-syntaxmake test-gentypemake test-analysis