Skip to content

Commit

Permalink
test(css/minifier): Fix fixture tester (#6222)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Oct 27, 2022
1 parent f56d16d commit cd1319d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
12 changes: 7 additions & 5 deletions crates/swc_css_minifier/tests/fixture.rs
Expand Up @@ -17,16 +17,18 @@ fn minify_fixtures(input: PathBuf) {
input.extension().unwrap().to_string_lossy()
));

testing::run_test(false, |cm, _handler| {
testing::run_test(false, |cm, handler| {
let fm = cm.load_file(&input).unwrap();

let mut errors = vec![];
let res: Result<Stylesheet, _> = parse_file(&fm, Default::default(), &mut errors);

if res.is_err() || !errors.is_empty() {
// TODO uncomment me
// We are not debugging parser
// return Ok(());
for err in errors {
err.to_diagnostics(handler).emit();
}

if handler.has_errors() {
return Err(());
}

let mut ss = res.unwrap();
Expand Down
@@ -1,5 +1,3 @@
div[data-size="calc(3*3)"] {
}

div:nth-child(2n + calc(3*3)) {
color: red;
}
@@ -0,0 +1 @@
div[data-size="calc(3*3)"]{color:red}
Expand Up @@ -194,9 +194,9 @@
color: hwb(120 20% 30%);
color: hwb(90deg 50% 50%);
color: hwb(90deg 50% 50%);
color: hwb(90deg 50% 50%, 0.2);
color: hwb(90deg 50% 50% / 0.2);
color: hwb(90 50% 50%);
color: hwb(90 50% 50% 0.2);
color: hwb(90 50% 50% / 0.2);
color: hwb(90deg 33.75% 50%);
color: hwb(120 30% 50%);
color: hwb(120 30% 50% / 0.5);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit cd1319d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: cd1319d Previous: c255cfd Ratio
es/full/bugs-1 346200 ns/iter (± 42083) 425656 ns/iter (± 12124) 0.81
es/full/minify/libraries/antd 1805642149 ns/iter (± 30935257) 2112013799 ns/iter (± 23917214) 0.85
es/full/minify/libraries/d3 401356799 ns/iter (± 14852244) 436986000 ns/iter (± 8385848) 0.92
es/full/minify/libraries/echarts 1526700370 ns/iter (± 232311206) 1800964043 ns/iter (± 18143263) 0.85
es/full/minify/libraries/jquery 98047893 ns/iter (± 4075327) 119725938 ns/iter (± 3836487) 0.82
es/full/minify/libraries/lodash 120489251 ns/iter (± 3540810) 140705740 ns/iter (± 2894877) 0.86
es/full/minify/libraries/moment 60304291 ns/iter (± 2730455) 70106299 ns/iter (± 460609) 0.86
es/full/minify/libraries/react 21684238 ns/iter (± 9976723) 24144169 ns/iter (± 281704) 0.90
es/full/minify/libraries/terser 312157021 ns/iter (± 14167185) 330787959 ns/iter (± 13183300) 0.94
es/full/minify/libraries/three 562702087 ns/iter (± 20070923) 604775193 ns/iter (± 11840143) 0.93
es/full/minify/libraries/typescript 3478694322 ns/iter (± 50013726) 4009473205 ns/iter (± 30798593) 0.87
es/full/minify/libraries/victory 841698884 ns/iter (± 77937733) 904122343 ns/iter (± 20983518) 0.93
es/full/minify/libraries/vue 182475692 ns/iter (± 17918984) 178210396 ns/iter (± 4913465) 1.02
es/full/codegen/es3 35569 ns/iter (± 2763) 40808 ns/iter (± 486) 0.87
es/full/codegen/es5 35032 ns/iter (± 3067) 40599 ns/iter (± 540) 0.86
es/full/codegen/es2015 34868 ns/iter (± 1322) 40717 ns/iter (± 990) 0.86
es/full/codegen/es2016 34937 ns/iter (± 1299) 40545 ns/iter (± 712) 0.86
es/full/codegen/es2017 35118 ns/iter (± 2004) 40537 ns/iter (± 846) 0.87
es/full/codegen/es2018 35078 ns/iter (± 1872) 40572 ns/iter (± 1096) 0.86
es/full/codegen/es2019 34867 ns/iter (± 2519) 40580 ns/iter (± 1502) 0.86
es/full/codegen/es2020 34951 ns/iter (± 3281) 40719 ns/iter (± 864) 0.86
es/full/all/es3 232302316 ns/iter (± 19226786) 232201716 ns/iter (± 4903607) 1.00
es/full/all/es5 221754321 ns/iter (± 14723222) 219331415 ns/iter (± 3412543) 1.01
es/full/all/es2015 173135312 ns/iter (± 13768694) 177321052 ns/iter (± 4010221) 0.98
es/full/all/es2016 172025194 ns/iter (± 16974698) 177739154 ns/iter (± 3677578) 0.97
es/full/all/es2017 172960025 ns/iter (± 17061056) 177918666 ns/iter (± 4961369) 0.97
es/full/all/es2018 168162532 ns/iter (± 13130233) 175457004 ns/iter (± 4340355) 0.96
es/full/all/es2019 170274546 ns/iter (± 14900735) 176206418 ns/iter (± 4462392) 0.97
es/full/all/es2020 139988613 ns/iter (± 10123428) 166514582 ns/iter (± 4176959) 0.84
es/full/parser 757005 ns/iter (± 42197) 882187 ns/iter (± 48365) 0.86
es/full/base/fixer 26957 ns/iter (± 2119) 32344 ns/iter (± 3300) 0.83
es/full/base/resolver_and_hygiene 93758 ns/iter (± 7819) 114658 ns/iter (± 4395) 0.82
serialization of ast node 223 ns/iter (± 29) 259 ns/iter (± 3) 0.86
serialization of serde 222 ns/iter (± 42) 263 ns/iter (± 22) 0.84

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.