runtime-rs: Fix test breakage

In #13147, for some reason a test block was added in the middle of code
and the code was stale when merged, which meant that a second
`mod test` section was added, breaking our tests. Merge the two
to fix this.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
stevenhorsman
2026-06-11 12:02:34 +01:00
committed by Fabiano Fidêncio
parent 1d854ad7af
commit fb4600d66a

View File

@@ -89,20 +89,6 @@ fn effective_log_level(enable_debug: bool, log_level: &str) -> &str {
}
}
#[cfg(test)]
mod tests {
use super::effective_log_level;
#[test]
fn test_effective_log_level() {
assert_eq!(effective_log_level(false, "info"), "info");
assert_eq!(effective_log_level(false, "debug"), "debug");
assert_eq!(effective_log_level(true, "info"), "debug");
assert_eq!(effective_log_level(true, "trace"), "trace");
assert_eq!(effective_log_level(true, "warn"), "warn");
}
}
struct RuntimeHandlerManagerInner {
id: String,
msg_sender: Sender<Message>,
@@ -1036,4 +1022,13 @@ mod tests {
.expect("an Action::Shutdown message must be sent to stop the daemon");
assert!(matches!(msg.action, Action::Shutdown));
}
#[test]
fn test_effective_log_level() {
assert_eq!(effective_log_level(false, "info"), "info");
assert_eq!(effective_log_level(false, "debug"), "debug");
assert_eq!(effective_log_level(true, "info"), "debug");
assert_eq!(effective_log_level(true, "trace"), "trace");
assert_eq!(effective_log_level(true, "warn"), "warn");
}
}