Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exercises/practice/dominoes/tests/dominoes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ fn check(input: &[Domino]) -> CheckResult {
}

fn assert_correct(input: &[Domino]) {
match check(&input) {
match check(input) {
Correct => (),
GotInvalid => panic!("Unexpectedly got invalid on input {:?}", input),
ChainingFailure(output) => panic!(
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/dot-dsl/tests/dot-dsl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fn test_graph_stores_attributes() {
&["a", "b", "c"]
.iter()
.zip(attributes.iter())
.map(|(name, &attr)| Node::new(&name).with_attrs(&[attr]))
.map(|(name, &attr)| Node::new(name).with_attrs(&[attr]))
.collect::<Vec<_>>(),
);

Expand Down
8 changes: 4 additions & 4 deletions exercises/practice/grep/tests/grep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ macro_rules! set_up_test_case {

let expected = vec![$($expected),*];

process_grep_case(&pattern, &flags, &files, &expected);
process_grep_case(pattern, &flags, &files, &expected);
}
};
($(#[$flag:meta])+ $test_case_name:ident(pattern=$pattern:expr, flags=[$($grep_flag:expr),*], files=[$($file:expr),+], prefix_expected=[$($expected:expr),*])) => {
Expand All @@ -141,7 +141,7 @@ macro_rules! set_up_test_case {

let expected = vec![$(concat!(stringify!($test_case_name), "_", $expected)),*];

process_grep_case(&pattern, &flags, &files, &expected);
process_grep_case(pattern, &flags, &files, &expected);
}

}
Expand Down Expand Up @@ -169,7 +169,7 @@ fn test_nonexistent_file_returns_error() {

let files = vec!["test_nonexistent_file_returns_error_iliad.txt"];

assert!(grep(&pattern, &flags, &files).is_err());
assert!(grep(pattern, &flags, &files).is_err());
}

#[test]
Expand All @@ -185,7 +185,7 @@ fn test_grep_returns_result() {

test_fixture.set_up();

assert!(grep(&pattern, &flags, &files).is_ok());
assert!(grep(pattern, &flags, &files).is_ok());
}

// Test grepping a single file
Expand Down
20 changes: 10 additions & 10 deletions exercises/practice/pangram/tests/pangram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,68 +3,68 @@ use pangram::*;
#[test]
fn empty_strings_are_not_pangrams() {
let sentence = "";
assert!(!is_pangram(&sentence));
assert!(!is_pangram(sentence));
}

#[test]
#[ignore]
fn classic_pangram_is_a_pangram() {
let sentence = "the quick brown fox jumps over the lazy dog";
assert!(is_pangram(&sentence));
assert!(is_pangram(sentence));
}

#[test]
#[ignore]
fn pangrams_must_have_all_letters() {
let sentence = "a quick movement of the enemy will jeopardize five gunboats";
assert!(!is_pangram(&sentence));
assert!(!is_pangram(sentence));
}

#[test]
#[ignore]
fn pangrams_must_have_all_letters_two() {
let sentence = "the quick brown fish jumps over the lazy dog";
assert!(!is_pangram(&sentence));
assert!(!is_pangram(sentence));
}

#[test]
#[ignore]
fn pangrams_must_include_z() {
let sentence = "the quick brown fox jumps over the lay dog";
assert!(!is_pangram(&sentence));
assert!(!is_pangram(sentence));
}

#[test]
#[ignore]
fn underscores_do_not_affect_pangrams() {
let sentence = "the_quick_brown_fox_jumps_over_the_lazy_dog";
assert!(is_pangram(&sentence));
assert!(is_pangram(sentence));
}

#[test]
#[ignore]
fn numbers_do_not_affect_pangrams() {
let sentence = "the 1 quick brown fox jumps over the 2 lazy dogs";
assert!(is_pangram(&sentence));
assert!(is_pangram(sentence));
}

#[test]
#[ignore]
fn numbers_can_not_replace_letters() {
let sentence = "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog";
assert!(!is_pangram(&sentence));
assert!(!is_pangram(sentence));
}

#[test]
#[ignore]
fn capitals_and_punctuation_can_be_in_pangrams() {
let sentence = "\"Five quacking Zephyrs jolt my wax bed.\"";
assert!(is_pangram(&sentence));
assert!(is_pangram(sentence));
}

#[test]
#[ignore]
fn non_ascii_characters_can_be_in_pangrams() {
let sentence = "Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich.";
assert!(is_pangram(&sentence));
assert!(is_pangram(sentence));
}
2 changes: 1 addition & 1 deletion exercises/practice/sublist/tests/sublist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use sublist::{sublist, Comparison};
fn empty_equals_empty() {
let v: &[u32] = &[];

assert_eq!(Comparison::Equal, sublist(&v, &v));
assert_eq!(Comparison::Equal, sublist(v, v));
}

#[test]
Expand Down
8 changes: 4 additions & 4 deletions exercises/practice/tournament/tests/tournament.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fn just_the_header_if_no_input() {
let input = "";
let expected = "Team | MP | W | D | L | P";

assert_eq!(tournament::tally(&input), expected);
assert_eq!(tournament::tally(input), expected);
}

#[test]
Expand All @@ -15,7 +15,7 @@ fn a_win_is_three_points_a_loss_is_zero_points() {
+ "Allegoric Alaskans | 1 | 1 | 0 | 0 | 3\n"
+ "Blithering Badgers | 1 | 0 | 0 | 1 | 0";

assert_eq!(tournament::tally(&input), expected);
assert_eq!(tournament::tally(input), expected);
}

#[test]
Expand All @@ -27,7 +27,7 @@ fn a_win_can_also_be_expressed_as_a_loss() {
+ "Allegoric Alaskans | 1 | 1 | 0 | 0 | 3\n"
+ "Blithering Badgers | 1 | 0 | 0 | 1 | 0";

assert_eq!(tournament::tally(&input), expected);
assert_eq!(tournament::tally(input), expected);
}

#[test]
Expand All @@ -39,7 +39,7 @@ fn a_different_team_can_win() {
+ "Blithering Badgers | 1 | 1 | 0 | 0 | 3\n"
+ "Allegoric Alaskans | 1 | 0 | 0 | 1 | 0";

assert_eq!(tournament::tally(&input), expected);
assert_eq!(tournament::tally(input), expected);
}

#[test]
Expand Down