Skip to content

Commit

Permalink
Fix clippy lints for examples, tests, and benches (#199)
Browse files Browse the repository at this point in the history
* Fix clippy warnings

* Add examples, tests and benches to clippy ci
  • Loading branch information
tqwewe committed Mar 15, 2023
1 parent 36d9a0c commit 52ffbdb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -49,7 +49,7 @@ jobs:
# Rust builds can take some time, cache them.
- uses: Swatinem/rust-cache@v2
- name: "Run clippy check"
run: cargo clippy -- -D warnings
run: cargo clippy --examples --tests --benches -- -D warnings
- name: "Check formatting"
run: cargo fmt -- --check
- name: "Run tests"
Expand Down
10 changes: 5 additions & 5 deletions src/config.rs
Expand Up @@ -247,17 +247,17 @@ mod tests {
let guest_api =
get_absolute_path(Path::new("crates/lunatic-sqlite-api/src/guest_api")).unwrap();
// checks that there's no access to any ancestor paths
assert_eq!(path_is_ancestor(&guest_api, &crates), false);
assert_eq!(path_is_ancestor(&guest_api, &sqlite), false);
assert_eq!(path_is_ancestor(&guest_api, &src), false);
assert!(!path_is_ancestor(&guest_api, &crates));
assert!(!path_is_ancestor(&guest_api, &sqlite));
assert!(!path_is_ancestor(&guest_api, &src));
}

#[test]
fn test_forbidden_absolute_paths() {
let src = get_absolute_path(Path::new("crates/lunatic-sqlite-api/src")).unwrap();
// checks that there's no access to any ancestor paths
assert_eq!(path_is_ancestor(&src, Path::new("/")), false);
assert_eq!(path_is_ancestor(&src, Path::new("/etc/passwd")), false);
assert!(!path_is_ancestor(&src, Path::new("/")));
assert!(!path_is_ancestor(&src, Path::new("/etc/passwd")));
}

#[test]
Expand Down

0 comments on commit 52ffbdb

Please sign in to comment.