Skip to content
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 #9264

Merged
merged 18 commits into from
Oct 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cargo fmt
  • Loading branch information
levi-nz committed Oct 7, 2024
commit 66e36606ba3a937d468b585720cdf4175971abc1
14 changes: 7 additions & 7 deletions crates/swc_ecma_transforms_testing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ where
}})",
input
),
src_type
src_type,
)?;
match ::std::env::var("PRINT_HYGIENE") {
Ok(ref s) if s == "1" => {
Expand Down Expand Up @@ -753,18 +753,18 @@ where

/// Same as [exec_tr], but parses input as a [Module][Program::Module].
pub fn exec_module_tr<F, P>(_test_name: &str, syntax: Syntax, tr: F, input: &str)
where
F: FnOnce(&mut Tester<'_>) -> P,
P: Fold,
where
F: FnOnce(&mut Tester<'_>) -> P,
P: Fold,
{
exec_tr_with(syntax, SrcType::Module, tr, input)
}

/// Same as [exec_tr], but parses input as a [Script][Program::Script].
pub fn exec_script_tr<F, P>(_test_name: &str, syntax: Syntax, tr: F, input: &str)
where
F: FnOnce(&mut Tester<'_>) -> P,
P: Fold,
where
F: FnOnce(&mut Tester<'_>) -> P,
P: Fold,
{
exec_tr_with(syntax, SrcType::Script, tr, input)
}
Expand Down