From 54e3aa3422ae75fc9d69ceb9d09a8cd1a3e168ec Mon Sep 17 00:00:00 2001 From: Justin Wernick Date: Tue, 28 Feb 2023 21:12:06 +0200 Subject: Specifically test that commands that other shells might support aren't leaked through --- tests/cli.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'tests/cli.rs') diff --git a/tests/cli.rs b/tests/cli.rs index 672a798..fcf38e8 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -46,11 +46,20 @@ fn quits_when_exit_command_is_sent() -> Result<()> { Ok(()) } +#[test] +fn reports_error_with_unsupported_shell_commands() -> Result<()> { + let mut p = spawn_interactive_process()?; + p.send_line("ls")?; + p.exp_string("Unknown input \"ls\"")?; + expect_prompt(&mut p)?; + Ok(()) +} + #[test] fn reports_error_with_nonsense_input() -> Result<()> { let mut p = spawn_interactive_process()?; - p.send_line("asdfg")?; - p.exp_string("Unknown input \"asdfg\"")?; + p.send_line(" asd fg ")?; + p.exp_string("Unknown input \"asd fg\"")?; expect_prompt(&mut p)?; Ok(()) } -- cgit v1.2.3