diff --git a/crates/radicle-cli-test/src/lib.rs b/crates/radicle-cli-test/src/lib.rs index 095b9d845..7a32e9302 100644 --- a/crates/radicle-cli-test/src/lib.rs +++ b/crates/radicle-cli-test/src/lib.rs @@ -576,7 +576,7 @@ mod tests { use pretty_assertions::assert_eq; #[test] - fn test_parse() { + fn parse() { let input = r#" Let's try to track @dave and @sean: ``` RAD_HINT=true @@ -664,7 +664,7 @@ $ rad sync } #[test] - fn test_run() { + fn run() { let input = r#" Running a simple command such as `head`: ``` @@ -688,7 +688,7 @@ name = "radicle-cli-test" } #[test] - fn test_example_spaced_brackets() { + fn example_spaced_brackets() { let input = r#" Running a simple command such as `head`: ``` diff --git a/crates/radicle-cli/src/commands/inspect.rs b/crates/radicle-cli/src/commands/inspect.rs index 6cd54677f..977730078 100644 --- a/crates/radicle-cli/src/commands/inspect.rs +++ b/crates/radicle-cli/src/commands/inspect.rs @@ -309,10 +309,9 @@ fn tree(mut refs: Vec) -> String { #[cfg(test)] mod test { - use super::*; #[test] - fn test_tree() { + fn tree() { let arg = vec![ String::from("z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi/refs/heads/master"), String::from("z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi/refs/rad/id"), @@ -329,7 +328,7 @@ z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi "# .trim_start(); - assert_eq!(tree(arg), exp); - assert_eq!(tree(vec![String::new()]), "\n"); + assert_eq!(super::tree(arg), exp); + assert_eq!(super::tree(vec![String::new()]), "\n"); } } diff --git a/crates/radicle-cli/src/commands/patch/review/builder.rs b/crates/radicle-cli/src/commands/patch/review/builder.rs index 4b48d2668..f2815c6f5 100644 --- a/crates/radicle-cli/src/commands/patch/review/builder.rs +++ b/crates/radicle-cli/src/commands/patch/review/builder.rs @@ -964,7 +964,7 @@ mod tests { use super::*; #[test] - fn test_review_comments_basic() { + fn review_comments_basic() { let input = r#" > @@ -2559,18 +2560,18 @@ where > // Only consider onion addresses if configured. @@ -1081,7 +1081,7 @@ Comment #5. } #[test] - fn test_review_comments_multiline() { + fn review_comments_multiline() { let input = r#" > @@ -2559,9 +2560,7 @@ where > // Only consider onion addresses if configured. @@ -1176,7 +1176,7 @@ Woof. } #[test] - fn test_review_comments_before() { + fn review_comments_before() { let input = r#" This is a top-level comment. @@ -1228,7 +1228,7 @@ This is a top-level comment. } #[test] - fn test_review_comments_split_hunk() { + fn review_comments_split_hunk() { let input = r#" > @@ -2559,6 +2560,4 @@ where > // Only consider onion addresses if configured. diff --git a/crates/radicle-cli/src/git.rs b/crates/radicle-cli/src/git.rs index a476a3a24..a3aaccc9a 100644 --- a/crates/radicle-cli/src/git.rs +++ b/crates/radicle-cli/src/git.rs @@ -469,7 +469,7 @@ mod test { use std::str::FromStr; #[test] - fn test_version_ord() { + fn version_ord() { assert!( Version { major: 2, @@ -495,7 +495,7 @@ mod test { } #[test] - fn test_version_from_str() { + fn version_from_str() { assert_eq!( Version::from_str("git version 2.34.1\n").ok(), Some(Version { diff --git a/crates/radicle-cli/src/git/pretty_diff.rs b/crates/radicle-cli/src/git/pretty_diff.rs index 53bb7052c..f5bdf5a20 100644 --- a/crates/radicle-cli/src/git/pretty_diff.rs +++ b/crates/radicle-cli/src/git/pretty_diff.rs @@ -600,7 +600,7 @@ mod test { #[test] #[ignore] - fn test_pretty() { + fn pretty() { let repo = Repository::open_ext::<_, _, &[&OsStr]>( env!("CARGO_MANIFEST_DIR"), RepositoryOpenFlags::all(), diff --git a/crates/radicle-cli/src/git/unified_diff.rs b/crates/radicle-cli/src/git/unified_diff.rs index 24fb8f8df..8e1e0572a 100644 --- a/crates/radicle-cli/src/git/unified_diff.rs +++ b/crates/radicle-cli/src/git/unified_diff.rs @@ -620,7 +620,7 @@ mod test { use super::*; #[test] - fn test_diff_encode_decode_diff() { + fn diff_encode_decode_diff() { let diff_a = diff::Diff::parse(include_str!(concat!( env!("CARGO_MANIFEST_DIR"), "/tests/data/diff.diff" @@ -636,7 +636,7 @@ mod test { } #[test] - fn test_diff_content_encode_decode_content() { + fn diff_content_encode_decode_content() { let diff_content = diff::DiffContent::parse(include_str!(concat!( env!("CARGO_MANIFEST_DIR"), "/tests/data/diff_body.diff" diff --git a/crates/radicle-cli/src/terminal/format.rs b/crates/radicle-cli/src/terminal/format.rs index e3e077396..be75fec66 100644 --- a/crates/radicle-cli/src/terminal/format.rs +++ b/crates/radicle-cli/src/terminal/format.rs @@ -413,10 +413,9 @@ pub mod identity { #[cfg(test)] mod test { use super::*; - use html::strip_comments; #[test] - fn test_strip_comments() { + fn strip_comments() { let test = "\ commit 2\n\ \n\ @@ -428,7 +427,7 @@ mod test { commit 2\n\ "; - let res = strip_comments(test); + let res = html::strip_comments(test); assert_eq!(exp, res); let test = "\ @@ -438,7 +437,7 @@ mod test { commit 2\n\ -->"; - let res = strip_comments(test); + let res = html::strip_comments(test); assert_eq!(exp, res); let test = "\ @@ -447,7 +446,7 @@ mod test { "; let exp = ""; - let res = strip_comments(test); + let res = html::strip_comments(test); assert_eq!(exp, res); let test = "\ @@ -464,17 +463,20 @@ mod test { \n\ -->"; - let res = strip_comments(test); + let res = html::strip_comments(test); assert_eq!(exp, res); } #[test] - fn test_bytes() { - assert_eq!(bytes(1023).to_string(), "1023 B"); - assert_eq!(bytes(1024).to_string(), "1 KiB"); - assert_eq!(bytes(1024 * 9).to_string(), "9 KiB"); - assert_eq!(bytes(1024usize.pow(2)).to_string(), "1 MiB"); - assert_eq!(bytes(1024usize.pow(2) * 56).to_string(), "56 MiB"); - assert_eq!(bytes(1024usize.pow(3) * 1024).to_string(), "1024 GiB"); + fn bytes() { + assert_eq!(super::bytes(1023).to_string(), "1023 B"); + assert_eq!(super::bytes(1024).to_string(), "1 KiB"); + assert_eq!(super::bytes(1024 * 9).to_string(), "9 KiB"); + assert_eq!(super::bytes(1024usize.pow(2)).to_string(), "1 MiB"); + assert_eq!(super::bytes(1024usize.pow(2) * 56).to_string(), "56 MiB"); + assert_eq!( + super::bytes(1024usize.pow(3) * 1024).to_string(), + "1024 GiB" + ); } } diff --git a/crates/radicle-cli/src/terminal/patch.rs b/crates/radicle-cli/src/terminal/patch.rs index aca262abb..9ee2c3d64 100644 --- a/crates/radicle-cli/src/terminal/patch.rs +++ b/crates/radicle-cli/src/terminal/patch.rs @@ -523,7 +523,7 @@ mod test { } #[test] - fn test_create_display_message() { + fn create_display_message() { let tmpdir = tempfile::tempdir().unwrap(); let (repo, commit_0) = fixtures::repository(&tmpdir); let commit_1 = commit( @@ -539,7 +539,7 @@ mod test { "Commit 2\n\nDescription\n", ); - let res = create_display_message(&repo, &commit_0, &commit_0).unwrap(); + let res = super::create_display_message(&repo, &commit_0, &commit_0).unwrap(); assert_eq!( "\