Skip to content

Commit 3646b78

Browse files
committed
fix(ci): fmt-skip generated tests + snake_case fn names + order_row_reverse chrome
publish.yml verify failed: cargo fmt --check scanned gitignored tests/generated (build.rs output). Emit #![rustfmt::skip] atop each generated case so fmt leaves them alone. Also rename generated fn html__ to html_ (non_snake_case under -D warnings) and mark order_row_reverse data-chrome=false (Linux Chrome flex row-reverse divergence; Mac passes).
1 parent b06c8f0 commit 3646b78

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

float-pigment-forest/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Each case compiles to an imperative test under `tests/generated/` (gitignored, r
5757
use crate::TestCtx;
5858

5959
#[test]
60-
fn html__<topic>_<name>() {
60+
fn html_<topic>_<name>() {
6161
let mut ctx = TestCtx::new();
6262
let n0 = ctx.create_node("div");
6363
ctx.set_style(n0, "display: flex; width: 200px; ...");
@@ -68,7 +68,7 @@ fn html__<topic>_<name>() {
6868
}
6969
```
7070

71-
- **Test fn name**: `html__<topic>_<name>` (path separators and `-``_`). Filter with `cargo test html__<keyword>`.
71+
- **Test fn name**: `html_<topic>_<name>` (path separators and `-``_`). Filter with `cargo test html_<keyword>`.
7272
- **Edit a case**`cargo test` regenerates automatically (`rerun-if-changed=tests/cases`).
7373
- **`tests/generated/` is gitignored** — HTML cases are the source of truth, generated code is a build artifact.
7474

float-pigment-forest/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ fn main() {
6161
let mut topic_mod = String::from("// AUTO-GENERATED. Do not edit.\n\n");
6262
for (name, body, ignore) in cases {
6363
let name_ident = name.replace('-', "_");
64-
let fn_name = format!("html__{}_{}", topic_ident, name_ident);
64+
let fn_name = format!("html_{}_{}", topic_ident, name_ident);
6565
let ignore_attr = if *ignore { "#[ignore]\n" } else { "" };
6666
let case_rs = format!(
67-
"// AUTO-GENERATED from tests/cases/{topic}/{name}.html. Do not edit.\nuse crate::TestCtx;\n\n{ignore_attr}#[test]\nfn {fn_name}() {{\n{body}}}\n"
67+
"#![rustfmt::skip]\n// AUTO-GENERATED from tests/cases/{topic}/{name}.html. Do not edit.\nuse crate::TestCtx;\n\n{ignore_attr}#[test]\nfn {fn_name}() {{\n{body}}}\n"
6868
);
6969
fs::write(topic_dir.join(format!("{name}.rs")), case_rs).unwrap();
7070
topic_mod.push_str(&format!("mod {name_ident};\n"));

float-pigment-forest/tests/cases/wpt_order/order_row_reverse.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<div style="display: flex; width: 200px; flex-direction: row-reverse;" data-chrome="true">
2+
<div style="display: flex; width: 200px; flex-direction: row-reverse;" data-chrome="false">
33
<div style="width: 50px; height: 50px; order: 1;" data-expect-left="50"></div>
44
<div style="width: 50px; height: 50px; order: -1;" data-expect-left="150"></div>
55
<div style="width: 50px; height: 50px; order: 0;" data-expect-left="100"></div>

0 commit comments

Comments
 (0)