Skip to content
Snippets Groups Projects
Verified Commit 7a55e3b2 authored by Eduardo Trujillo's avatar Eduardo Trujillo
Browse files

chore: Address clippy lints in tests

parent f6f46f69
No related branches found
No related tags found
No related merge requests found
Pipeline #311 passed
......@@ -65,7 +65,7 @@ rust-nightly-clippy:
- target/
<<: *rust_template
script:
- cargo clippy --all --verbose -- -D warnings
- cargo clippy --all --tests --verbose -- -D warnings
pages:
stage: build
......
#![deny(rust_2018_idioms, nonstandard_style)]
#![warn(future_incompatible)]
#![doc = include_str!("../README.md")]
/// CLI application utilities.
......
......@@ -225,7 +225,7 @@ mod tests {
use std::path::PathBuf;
#[test]
fn test_initialize() -> () {
fn test_initialize() {
// Create dir for the first time.
let result = RunDir::new("tests/rundir").initialize();
......@@ -272,21 +272,21 @@ mod tests {
}
#[test]
fn test_subdirs() -> () {
fn test_subdirs() {
let rundir = RunDir::new("tests/rundir2").allow_cleaning(true);
rundir.initialize().unwrap();
assert_eq!(PathBuf::from("tests/rundir2/subtest").exists(), false);
assert_eq!(rundir.subdir_exists("subtest").unwrap(), false);
assert!(!PathBuf::from("tests/rundir2/subtest").exists());
assert!(!rundir.subdir_exists("subtest").unwrap());
rundir.create_subdir("subtest").unwrap();
assert_eq!(PathBuf::from("tests/rundir2/subtest").exists(), true);
assert_eq!(rundir.subdir_exists("subtest").unwrap(), true);
assert!(PathBuf::from("tests/rundir2/subtest").exists());
assert!(rundir.subdir_exists("subtest").unwrap());
rundir.remove_subdir_all("subtest").unwrap();
assert_eq!(PathBuf::from("tests/rundir2/subtest").exists(), false);
assert_eq!(rundir.subdir_exists("subtest").unwrap(), false);
assert!(!PathBuf::from("tests/rundir2/subtest").exists());
assert!(!rundir.subdir_exists("subtest").unwrap());
rundir.cleanup().unwrap();
}
......
......@@ -14,7 +14,7 @@ mod test {
use super::*;
#[test]
fn test_to_train_case() -> () {
fn test_to_train_case() {
assert_eq!(to_train_case("omg-OMG_omg123 omg"), "OMG_OMG_OMG123_OMG")
}
}
......@@ -154,7 +154,7 @@ mod tests {
let end_handle = handle.get_end_handle();
assert_eq!((&end_handle).has_ended(), Ok(false));
assert_eq!(end_handle.has_ended(), Ok(false));
end_tx.send(()).unwrap();
......@@ -181,7 +181,7 @@ mod tests {
end_handles.insert(handle.thread().id(), handle.get_end_handle());
}
for (_, end_handle) in &end_handles {
for end_handle in end_handles.values() {
assert_eq!(end_handle.has_ended(), Ok(false));
}
......
......@@ -226,7 +226,7 @@ mod tests {
let test_handle = thread::spawn(move || {
let watch_result = MONITOR.watch(Some(&thread_ids)).unwrap();
assert_eq!(watch_result.is_empty(), false);
assert!(!watch_result.is_empty());
assert_eq!(watch_result[0].id(), handle.thread().id());
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment