From c33581783a87d6c6c83de49ffb7ca620b024157f Mon Sep 17 00:00:00 2001 From: Daniel Butler <72151886+DanielButler1@users.noreply.github.com> Date: Mon, 11 May 2026 15:09:05 +0100 Subject: [PATCH] Tidy goto invalid number error --- src/cortex-tui/src/commands/executor/navigation.rs | 2 +- src/cortex-tui/src/commands/executor/tests.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cortex-tui/src/commands/executor/navigation.rs b/src/cortex-tui/src/commands/executor/navigation.rs index 7add5e067..932ec65ba 100644 --- a/src/cortex-tui/src/commands/executor/navigation.rs +++ b/src/cortex-tui/src/commands/executor/navigation.rs @@ -26,7 +26,7 @@ impl CommandExecutor { if n.parse::().is_ok() { CommandResult::SetValue("goto".to_string(), n.to_string()) } else { - CommandResult::Error(format!("Invalid message number: {}", n)) + CommandResult::Error(format!("Invalid message number \"{}\"", n)) } } None => CommandResult::OpenModal(ModalType::Form("goto".to_string())), diff --git a/src/cortex-tui/src/commands/executor/tests.rs b/src/cortex-tui/src/commands/executor/tests.rs index 5e05ad996..3dae170d1 100644 --- a/src/cortex-tui/src/commands/executor/tests.rs +++ b/src/cortex-tui/src/commands/executor/tests.rs @@ -389,7 +389,11 @@ fn test_goto_validation() { )); let result = executor.execute_str("/goto abc"); - assert!(matches!(result, CommandResult::Error(_))); + assert!(matches!( + result, + CommandResult::Error(ref msg) + if msg == "Invalid message number \"abc\"" && !msg.contains("number:") + )); let result = executor.execute_str("/goto"); assert!(matches!(