-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(es/testing): Parse test code as a Program
instead of a Module
#9623
Conversation
🦋 Changeset detectedLatest commit: 4e5d77c The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Also, this removes |
Should be good to go now. CI should pass (I hope). |
Also |
…items`
CodSpeed Performance ReportMerging #9623 will not alter performanceComparing Summary
|
Description:
This PR addresses the issue described in #8713
BREAKING CHANGE:
Will break unit tests that use
fold_module
/visit_module
/visit_mut_module
if the visitor is intended to work for both modules and scripts instead of usingfold_program
/visit_program
/visit_mut_program
.When creating visitors, you should use
fold_program
/visit_program
/visit_mut_program
if you simply want to visit the top-level node.When creating tests, the input source code will be parsed using
parse_program
by default. If you need to parse it as aModule
, you can usemodule: Some(true)
inFixtureTestConfig
(or withtest!(module, ..)
), which will parse it as aProgram::Module
, orSome(false)
forProgram::Script
.None
will useparse_program
(parse_program
will auto-detect the underlying type).Related issue (if exists):