Skip to content

Commit

Permalink
fix(coverage/transpiler): diff comparison results are reversed (#3727)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing committed Jun 17, 2024
1 parent 0fbecdc commit 889198a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tasks/coverage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl AppArgs {
self.run_codegen();
self.run_prettier();
self.run_transformer();
self.run_transipler();
self.run_transpiler();
// self.run_codegen_runtime();
self.run_minifier();
}
Expand Down Expand Up @@ -95,7 +95,7 @@ impl AppArgs {
MiscSuite::<TransformerMiscCase>::new().run("transformer_misc", self);
}

pub fn run_transipler(&self) {
pub fn run_transpiler(&self) {
TranspileRunner::<TypeScriptTranspileCase>::new().run("transpile", self);
}

Expand Down
2 changes: 1 addition & 1 deletion tasks/coverage/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn main() {
"codegen-runtime" => args.run_codegen_runtime(),
"prettier" => args.run_prettier(),
"transformer" => args.run_transformer(),
"transpiler" => args.run_transipler(),
"transpiler" => args.run_transpiler(),
"minifier" => args.run_minifier(),
"v8_test262_status" => args.run_sync_v8_test262_status(),
_ => args.run_all(),
Expand Down
3 changes: 2 additions & 1 deletion tasks/coverage/src/suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub enum TestResult {
Passed,
IncorrectlyPassed,
#[allow(unused)]
// (actual, expected)
Mismatch(String, String),
ParseError(String, /* panicked */ bool),
CorrectError(String, /* panicked */ bool),
Expand Down Expand Up @@ -424,7 +425,7 @@ pub trait Case: Sized + Sync + Send + UnwindSafe {
origin_string: &str,
expected_string: &str,
) -> std::io::Result<()> {
let diff = TextDiff::from_lines(origin_string, expected_string);
let diff = TextDiff::from_lines(expected_string, origin_string);
for change in diff.iter_all_changes() {
let (sign, style) = match change.tag() {
ChangeTag::Delete => ("-", Style::new().red()),
Expand Down

0 comments on commit 889198a

Please sign in to comment.