From acaae1c2e5e12115b23a53b904d1e0b9947d7d6a Mon Sep 17 00:00:00 2001 From: Paulo Aboim Pinto Date: Sun, 7 Jun 2026 12:24:13 +0200 Subject: [PATCH] test(tui): address command harness review --- crates/tui/src/commands/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/tui/src/commands/mod.rs b/crates/tui/src/commands/mod.rs index 130c598c..5478ee4a 100644 --- a/crates/tui/src/commands/mod.rs +++ b/crates/tui/src/commands/mod.rs @@ -1318,7 +1318,7 @@ mod tests { command.name ); - for alias in command.aliases { + for &alias in command.aliases { assert!( !alias.trim().is_empty(), "/{} alias must not be empty", @@ -1326,7 +1326,7 @@ mod tests { ); assert_eq!( alias.trim(), - *alias, + alias, "/{} alias /{alias} must not need trimming", command.name ); @@ -1353,7 +1353,7 @@ mod tests { assert_eq!(resolved.name, command.name); } - for alias in command.aliases { + for &alias in command.aliases { for lookup in [alias.to_string(), format!("/{alias}")] { let resolved = get_command_info(&lookup).unwrap_or_else(|| { panic!("{lookup:?} should resolve to /{}", command.name) @@ -1366,8 +1366,8 @@ mod tests { #[test] fn every_registered_command_has_a_help_topic() { + let mut app = create_test_app(); for command in COMMANDS { - let mut app = create_test_app(); let result = execute(&format!("/help {}", command.name), &mut app); assert!( !result.is_error,