Skip to content

Commit 85a7c22

Browse files
Remove all single_component_path_imports from tests (#993)
I started removing some of these one by one and figured it would be useful to just automate it: ``` rmason@thincrust ~/code/rust-exercises/exercises (master)$ find . | awk -F/ '$3 ~/Cargo.toml/ {print $2}' | while read dir; do pushd $dir; cargo clean; cargo clippy --tests -- -A clippy::all -W clippy::single_component_path_imports; popd; done 2>&1 | grep -A1 -i "warning: this import" | grep tests --> tests/etl.rs:1:1 --> tests/grains.rs:1:1 --> tests/alphametics.rs:1:1 --> tests/say.rs:1:1 --> tests/acronym.rs:1:1 --> tests/hamming.rs:1:1 --> tests/sieve.rs:1:1 --> tests/paasio.rs:1:1 --> tests/saddle-points.rs:1:1 --> tests/tournament.rs:1:1 --> tests/hello-world.rs:1:1 --> tests/word-count.rs:3:1 --> tests/dominoes.rs:1:1 --> tests/raindrops.rs:1:1 ```
1 parent a5b51a4 commit 85a7c22

File tree

14 files changed

+0
-27
lines changed

14 files changed

+0
-27
lines changed

exercises/acronym/tests/acronym.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use acronym;
2-
31
#[test]
42
fn empty() {
53
assert_eq!(acronym::abbreviate(""), "");

exercises/alphametics/tests/alphametics.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use alphametics;
21
use std::collections::HashMap;
32

43
fn assert_alphametic_solution_eq(puzzle: &str, solution: &[(char, u8)]) {

exercises/dominoes/tests/dominoes.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use dominoes;
2-
31
use crate::CheckResult::*;
42

53
type Domino = (u8, u8);

exercises/etl/tests/etl.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use etl;
2-
31
use std::collections::BTreeMap;
42

53
#[test]

exercises/grains/tests/grains.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use grains;
2-
31
fn process_square_case(input: u32, expected: u64) {
42
assert_eq!(grains::square(input), expected);
53
}

exercises/hamming/tests/hamming.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use hamming;
2-
31
fn process_distance_case(strand_pair: [&str; 2], expected_distance: Option<usize>) {
42
assert_eq!(
53
hamming::hamming_distance(strand_pair[0], strand_pair[1]),

exercises/hello-world/tests/hello-world.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use hello_world;
2-
31
#[test]
42
fn test_hello_world() {
53
assert_eq!("Hello, World!", hello_world::hello());

exercises/paasio/tests/paasio.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use paasio;
2-
31
/// test a few read scenarios
42
macro_rules! test_read {
53
($(#[$attr:meta])* $modname:ident ($input:expr, $len:expr)) => {

exercises/raindrops/tests/raindrops.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use raindrops;
2-
31
#[test]
42
fn test_1() {
53
assert_eq!("1", raindrops::raindrops(1));

exercises/saddle-points/tests/saddle-points.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use saddle_points;
2-
31
use saddle_points::find_saddle_points;
42

53
// We don't care about order

0 commit comments

Comments
 (0)