From b04e5e6280168a2c5b685e6d222d02b74e942089 Mon Sep 17 00:00:00 2001 From: fdai7381 Date: Thu, 19 Jan 2023 15:16:23 +0100 Subject: [PATCH] test: add exit test --- src/builtins/exit.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/builtins/exit.rs b/src/builtins/exit.rs index c71586a..cd71554 100644 --- a/src/builtins/exit.rs +++ b/src/builtins/exit.rs @@ -8,3 +8,13 @@ impl Builtin for Exit { Err(ShellError::Exit) } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_exit() { + assert_eq!(Exit.execute(vec!["arg".to_string()]), Err(ShellError::Exit)) + } +}