diff --git a/src/run.rs b/src/run.rs index a479653..ab47bd4 100644 --- a/src/run.rs +++ b/src/run.rs @@ -37,9 +37,9 @@ const CONTAINER_STATUSES: [&str; 7] = [ "dead", "exited", "paused", + "removing", "restarting", "running", - "removing", ]; // A Docker event (a line of output from `docker system events --format '{{json .}}'`) @@ -946,7 +946,10 @@ pub fn run( #[cfg(test)] mod tests { - use super::{ImageNode, ImageRecord, RepositoryTag, construct_polyforest, parse_docker_date}; + use super::{ + CONTAINER_STATUSES, ImageNode, ImageRecord, RepositoryTag, + UNINSPECTABLE_CONTAINER_STATUSES, construct_polyforest, parse_docker_date, + }; use crate::state::{self, State}; use std::{ collections::{HashMap, HashSet}, @@ -954,6 +957,15 @@ mod tests { time::Duration, }; + #[test] + fn uninspectable_container_statuses_are_container_statuses() { + assert!( + UNINSPECTABLE_CONTAINER_STATUSES + .iter() + .all(|status| CONTAINER_STATUSES.contains(status)), + ); + } + #[test] fn parse_docker_date_valid() { assert_eq!(