Skip to content

Commit

Permalink
refactor(minifier): run the compressor on all test cases
Browse files Browse the repository at this point in the history
Running individual plugins causes too much confusion.
  • Loading branch information
Boshen committed Jan 19, 2025
1 parent 4ff6e85 commit e495a30
Show file tree
Hide file tree
Showing 13 changed files with 968 additions and 1,162 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,19 +235,7 @@ impl<'a> CollapseVariableDeclarations {
/// <https://github.com/google/closure-compiler/blob/v20240609/test/com/google/javascript/jscomp/CollapseVariableDeclarationsTest.java>
#[cfg(test)]
mod test {
use oxc_allocator::Allocator;

use crate::tester;

fn test(source_text: &str, expected: &str) {
let allocator = Allocator::default();
let mut pass = super::CollapseVariableDeclarations::new();
tester::test(&allocator, source_text, expected, &mut pass);
}

fn test_same(source_text: &str) {
test(source_text, source_text);
}
use crate::tester::{test, test_same};

mod join_vars {
use super::{test, test_same};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,7 @@ impl<'a> ConvertToDottedProperties {

#[cfg(test)]
mod test {
use oxc_allocator::Allocator;

use crate::tester;

fn test(source_text: &str, expected: &str) {
let allocator = Allocator::default();
let mut pass = super::ConvertToDottedProperties::new(false);
tester::test(&allocator, source_text, expected, &mut pass);
}

fn test_same(source_text: &str) {
test(source_text, source_text);
}
use crate::tester::{test, test_same};

#[test]
fn test_computed_to_member_expression() {
Expand Down
14 changes: 1 addition & 13 deletions crates/oxc_minifier/src/ast_passes/exploit_assigns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,7 @@ impl ExploitAssigns {
/// <https://github.com/google/closure-compiler/blob/v20240609/test/com/google/javascript/jscomp/ExploitAssignsTest.java>
#[cfg(test)]
mod test {
use oxc_allocator::Allocator;

use crate::tester;

fn test(source_text: &str, expected: &str) {
let allocator = Allocator::default();
let mut pass = super::ExploitAssigns::new();
tester::test(&allocator, source_text, expected, &mut pass);
}

fn test_same(source_text: &str) {
test(source_text, source_text);
}
use crate::tester::{test, test_same};

#[test]
#[ignore]
Expand Down
Loading

0 comments on commit e495a30

Please sign in to comment.