Skip to content

Commit

Permalink
allergies: remove unconventional whitespace (#1997)
Browse files Browse the repository at this point in the history
Clippy started warning against this.

[no important files changed]
  • Loading branch information
senekor authored Dec 4, 2024
1 parent a7b2a75 commit a95f205
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 41 deletions.
2 changes: 1 addition & 1 deletion exercises/practice/allergies/.meta/test_template.tera
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use allergies::*;
#[test]
#[ignore]
{%- if test.property == "allergicTo" %}
{# canonical data contains multiple cases named "allergic to everything" for different items #}
{#- canonical data contains multiple cases named "allergic to everything" for different items #}
fn {{ test.description | make_ident }}_{{ test.input.item }}() {
let allergies = Allergies::new({{ test.input.score }});
{%- if test.expected %}
Expand Down
40 changes: 0 additions & 40 deletions exercises/practice/allergies/tests/allergies.rs
Original file line number Diff line number Diff line change
@@ -1,319 +1,279 @@
use allergies::*;

#[test]

fn not_allergic_to_anything_eggs() {
let allergies = Allergies::new(0);
assert!(!allergies.is_allergic_to(&Allergen::Eggs))
}

#[test]
#[ignore]

fn allergic_only_to_eggs_eggs() {
let allergies = Allergies::new(1);
assert!(allergies.is_allergic_to(&Allergen::Eggs))
}

#[test]
#[ignore]

fn allergic_to_eggs_and_something_else_eggs() {
let allergies = Allergies::new(3);
assert!(allergies.is_allergic_to(&Allergen::Eggs))
}

#[test]
#[ignore]

fn allergic_to_something_but_not_eggs_eggs() {
let allergies = Allergies::new(2);
assert!(!allergies.is_allergic_to(&Allergen::Eggs))
}

#[test]
#[ignore]

fn allergic_to_everything_eggs() {
let allergies = Allergies::new(255);
assert!(allergies.is_allergic_to(&Allergen::Eggs))
}

#[test]
#[ignore]

fn not_allergic_to_anything_peanuts() {
let allergies = Allergies::new(0);
assert!(!allergies.is_allergic_to(&Allergen::Peanuts))
}

#[test]
#[ignore]

fn allergic_only_to_peanuts_peanuts() {
let allergies = Allergies::new(2);
assert!(allergies.is_allergic_to(&Allergen::Peanuts))
}

#[test]
#[ignore]

fn allergic_to_peanuts_and_something_else_peanuts() {
let allergies = Allergies::new(7);
assert!(allergies.is_allergic_to(&Allergen::Peanuts))
}

#[test]
#[ignore]

fn allergic_to_something_but_not_peanuts_peanuts() {
let allergies = Allergies::new(5);
assert!(!allergies.is_allergic_to(&Allergen::Peanuts))
}

#[test]
#[ignore]

fn allergic_to_everything_peanuts() {
let allergies = Allergies::new(255);
assert!(allergies.is_allergic_to(&Allergen::Peanuts))
}

#[test]
#[ignore]

fn not_allergic_to_anything_shellfish() {
let allergies = Allergies::new(0);
assert!(!allergies.is_allergic_to(&Allergen::Shellfish))
}

#[test]
#[ignore]

fn allergic_only_to_shellfish_shellfish() {
let allergies = Allergies::new(4);
assert!(allergies.is_allergic_to(&Allergen::Shellfish))
}

#[test]
#[ignore]

fn allergic_to_shellfish_and_something_else_shellfish() {
let allergies = Allergies::new(14);
assert!(allergies.is_allergic_to(&Allergen::Shellfish))
}

#[test]
#[ignore]

fn allergic_to_something_but_not_shellfish_shellfish() {
let allergies = Allergies::new(10);
assert!(!allergies.is_allergic_to(&Allergen::Shellfish))
}

#[test]
#[ignore]

fn allergic_to_everything_shellfish() {
let allergies = Allergies::new(255);
assert!(allergies.is_allergic_to(&Allergen::Shellfish))
}

#[test]
#[ignore]

fn not_allergic_to_anything_strawberries() {
let allergies = Allergies::new(0);
assert!(!allergies.is_allergic_to(&Allergen::Strawberries))
}

#[test]
#[ignore]

fn allergic_only_to_strawberries_strawberries() {
let allergies = Allergies::new(8);
assert!(allergies.is_allergic_to(&Allergen::Strawberries))
}

#[test]
#[ignore]

fn allergic_to_strawberries_and_something_else_strawberries() {
let allergies = Allergies::new(28);
assert!(allergies.is_allergic_to(&Allergen::Strawberries))
}

#[test]
#[ignore]

fn allergic_to_something_but_not_strawberries_strawberries() {
let allergies = Allergies::new(20);
assert!(!allergies.is_allergic_to(&Allergen::Strawberries))
}

#[test]
#[ignore]

fn allergic_to_everything_strawberries() {
let allergies = Allergies::new(255);
assert!(allergies.is_allergic_to(&Allergen::Strawberries))
}

#[test]
#[ignore]

fn not_allergic_to_anything_tomatoes() {
let allergies = Allergies::new(0);
assert!(!allergies.is_allergic_to(&Allergen::Tomatoes))
}

#[test]
#[ignore]

fn allergic_only_to_tomatoes_tomatoes() {
let allergies = Allergies::new(16);
assert!(allergies.is_allergic_to(&Allergen::Tomatoes))
}

#[test]
#[ignore]

fn allergic_to_tomatoes_and_something_else_tomatoes() {
let allergies = Allergies::new(56);
assert!(allergies.is_allergic_to(&Allergen::Tomatoes))
}

#[test]
#[ignore]

fn allergic_to_something_but_not_tomatoes_tomatoes() {
let allergies = Allergies::new(40);
assert!(!allergies.is_allergic_to(&Allergen::Tomatoes))
}

#[test]
#[ignore]

fn allergic_to_everything_tomatoes() {
let allergies = Allergies::new(255);
assert!(allergies.is_allergic_to(&Allergen::Tomatoes))
}

#[test]
#[ignore]

fn not_allergic_to_anything_chocolate() {
let allergies = Allergies::new(0);
assert!(!allergies.is_allergic_to(&Allergen::Chocolate))
}

#[test]
#[ignore]

fn allergic_only_to_chocolate_chocolate() {
let allergies = Allergies::new(32);
assert!(allergies.is_allergic_to(&Allergen::Chocolate))
}

#[test]
#[ignore]

fn allergic_to_chocolate_and_something_else_chocolate() {
let allergies = Allergies::new(112);
assert!(allergies.is_allergic_to(&Allergen::Chocolate))
}

#[test]
#[ignore]

fn allergic_to_something_but_not_chocolate_chocolate() {
let allergies = Allergies::new(80);
assert!(!allergies.is_allergic_to(&Allergen::Chocolate))
}

#[test]
#[ignore]

fn allergic_to_everything_chocolate() {
let allergies = Allergies::new(255);
assert!(allergies.is_allergic_to(&Allergen::Chocolate))
}

#[test]
#[ignore]

fn not_allergic_to_anything_pollen() {
let allergies = Allergies::new(0);
assert!(!allergies.is_allergic_to(&Allergen::Pollen))
}

#[test]
#[ignore]

fn allergic_only_to_pollen_pollen() {
let allergies = Allergies::new(64);
assert!(allergies.is_allergic_to(&Allergen::Pollen))
}

#[test]
#[ignore]

fn allergic_to_pollen_and_something_else_pollen() {
let allergies = Allergies::new(224);
assert!(allergies.is_allergic_to(&Allergen::Pollen))
}

#[test]
#[ignore]

fn allergic_to_something_but_not_pollen_pollen() {
let allergies = Allergies::new(160);
assert!(!allergies.is_allergic_to(&Allergen::Pollen))
}

#[test]
#[ignore]

fn allergic_to_everything_pollen() {
let allergies = Allergies::new(255);
assert!(allergies.is_allergic_to(&Allergen::Pollen))
}

#[test]
#[ignore]

fn not_allergic_to_anything_cats() {
let allergies = Allergies::new(0);
assert!(!allergies.is_allergic_to(&Allergen::Cats))
}

#[test]
#[ignore]

fn allergic_only_to_cats_cats() {
let allergies = Allergies::new(128);
assert!(allergies.is_allergic_to(&Allergen::Cats))
}

#[test]
#[ignore]

fn allergic_to_cats_and_something_else_cats() {
let allergies = Allergies::new(192);
assert!(allergies.is_allergic_to(&Allergen::Cats))
}

#[test]
#[ignore]

fn allergic_to_something_but_not_cats_cats() {
let allergies = Allergies::new(64);
assert!(!allergies.is_allergic_to(&Allergen::Cats))
}

#[test]
#[ignore]

fn allergic_to_everything_cats() {
let allergies = Allergies::new(255);
assert!(allergies.is_allergic_to(&Allergen::Cats))
Expand Down

0 comments on commit a95f205

Please sign in to comment.