From 9f0f47abaa934b66da5b302236bfc89f95a7f329 Mon Sep 17 00:00:00 2001 From: Justin Wernick Date: Mon, 27 Feb 2023 23:12:32 +0200 Subject: Revamp parsing to support more complex commands --- tests/cli.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/cli.rs') diff --git a/tests/cli.rs b/tests/cli.rs index 8197a92..672a798 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -45,3 +45,22 @@ fn quits_when_exit_command_is_sent() -> Result<()> { p.exp_eof()?; 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\"")?; + expect_prompt(&mut p)?; + Ok(()) +} + +#[test] +fn can_init_a_new_git_repo() -> Result<()> { + let mut p = spawn_interactive_process()?; + p.send_line("git-init my-new-repo")?; + p.exp_string("Successfully created my-new-repo.git")?; + expect_prompt(&mut p)?; + // TODO: assert that the repo is actually there? + Ok(()) +} -- cgit v1.2.3