mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-15 07:36:50 +03:00
bake: report the stylesheet path in posix form
The accept's `css.file` is a path the agent reads back, so it is normalised like the wrap step's files; the stylesheet-search test compares posix paths too. Both showed up on the Windows job as backslashes. Written with AI assistance (Claude). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
committed by
Abdul Wahab
co-authored by
Claude Fable 5
parent
3f95a12aa8
commit
6b0e68d89d
@@ -533,12 +533,12 @@ mod tests {
|
||||
std::fs::write(dir.join("src/styles.css"), ".pricing-grid { display: grid }\n.pricing-card { padding: 1px }").unwrap();
|
||||
std::fs::write(dir.join("node_modules/x/x.css"), ".pricing-grid { color: red }").unwrap();
|
||||
let cwd = dir.to_string_lossy().into_owned();
|
||||
let found = find_owning_stylesheet(&cwd, "div.pricing-grid").unwrap();
|
||||
let found = jsp::to_posix(&find_owning_stylesheet(&cwd, "div.pricing-grid").unwrap());
|
||||
assert!(found.ends_with("src/styles.css"), "{found}");
|
||||
assert_eq!(find_owning_stylesheet(&cwd, "div.nothing-here"), None);
|
||||
std::fs::remove_file(dir.join("src/styles.css")).unwrap();
|
||||
// One stylesheet in the app: it is the one.
|
||||
let only = find_owning_stylesheet(&cwd, "div.nothing-here").unwrap();
|
||||
let only = jsp::to_posix(&find_owning_stylesheet(&cwd, "div.nothing-here").unwrap());
|
||||
assert!(only.ends_with("src/reset.css"), "{only}");
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
@@ -489,7 +489,7 @@ fn accept_cli(args: &[String], io: &mut Io) -> i32 {
|
||||
m.insert(
|
||||
"css".into(),
|
||||
json!({
|
||||
"file": css_file.as_deref().map(|f| jsp::relative("/", &cwd, f)),
|
||||
"file": css_file.as_deref().map(|f| jsp::to_posix(&jsp::relative("/", &cwd, f))),
|
||||
"rules": rules,
|
||||
"anchor": anchor,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user