Skip to content

Commit 4696194

Browse files
committed
Remove test_ prefix from tests
closes #1720
1 parent 6d4fa9f commit 4696194

95 files changed

Lines changed: 899 additions & 905 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

exercises/concept/csv-builder/tests/csv-builder.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use csv_builder::*;
22

33
#[test]
4-
fn test_no_escaping() {
4+
fn no_escaping() {
55
let mut builder = CsvRecordBuilder::new();
66

77
builder.add("ant");
@@ -15,7 +15,7 @@ fn test_no_escaping() {
1515

1616
#[test]
1717
#[ignore]
18-
fn test_quote() {
18+
fn quote() {
1919
let mut builder = CsvRecordBuilder::new();
2020

2121
builder.add("ant");
@@ -28,7 +28,7 @@ fn test_quote() {
2828

2929
#[test]
3030
#[ignore]
31-
fn test_new_line() {
31+
fn new_line() {
3232
let mut builder = CsvRecordBuilder::new();
3333

3434
builder.add("ant");
@@ -39,7 +39,7 @@ fn test_new_line() {
3939
}
4040
#[test]
4141
#[ignore]
42-
fn test_comma() {
42+
fn comma() {
4343
let mut builder = CsvRecordBuilder::new();
4444

4545
builder.add("ant");
@@ -51,7 +51,7 @@ fn test_comma() {
5151

5252
#[test]
5353
#[ignore]
54-
fn test_empty() {
54+
fn empty() {
5555
let builder = CsvRecordBuilder::new();
5656
let list = builder.build();
5757
assert!(list.is_empty());

exercises/concept/health-statistics/tests/health-statistics.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@ const AGE: u32 = 89;
55
const WEIGHT: f32 = 131.6;
66

77
#[test]
8-
fn test_name() {
8+
fn name() {
99
let user = User::new(NAME.into(), AGE, WEIGHT);
1010
assert_eq!(user.name(), NAME);
1111
}
1212

1313
#[test]
1414
#[ignore]
15-
fn test_age() {
15+
fn age() {
1616
let user = User::new(NAME.into(), AGE, WEIGHT);
1717
assert_eq!(user.age(), AGE);
1818
}
1919

2020
#[test]
2121
#[ignore]
22-
fn test_weight() {
22+
fn weight() {
2323
let user = User::new(NAME.into(), AGE, WEIGHT);
2424
assert!((user.weight() - WEIGHT).abs() < f32::EPSILON);
2525
}
2626

2727
#[test]
2828
#[ignore]
29-
fn test_set_age() {
29+
fn set_age() {
3030
let new_age: u32 = 90;
3131
let mut user = User::new(NAME.into(), AGE, WEIGHT);
3232
user.set_age(new_age);
@@ -35,7 +35,7 @@ fn test_set_age() {
3535

3636
#[test]
3737
#[ignore]
38-
fn test_set_weight() {
38+
fn set_weight() {
3939
let new_weight: f32 = 129.4;
4040
let mut user = User::new(NAME.into(), AGE, WEIGHT);
4141
user.set_weight(new_weight);

exercises/concept/magazine-cutout/tests/magazine-cutout.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use magazine_cutout::*;
22

33
#[test]
4-
fn test_magazine_has_fewer_words_available_than_needed() {
4+
fn magazine_has_fewer_words_available_than_needed() {
55
let magazine = "two times three is not four"
66
.split_whitespace()
77
.collect::<Vec<&str>>();
@@ -13,7 +13,7 @@ fn test_magazine_has_fewer_words_available_than_needed() {
1313

1414
#[test]
1515
#[ignore]
16-
fn test_fn_returns_true_for_good_input() {
16+
fn fn_returns_true_for_good_input() {
1717
let magazine = "The metro orchestra unveiled its new grand piano today. Its donor paraphrased Nathn Hale: \"I only regret that I have but one to give \"".split_whitespace().collect::<Vec<&str>>();
1818
let note = "give one grand today."
1919
.split_whitespace()
@@ -23,7 +23,7 @@ fn test_fn_returns_true_for_good_input() {
2323

2424
#[test]
2525
#[ignore]
26-
fn test_fn_returns_false_for_bad_input() {
26+
fn fn_returns_false_for_bad_input() {
2727
let magazine = "I've got a lovely bunch of coconuts."
2828
.split_whitespace()
2929
.collect::<Vec<&str>>();
@@ -35,7 +35,7 @@ fn test_fn_returns_false_for_bad_input() {
3535

3636
#[test]
3737
#[ignore]
38-
fn test_case_sensitivity() {
38+
fn case_sensitivity() {
3939
let magazine = "i've got some lovely coconuts"
4040
.split_whitespace()
4141
.collect::<Vec<&str>>();
@@ -55,7 +55,7 @@ fn test_case_sensitivity() {
5555

5656
#[test]
5757
#[ignore]
58-
fn test_magazine_has_more_words_available_than_needed() {
58+
fn magazine_has_more_words_available_than_needed() {
5959
let magazine = "Enough is enough when enough is enough"
6060
.split_whitespace()
6161
.collect::<Vec<&str>>();
@@ -65,7 +65,7 @@ fn test_magazine_has_more_words_available_than_needed() {
6565

6666
#[test]
6767
#[ignore]
68-
fn test_magazine_has_one_good_word_many_times_but_still_cant_construct() {
68+
fn magazine_has_one_good_word_many_times_but_still_cant_construct() {
6969
let magazine = "A A A".split_whitespace().collect::<Vec<&str>>();
7070
let note = "A nice day".split_whitespace().collect::<Vec<&str>>();
7171
assert!(!can_construct_note(&magazine, &note));

exercises/concept/resistor-color/tests/resistor-color.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
use resistor_color::{color_to_value, colors, value_to_color_string, ResistorColor};
22

33
#[test]
4-
fn test_black() {
4+
fn black() {
55
assert_eq!(color_to_value(ResistorColor::Black), 0);
66
}
77

88
#[test]
99
#[ignore]
10-
fn test_orange() {
10+
fn orange() {
1111
assert_eq!(color_to_value(ResistorColor::Orange), 3);
1212
}
1313

1414
#[test]
1515
#[ignore]
16-
fn test_white() {
16+
fn white() {
1717
assert_eq!(color_to_value(ResistorColor::White), 9);
1818
}
1919

2020
#[test]
2121
#[ignore]
22-
fn test_2() {
22+
fn two() {
2323
assert_eq!(value_to_color_string(2), String::from("Red"));
2424
}
2525

2626
#[test]
2727
#[ignore]
28-
fn test_6() {
28+
fn six() {
2929
assert_eq!(value_to_color_string(6), String::from("Blue"));
3030
}
3131

3232
#[test]
3333
#[ignore]
34-
fn test_8() {
34+
fn eight() {
3535
assert_eq!(value_to_color_string(8), String::from("Grey"));
3636
}
3737

3838
#[test]
3939
#[ignore]
40-
fn test_11_out_of_range() {
40+
fn eleven_out_of_range() {
4141
assert_eq!(
4242
value_to_color_string(11),
4343
String::from("value out of range")
@@ -46,7 +46,7 @@ fn test_11_out_of_range() {
4646

4747
#[test]
4848
#[ignore]
49-
fn test_all_colors() {
49+
fn all_colors() {
5050
use ResistorColor::*;
5151
assert_eq!(
5252
colors(),

exercises/concept/role-playing-game/tests/role-playing-game.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use role_playing_game::*;
22

33
#[test]
4-
fn test_reviving_dead_player() {
4+
fn reviving_dead_player() {
55
let dead_player = Player {
66
health: 0,
77
mana: Some(0),
@@ -17,7 +17,7 @@ fn test_reviving_dead_player() {
1717

1818
#[test]
1919
#[ignore]
20-
fn test_reviving_dead_level9_player() {
20+
fn reviving_dead_level9_player() {
2121
let dead_player = Player {
2222
health: 0,
2323
mana: None,
@@ -33,7 +33,7 @@ fn test_reviving_dead_level9_player() {
3333

3434
#[test]
3535
#[ignore]
36-
fn test_reviving_dead_level10_player() {
36+
fn reviving_dead_level10_player() {
3737
let dead_player = Player {
3838
health: 0,
3939
mana: Some(0),
@@ -49,7 +49,7 @@ fn test_reviving_dead_level10_player() {
4949

5050
#[test]
5151
#[ignore]
52-
fn test_reviving_alive_player() {
52+
fn reviving_alive_player() {
5353
let alive_player = Player {
5454
health: 1,
5555
mana: None,
@@ -60,7 +60,7 @@ fn test_reviving_alive_player() {
6060

6161
#[test]
6262
#[ignore]
63-
fn test_cast_spell_with_enough_mana() {
63+
fn cast_spell_with_enough_mana() {
6464
const HEALTH: u32 = 99;
6565
const MANA: u32 = 100;
6666
const LEVEL: u32 = 100;
@@ -80,7 +80,7 @@ fn test_cast_spell_with_enough_mana() {
8080

8181
#[test]
8282
#[ignore]
83-
fn test_cast_spell_with_insufficient_mana() {
83+
fn cast_spell_with_insufficient_mana() {
8484
let mut no_mana_wizard = Player {
8585
health: 56,
8686
mana: Some(2),
@@ -99,7 +99,7 @@ fn test_cast_spell_with_insufficient_mana() {
9999

100100
#[test]
101101
#[ignore]
102-
fn test_cast_spell_with_no_mana_pool() {
102+
fn cast_spell_with_no_mana_pool() {
103103
const MANA_COST: u32 = 10;
104104

105105
let mut underleveled_player = Player {
@@ -120,7 +120,7 @@ fn test_cast_spell_with_no_mana_pool() {
120120

121121
#[test]
122122
#[ignore]
123-
fn test_cast_large_spell_with_no_mana_pool() {
123+
fn cast_large_spell_with_no_mana_pool() {
124124
const MANA_COST: u32 = 30;
125125

126126
let mut underleveled_player = Player {

exercises/concept/rpn-calculator/tests/rpn-calculator.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,77 +13,77 @@ fn calculator_input(s: &str) -> Vec<CalculatorInput> {
1313
}
1414

1515
#[test]
16-
fn test_empty_input_returns_none() {
16+
fn empty_input_returns_none() {
1717
let input = calculator_input("");
1818
assert_eq!(evaluate(&input), None);
1919
}
2020

2121
#[test]
2222
#[ignore]
23-
fn test_simple_value() {
23+
fn simple_value() {
2424
let input = calculator_input("10");
2525
assert_eq!(evaluate(&input), Some(10));
2626
}
2727

2828
#[test]
2929
#[ignore]
30-
fn test_simple_addition() {
30+
fn simple_addition() {
3131
let input = calculator_input("2 2 +");
3232
assert_eq!(evaluate(&input), Some(4));
3333
}
3434

3535
#[test]
3636
#[ignore]
37-
fn test_simple_subtraction() {
37+
fn simple_subtraction() {
3838
let input = calculator_input("7 11 -");
3939
assert_eq!(evaluate(&input), Some(-4));
4040
}
4141

4242
#[test]
4343
#[ignore]
44-
fn test_simple_multiplication() {
44+
fn simple_multiplication() {
4545
let input = calculator_input("6 9 *");
4646
assert_eq!(evaluate(&input), Some(54));
4747
}
4848

4949
#[test]
5050
#[ignore]
51-
fn test_simple_division() {
51+
fn simple_division() {
5252
let input = calculator_input("57 19 /");
5353
assert_eq!(evaluate(&input), Some(3));
5454
}
5555

5656
#[test]
5757
#[ignore]
58-
fn test_complex_operation() {
58+
fn complex_operation() {
5959
let input = calculator_input("4 8 + 7 5 - /");
6060
assert_eq!(evaluate(&input), Some(6));
6161
}
6262

6363
#[test]
6464
#[ignore]
65-
fn test_too_few_operands_returns_none() {
65+
fn too_few_operands_returns_none() {
6666
let input = calculator_input("2 +");
6767
assert_eq!(evaluate(&input), None);
6868
}
6969

7070
#[test]
7171
#[ignore]
72-
fn test_too_many_operands_returns_none() {
72+
fn too_many_operands_returns_none() {
7373
let input = calculator_input("2 2");
7474
assert_eq!(evaluate(&input), None);
7575
}
7676

7777
#[test]
7878
#[ignore]
79-
fn test_zero_operands_returns_none() {
79+
fn zero_operands_returns_none() {
8080
let input = calculator_input("+");
8181
assert_eq!(evaluate(&input), None);
8282
}
8383

8484
#[test]
8585
#[ignore]
86-
fn test_intermediate_error_returns_none() {
86+
fn intermediate_error_returns_none() {
8787
let input = calculator_input("+ 2 2 *");
8888
assert_eq!(evaluate(&input), None);
8989
}

exercises/concept/short-fibonacci/tests/short-fibonacci.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
use short_fibonacci::*;
22

33
#[test]
4-
fn test_empty() {
4+
fn empty() {
55
assert_eq!(create_empty(), Vec::new());
66
}
7+
78
#[test]
89
#[ignore]
9-
fn test_buffer() {
10+
fn buffer() {
1011
for n in 0..10 {
1112
let zeroized = create_buffer(n);
1213
assert_eq!(zeroized.len(), n);
1314
assert!(zeroized.iter().all(|&v| v == 0));
1415
}
1516
}
17+
1618
#[test]
1719
#[ignore]
18-
fn test_fibonacci() {
20+
fn first_five_elements() {
1921
let fibb = fibonacci();
2022
assert_eq!(fibb.len(), 5);
2123
assert_eq!(fibb[0], 1);

0 commit comments

Comments
 (0)