From 8965c89d2c01b4217c99667c4d82c334072f7199 Mon Sep 17 00:00:00 2001 From: fdai7451 Date: Thu, 19 Jan 2023 14:22:14 +0100 Subject: [PATCH] test: add cd current directory test --- src/builtins/cd.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/builtins/cd.rs b/src/builtins/cd.rs index c840d80..a4ba4d9 100644 --- a/src/builtins/cd.rs +++ b/src/builtins/cd.rs @@ -14,3 +14,13 @@ impl Builtin for Cd { set_current_dir(first).map_err(|e| ShellError::ExecuteFailure(e.to_string())) } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn cd_current() { + assert_eq!(Cd.execute(vec![".".to_string()]), Ok(())) + } +}