Files
PatchRequest-BusyWork/tests/smoke.rs
T
PatchRequest 5d5f15a7da Initial implementation of busywork library
Pattern-breaking sleep replacement that executes real, varied work on
every call. Randomized task selection across 7 categories (compute,
memory, filesystem, registry, winapi, network, crypto) with intensity
levels and jitter. Zero time objects in the library binary.
2026-06-04 12:12:32 +02:00

55 lines
1.1 KiB
Rust

use busywork::{busywork, busywork_with, BusyWork, Categories, Intensity};
#[test]
fn low_intensity_no_panic() {
busywork(Intensity::Low);
}
#[test]
fn medium_intensity_no_panic() {
busywork(Intensity::Medium);
}
#[test]
fn high_compute_only() {
busywork_with(Intensity::High, Categories::COMPUTE);
}
#[test]
fn high_memory_only() {
busywork_with(Intensity::High, Categories::MEMORY);
}
#[test]
fn high_filesystem_only() {
busywork_with(Intensity::High, Categories::FILESYSTEM);
}
#[test]
fn builder_deny_network() {
BusyWork::new(Intensity::Medium)
.deny(Categories::NETWORK)
.run();
}
#[test]
fn builder_no_jitter() {
BusyWork::new(Intensity::Low)
.allow(Categories::COMPUTE | Categories::MEMORY)
.jitter(false)
.run();
}
#[test]
fn empty_categories_no_panic() {
busywork_with(Intensity::Ultra, Categories::empty());
}
#[test]
fn available_returns_all_compiled() {
let avail = Categories::available();
assert!(avail.contains(Categories::COMPUTE));
assert!(avail.contains(Categories::MEMORY));
assert!(avail.contains(Categories::FILESYSTEM));
}