summaryrefslogtreecommitdiffstats
path: root/tests/production_surface.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/production_surface.rs')
-rw-r--r--tests/production_surface.rs26
1 files changed, 6 insertions, 20 deletions
diff --git a/tests/production_surface.rs b/tests/production_surface.rs
index bcf3e92..bf0a497 100644
--- a/tests/production_surface.rs
+++ b/tests/production_surface.rs
@@ -49,16 +49,10 @@ fn no_production_module_references_the_shim_harness() {
fn the_served_index_has_exactly_one_serialization_lock() {
let src = std::fs::read_to_string(Path::new(env!("CARGO_MANIFEST_DIR")).join("src/pipeline/publish.rs"))
.expect("read publish.rs");
- let mutexes = src
- .lines()
- .filter(|l| l.contains("static") && l.contains("Mutex<"))
- .collect::<Vec<_>>();
+ let mutexes = src.lines().filter(|l| l.contains("static") && l.contains("Mutex<")).collect::<Vec<_>>();
assert_eq!(mutexes.len(), 1, "publish.rs must declare exactly one serialization mutex, found {mutexes:?}");
assert!(!src.contains("PUBLISH_LOCK"), "the second lock must stay deleted");
- let acquisitions = src
- .lines()
- .filter(|l| l.contains("lock_repo()") && !l.trim_start().starts_with("fn "))
- .count();
+ let acquisitions = src.lines().filter(|l| l.contains("lock_repo()") && !l.trim_start().starts_with("fn ")).count();
assert!(
acquisitions >= 2,
"publish and withdraw_package must both take the repo lock; found {acquisitions} acquisitions"
@@ -67,8 +61,8 @@ fn the_served_index_has_exactly_one_serialization_lock() {
#[test]
fn the_shim_binaries_are_test_only() {
- let manifest = std::fs::read_to_string(Path::new(env!("CARGO_MANIFEST_DIR")).join("Cargo.toml"))
- .expect("read Cargo.toml");
+ let manifest =
+ std::fs::read_to_string(Path::new(env!("CARGO_MANIFEST_DIR")).join("Cargo.toml")).expect("read Cargo.toml");
for tool in ["mkarchroot", "makechrootpkg", "makepkg", "repo-add", "gpg", "pacman"] {
let block = manifest
.split("[[bin]]")
@@ -169,20 +163,12 @@ fn the_virtual_clock_is_compiled_out_without_test_support() {
fallback.contains("pub fn virtual_sleep() -> bool") && fallback.contains("false"),
"the fallback must report a real wait so the seam compiles to a plain sleep"
);
- assert!(
- !fallback.contains("Mutex"),
- "nothing may be locked on the wait path of a production build"
- );
+ assert!(!fallback.contains("Mutex"), "nothing may be locked on the wait path of a production build");
}
#[test]
fn control_loops_wait_through_the_clock_seam() {
- for file in [
- "src/pipeline/dispatch.rs",
- "src/watch/scheduler.rs",
- "src/http/sse.rs",
- "src/sandbox/remote.rs",
- ] {
+ for file in ["src/pipeline/dispatch.rs", "src/watch/scheduler.rs", "src/http/sse.rs", "src/sandbox/remote.rs"] {
let src = read(file);
assert!(
!src.contains("std::thread::sleep"),