From 3bace342054a4c4df908a2d72a530e486c97da8e Mon Sep 17 00:00:00 2001 From: Jonathan Woollett-Light Date: Wed, 15 Nov 2023 10:16:51 +0000 Subject: [PATCH] test: Test lower-case logger level Signed-off-by: Jonathan Woollett-Light --- src/vmm/src/logger/logging.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/vmm/src/logger/logging.rs b/src/vmm/src/logger/logging.rs index 49f7915ce2b8..a4204a2b95d7 100644 --- a/src/vmm/src/logger/logging.rs +++ b/src/vmm/src/logger/logging.rs @@ -317,6 +317,13 @@ mod tests { assert_eq!(LevelFilter::from_str("Warn"), Ok(LevelFilter::Warn)); assert_eq!(LevelFilter::from_str("Error"), Ok(LevelFilter::Error)); + assert_eq!(LevelFilter::from_str("off"), Ok(LevelFilter::Off)); + assert_eq!(LevelFilter::from_str("trace"), Ok(LevelFilter::Trace)); + assert_eq!(LevelFilter::from_str("debug"), Ok(LevelFilter::Debug)); + assert_eq!(LevelFilter::from_str("info"), Ok(LevelFilter::Info)); + assert_eq!(LevelFilter::from_str("warn"), Ok(LevelFilter::Warn)); + assert_eq!(LevelFilter::from_str("error"), Ok(LevelFilter::Error)); + assert_eq!(LevelFilter::from_str("OFF"), Ok(LevelFilter::Off)); assert_eq!(LevelFilter::from_str("TRACE"), Ok(LevelFilter::Trace)); assert_eq!(LevelFilter::from_str("DEBUG"), Ok(LevelFilter::Debug)); @@ -324,6 +331,7 @@ mod tests { assert_eq!(LevelFilter::from_str("WARN"), Ok(LevelFilter::Warn)); assert_eq!(LevelFilter::from_str("ERROR"), Ok(LevelFilter::Error)); + assert_eq!(LevelFilter::from_str("warning"), Ok(LevelFilter::Warn)); assert_eq!(LevelFilter::from_str("Warning"), Ok(LevelFilter::Warn)); assert_eq!(LevelFilter::from_str("WARNING"), Ok(LevelFilter::Warn)); }