rust/check_diff/tests/bash_commands.rs
benluiwj 63d50dd1d7 Add cd and git clone functionality to check-diff crate
Included unit tests for the new functionality as well.
2024-08-03 05:17:27 -06:00

13 lines
364 B
Rust

use check_diff::change_directory_to_path;
use std::env;
use tempfile::Builder;
#[test]
fn cd_test() {
// Creates an empty directory in the current working directory
let dir = Builder::new().tempdir_in("").unwrap();
let dest_path = dir.path();
change_directory_to_path(dest_path).unwrap();
assert_eq!(env::current_dir().unwrap(), dest_path);
}