console: piped lines run in order; cargo-valid: empty_world allows the first folder of the package path

The runner mounts the package at its host path, so / shows its first
folder: tmp locally, build in the Nix sandbox.
This commit is contained in:
2026-10-23 08:48:14 +01:00
parent c926f3bc72
commit e3935031ac
3 changed files with 70 additions and 56 deletions
+15 -5
View File
@@ -99,11 +99,21 @@ mod tests {
.unwrap()
.map(|entry| entry.unwrap().file_name())
.collect();
assert!(names.iter().all(|name| {
["proc", "self", "run", "tmp"]
.iter()
.any(|allowed| name == allowed)
}));
// The runner mounts the package folder at its host path, so the first
// folder of that path also appears in `/` (for example `tmp` or `build`).
let package = env!("CARGO_MANIFEST_DIR")
.trim_start_matches('/')
.split('/')
.next()
.unwrap();
assert!(
names.iter().all(|name| {
["proc", "self", "run", package]
.iter()
.any(|allowed| name == allowed)
}),
"{names:?}"
);
for path in ["/proc", "/self", "/run"] {
assert!(std::path::Path::new(path).is_dir());
}