-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update README * simplify tests
- Loading branch information
Showing
7 changed files
with
70 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
mod testenv; | ||
use std::{fs, io::BufRead, path::PathBuf}; | ||
|
||
use itertools::Itertools; | ||
pub use testenv::*; | ||
|
||
#[test] | ||
pub fn test_path_is_set() { | ||
let testenv = TestEnv::new("pwsh"); | ||
let res = testenv.run_with_profile("(gcm tabcomplete).Path").unwrap(); | ||
let lines = res.stdout.lines().map(|x| x.unwrap()).collect_vec(); | ||
|
||
let bin_invoked_path = fs::canonicalize(&lines[0]).expect("invoked path"); | ||
let binding = PathBuf::from(file!()); | ||
let project_path = binding | ||
.as_path() | ||
.parent() | ||
.expect("tests directory") | ||
.parent() | ||
.expect("rootdirectory"); | ||
let expected_bin_path = project_path.join("target").join("debug").join(format!( | ||
"tabcomplete{}", | ||
if cfg!(windows) { ".exe" } else { "" } | ||
)); | ||
|
||
let expected_bin = fs::canonicalize(expected_bin_path).expect("bin path should exist"); | ||
assert_eq!(expected_bin, bin_invoked_path); | ||
} | ||
|
||
#[test] | ||
pub fn test_git_is_defined() { | ||
let testenv = TestEnv::new("pwsh"); | ||
testenv | ||
.run_with_profile("git -h") | ||
.expect("git should be defined"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters