Browse Source

test: add cd current directory test

main
fdai7451 2 years ago
parent
commit
764b9569b0
  1. 10
      src/builtins/cd.rs

10
src/builtins/cd.rs

@ -14,3 +14,13 @@ impl Builtin for Cd {
set_current_dir(first).map_err(|e| ShellError::ExecuteFailure(e.to_string())) 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(()))
}
}
Loading…
Cancel
Save