fix(es/transforms/testing): Fix comparing logic (#2263)

swc_ecma_transform_testing:
 - Fix comparing logic.
This commit is contained in:
강동윤 2021-09-16 20:21:09 +09:00 committed by GitHub
parent e2d8465565
commit f087d1515b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

2
Cargo.lock generated
View File

@ -2903,7 +2903,7 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_testing"
version = "0.32.1"
version = "0.32.2"
dependencies = [
"ansi_term 0.12.1",
"anyhow",

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_transforms_testing"
repository = "https://github.com/swc-project/swc.git"
version = "0.32.1"
version = "0.32.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -692,6 +692,13 @@ where
if let Ok("1") = env::var("UPDATE").as_deref() {
results.push(NormalizedOutput::from(actual_src.clone()).compare_to_file(output));
}
if NormalizedOutput::from(actual_src.clone())
== NormalizedOutput::from(expected_src.clone())
{
return;
}
assert_eq!(
DebugUsingDisplay(&actual_src),
DebugUsingDisplay(&expected_src)