Skip to content

Commit caf7b2f

Browse files
committed
fix lint and add test for coverage
1 parent 594f0de commit caf7b2f

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

cpp-linter/src/common_fs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ pub(crate) fn mk_path_abs<P: AsRef<Path>>(path: P) -> Result<PathBuf, std::io::E
399399

400400
#[cfg(test)]
401401
mod test {
402+
#![allow(clippy::unwrap_used)]
402403
use std::path::PathBuf;
403404

404405
use super::FileObj;

cpp-linter/src/run.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ pub(crate) mod test {
281281
"-l".to_string(),
282282
"false".to_string(),
283283
"-V".to_string(),
284-
"-i=target|benches/libgit2".to_string(),
285284
"--repo-root".to_string(),
286285
tmp_workspace.path().to_str().unwrap().to_string(),
287286
])
@@ -302,7 +301,6 @@ pub(crate) mod test {
302301
"--lines-changed-only".to_string(),
303302
"false".to_string(),
304303
"-v".to_string(),
305-
"--ignore=target|benches/libgit2".to_string(),
306304
"--repo-root".to_string(),
307305
tmp_workspace.path().to_str().unwrap().to_string(),
308306
])
@@ -328,4 +326,17 @@ pub(crate) mod test {
328326
.unwrap();
329327
drop(tmp_gh_out);
330328
}
329+
330+
#[tokio::test]
331+
async fn bad_repo_root() {
332+
let tmp_gh_out = setup_tmp_gh_out_path();
333+
run_main(vec![
334+
"cpp-linter".to_string(),
335+
"--repo-root".to_string(),
336+
"non-existent_path".to_string(),
337+
])
338+
.await
339+
.unwrap_err();
340+
drop(tmp_gh_out);
341+
}
331342
}

0 commit comments

Comments
 (0)