#[derive(Debug)]
pub enum Flow {
Normal,
Next,
NextFile,
ExitPending,
}
#[cfg(test)]
mod tests {
use super::Flow;
#[test]
fn flow_variants_distinct() {
assert!(matches!(Flow::Normal, Flow::Normal));
assert!(!matches!(Flow::Next, Flow::NextFile));
assert!(matches!(Flow::ExitPending, Flow::ExitPending));
}
#[test]
fn flow_debug_includes_variant_name() {
let s = format!("{:?}", Flow::NextFile);
assert!(s.contains("NextFile"), "{s}");
}
#[test]
fn flow_exhaustive_variant_names_in_debug() {
for (f, needle) in [
(Flow::Normal, "Normal"),
(Flow::Next, "Next"),
(Flow::NextFile, "NextFile"),
(Flow::ExitPending, "ExitPending"),
] {
let s = format!("{f:?}");
assert!(s.contains(needle), "{s}");
}
}
}