Skip to content

Commit

Permalink
Add examples_do_not_have_gitignore test
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Apr 28, 2023
1 parent e4c8c0d commit dad4f73
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ publish = false
[dev-dependencies]
cargo_metadata = "0.15"
toml_edit = "0.19"
walkdir = "2.3"

dylint_internal = { version = "=2.1.7", path = "../internal", features = ["clippy_utils", "examples"] }
14 changes: 14 additions & 0 deletions examples/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mod test {
};
use std::{ffi::OsStr, fs::read_to_string};
use toml_edit::{Document, Item, Value};
use walkdir::WalkDir;

#[test]
fn examples() {
Expand Down Expand Up @@ -95,4 +96,17 @@ mod test {
assert!(!components.contains(&"rust-src"));
}
}

#[test]
fn examples_do_not_have_gitignore() {
for entry in WalkDir::new(".") {
let entry = entry.unwrap();
let path = entry.path();
assert_ne!(
path.file_name(),
Some(OsStr::new(".gitignore")),
"failed for {path:?}"
);
}
}
}

0 comments on commit dad4f73

Please sign in to comment.