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:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user