summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Wernick <justin@worthe-it.co.za>2023-02-28 21:12:06 +0200
committerJustin Wernick <justin@worthe-it.co.za>2023-02-28 21:12:06 +0200
commit54e3aa3422ae75fc9d69ceb9d09a8cd1a3e168ec (patch)
tree46a84bd66ae02b7062f92f10a4851987ffb8a711
parent9f0f47abaa934b66da5b302236bfc89f95a7f329 (diff)
Specifically test that commands that other shells might support aren't leaked through
-rw-r--r--readme.org2
-rw-r--r--tests/cli.rs13
2 files changed, 12 insertions, 3 deletions
diff --git a/readme.org b/readme.org
index d42f8d5..5dabeb9 100644
--- a/readme.org
+++ b/readme.org
@@ -16,7 +16,7 @@ Pijul.
- [X] interactive command prompt
- [X] exit command
- [ ] git init of private repo
-- [ ] responds to unknown commands
+- [X] responds to unknown commands
- [ ] git fetch
- git receive-pack <argument>
- [ ] git push
diff --git a/tests/cli.rs b/tests/cli.rs
index 672a798..fcf38e8 100644
--- a/tests/cli.rs
+++ b/tests/cli.rs
@@ -47,10 +47,19 @@ fn quits_when_exit_command_is_sent() -> Result<()> {
}
#[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(())
}