mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 13:35:42 +09:00
chore(repo): remove dead code and useless tests (#3375)
This commit is contained in:
1 parent
7e177a1c90
commit
1cd62eb661
1391 files changed
+783
-120415
No files matched your search
@@ -450,46 +450,3 @@ impl ShutdownSignal {
|
||||
"signal"
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn formats_posix_commands_for_logs() {
|
||||
assert_eq!(format_command(&["pnpm", "build"]), "pnpm build");
|
||||
assert_eq!(
|
||||
format_command(&["", "two words", "a'b"]),
|
||||
"'' 'two words' 'a'\"'\"'b'"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn restart_budget_allows_limited_restarts_within_window() {
|
||||
let mut restarts = VecDeque::new();
|
||||
let base = Instant::now();
|
||||
for offset in 0..RESTART_LIMIT {
|
||||
assert!(!restart_budget_exceeded(
|
||||
&mut restarts,
|
||||
base + Duration::from_secs(offset as u64)
|
||||
));
|
||||
}
|
||||
assert!(restart_budget_exceeded(
|
||||
&mut restarts,
|
||||
base + Duration::from_secs(RESTART_LIMIT as u64)
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn restart_budget_resets_after_window_elapses() {
|
||||
let mut restarts = VecDeque::new();
|
||||
let base = Instant::now();
|
||||
for _ in 0..RESTART_LIMIT {
|
||||
assert!(!restart_budget_exceeded(&mut restarts, base));
|
||||
}
|
||||
assert!(!restart_budget_exceeded(
|
||||
&mut restarts,
|
||||
base + RESTART_WINDOW + Duration::from_secs(1)
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user