diff --git a/exercises/practice/acronym/.meta/test_template.tera b/exercises/practice/acronym/.meta/test_template.tera index c8de609e1..2c1911922 100644 --- a/exercises/practice/acronym/.meta/test_template.tera +++ b/exercises/practice/acronym/.meta/test_template.tera @@ -1,8 +1,6 @@ {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input = {{ test.input.phrase | json_encode() }}; let output = {{ crate_name }}::{{ fn_names[0] }}(input); diff --git a/exercises/practice/affine-cipher/.meta/test_template.tera b/exercises/practice/affine-cipher/.meta/test_template.tera index 0c15e457a..8f04e1f7a 100644 --- a/exercises/practice/affine-cipher/.meta/test_template.tera +++ b/exercises/practice/affine-cipher/.meta/test_template.tera @@ -1,9 +1,7 @@ use affine_cipher::AffineCipherError::NotCoprime; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let phrase = {{ test.input.phrase | json_encode() }}; let (a, b) = ({{ test.input.key.a }}, {{ test.input.key.b }}); diff --git a/exercises/practice/allergies/.meta/test_template.tera b/exercises/practice/allergies/.meta/test_template.tera index 986be5782..ee99d5f2d 100644 --- a/exercises/practice/allergies/.meta/test_template.tera +++ b/exercises/practice/allergies/.meta/test_template.tera @@ -16,9 +16,7 @@ fn compare_allergy_vectors(expected: &[Allergen], actual: &[Allergen]) { {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} {%- if test.property == "allergicTo" %} {# canonical data contains multiple cases named "allergic to everything" for different items #} fn {{ test.description | slugify | replace(from="-", to="_") }}_{{ test.input.item }}() { diff --git a/exercises/practice/allergies/tests/allergies.rs b/exercises/practice/allergies/tests/allergies.rs index ffcae1739..ab8185e7c 100644 --- a/exercises/practice/allergies/tests/allergies.rs +++ b/exercises/practice/allergies/tests/allergies.rs @@ -335,7 +335,6 @@ fn allergic_to_everything_cats() { #[test] #[ignore] - fn no_allergies() { let allergies = Allergies::new(0).allergies(); let expected = &[]; @@ -345,7 +344,6 @@ fn no_allergies() { #[test] #[ignore] - fn just_eggs() { let allergies = Allergies::new(1).allergies(); let expected = &[Allergen::Eggs]; @@ -355,7 +353,6 @@ fn just_eggs() { #[test] #[ignore] - fn just_peanuts() { let allergies = Allergies::new(2).allergies(); let expected = &[Allergen::Peanuts]; @@ -365,7 +362,6 @@ fn just_peanuts() { #[test] #[ignore] - fn just_strawberries() { let allergies = Allergies::new(8).allergies(); let expected = &[Allergen::Strawberries]; @@ -375,7 +371,6 @@ fn just_strawberries() { #[test] #[ignore] - fn eggs_and_peanuts() { let allergies = Allergies::new(3).allergies(); let expected = &[Allergen::Eggs, Allergen::Peanuts]; @@ -385,7 +380,6 @@ fn eggs_and_peanuts() { #[test] #[ignore] - fn more_than_eggs_but_not_peanuts() { let allergies = Allergies::new(5).allergies(); let expected = &[Allergen::Eggs, Allergen::Shellfish]; @@ -395,7 +389,6 @@ fn more_than_eggs_but_not_peanuts() { #[test] #[ignore] - fn lots_of_stuff() { let allergies = Allergies::new(248).allergies(); let expected = &[ @@ -411,7 +404,6 @@ fn lots_of_stuff() { #[test] #[ignore] - fn everything() { let allergies = Allergies::new(255).allergies(); let expected = &[ @@ -430,7 +422,6 @@ fn everything() { #[test] #[ignore] - fn no_allergen_score_parts() { let allergies = Allergies::new(509).allergies(); let expected = &[ @@ -448,7 +439,6 @@ fn no_allergen_score_parts() { #[test] #[ignore] - fn no_allergen_score_parts_without_highest_valid_score() { let allergies = Allergies::new(257).allergies(); let expected = &[Allergen::Eggs]; diff --git a/exercises/practice/anagram/.meta/test_template.tera b/exercises/practice/anagram/.meta/test_template.tera index c6f1533f7..cb6f7347a 100644 --- a/exercises/practice/anagram/.meta/test_template.tera +++ b/exercises/practice/anagram/.meta/test_template.tera @@ -3,9 +3,7 @@ use std::collections::HashSet; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let word = {{ test.input.subject | json_encode() }}; let inputs = &{{ test.input.candidates | json_encode() }}; diff --git a/exercises/practice/book-store/.meta/test_template.tera b/exercises/practice/book-store/.meta/test_template.tera index d06d0a57f..4c4ae9e77 100644 --- a/exercises/practice/book-store/.meta/test_template.tera +++ b/exercises/practice/book-store/.meta/test_template.tera @@ -1,8 +1,6 @@ {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input = &{{ test.input.basket | json_encode() }}; let output = {{ crate_name }}::{{ fn_names[0] }}(input); diff --git a/exercises/practice/custom-set/.meta/test_template.tera b/exercises/practice/custom-set/.meta/test_template.tera index c6fc07bb5..a9d59ae14 100644 --- a/exercises/practice/custom-set/.meta/test_template.tera +++ b/exercises/practice/custom-set/.meta/test_template.tera @@ -1,9 +1,7 @@ use custom_set::CustomSet; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { {%- if test.property == "empty" %} let set = CustomSet::::new(&{{ test.input.set | json_encode() }}); diff --git a/exercises/practice/eliuds-eggs/.meta/test_template.tera b/exercises/practice/eliuds-eggs/.meta/test_template.tera index b77b6c34d..58e5932ed 100644 --- a/exercises/practice/eliuds-eggs/.meta/test_template.tera +++ b/exercises/practice/eliuds-eggs/.meta/test_template.tera @@ -2,9 +2,7 @@ use {{ crate_name }}::*; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn test_{{ test.description | slugify | replace(from="-", to="_") }}() { let input = {{ test.input.number }}; let output = {{ fn_names[0] }}(input); diff --git a/exercises/practice/knapsack/.meta/test_template.tera b/exercises/practice/knapsack/.meta/test_template.tera index b7b4d4983..78b8597fd 100644 --- a/exercises/practice/knapsack/.meta/test_template.tera +++ b/exercises/practice/knapsack/.meta/test_template.tera @@ -2,9 +2,7 @@ use {{ crate_name }}::*; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn test_{{ test.description | slugify | replace(from="-", to="_") }}() { let max_weight = {{ test.input.maximumWeight }}; let items = [ diff --git a/exercises/practice/leap/.meta/test_template.tera b/exercises/practice/leap/.meta/test_template.tera index 8cf7191cd..e2a29c41c 100644 --- a/exercises/practice/leap/.meta/test_template.tera +++ b/exercises/practice/leap/.meta/test_template.tera @@ -2,9 +2,7 @@ use {{ crate_name }}::*; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { {%- if test.expected %} assert!(is_leap_year({{ test.input.year }})); diff --git a/exercises/practice/matrix/.meta/test_template.tera b/exercises/practice/matrix/.meta/test_template.tera index de548e86c..7e7d76dca 100644 --- a/exercises/practice/matrix/.meta/test_template.tera +++ b/exercises/practice/matrix/.meta/test_template.tera @@ -2,9 +2,7 @@ use {{ crate_name }}::*; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let matrix = Matrix::new({{ test.input.string | json_encode() }}); {% if test.expected -%} diff --git a/exercises/practice/pascals-triangle/.meta/test_template.tera b/exercises/practice/pascals-triangle/.meta/test_template.tera index 6ef434fa6..139cb5c68 100644 --- a/exercises/practice/pascals-triangle/.meta/test_template.tera +++ b/exercises/practice/pascals-triangle/.meta/test_template.tera @@ -1,9 +1,7 @@ use pascals_triangle::PascalsTriangle; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let pt = PascalsTriangle::new({{ test.input.count }}); let expected: Vec> = vec![{% for row in test.expected -%} diff --git a/exercises/practice/perfect-numbers/.meta/test_template.tera b/exercises/practice/perfect-numbers/.meta/test_template.tera index 0f27541a4..96a575724 100644 --- a/exercises/practice/perfect-numbers/.meta/test_template.tera +++ b/exercises/practice/perfect-numbers/.meta/test_template.tera @@ -2,9 +2,7 @@ use {{ crate_name }}::*; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input = {{ test.input.number | json_encode() }}; let output = {{ fn_names[0] }}(input); diff --git a/exercises/practice/phone-number/.meta/test_template.tera b/exercises/practice/phone-number/.meta/test_template.tera index 98e6f74b1..26a84b679 100644 --- a/exercises/practice/phone-number/.meta/test_template.tera +++ b/exercises/practice/phone-number/.meta/test_template.tera @@ -2,9 +2,7 @@ use {{ crate_name }}::*; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input = {{ test.input.phrase | json_encode() }}; let output = {{ fn_names[0] }}(input); diff --git a/exercises/practice/pig-latin/.meta/test_template.tera b/exercises/practice/pig-latin/.meta/test_template.tera index f809b6247..e0a1aba6d 100644 --- a/exercises/practice/pig-latin/.meta/test_template.tera +++ b/exercises/practice/pig-latin/.meta/test_template.tera @@ -2,9 +2,7 @@ use {{ crate_name }}::*; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input = {{ test.input.phrase | json_encode() }}; let output = {{ fn_names[0] }}(input); diff --git a/exercises/practice/poker/.meta/test_template.tera b/exercises/practice/poker/.meta/test_template.tera index 91551496f..74415c2ab 100644 --- a/exercises/practice/poker/.meta/test_template.tera +++ b/exercises/practice/poker/.meta/test_template.tera @@ -3,9 +3,7 @@ use std::collections::HashSet; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input = &{{ test.input.hands | json_encode() }}; let output = {{ fn_names[0] }}(input).into_iter().collect::>(); diff --git a/exercises/practice/prime-factors/.meta/test_template.tera b/exercises/practice/prime-factors/.meta/test_template.tera index 8ca8d0eac..2fdf30196 100644 --- a/exercises/practice/prime-factors/.meta/test_template.tera +++ b/exercises/practice/prime-factors/.meta/test_template.tera @@ -2,9 +2,7 @@ use {{ crate_name }}::*; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let factors = {{ fn_names[0] }}({{ test.input.value }}); let expected = {{ test.expected | json_encode() }}; diff --git a/exercises/practice/proverb/.meta/test_template.tera b/exercises/practice/proverb/.meta/test_template.tera index 0560a6f7d..4212b3c70 100644 --- a/exercises/practice/proverb/.meta/test_template.tera +++ b/exercises/practice/proverb/.meta/test_template.tera @@ -1,8 +1,6 @@ {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input = &{{ test.input.strings | json_encode() }}; let output = {{ crate_name }}::{{ fn_names[0] }}(input); diff --git a/exercises/practice/pythagorean-triplet/.meta/test_template.tera b/exercises/practice/pythagorean-triplet/.meta/test_template.tera index 642b1a760..aea88ab26 100644 --- a/exercises/practice/pythagorean-triplet/.meta/test_template.tera +++ b/exercises/practice/pythagorean-triplet/.meta/test_template.tera @@ -1,9 +1,7 @@ use std::collections::HashSet; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input = {{ test.input.n | json_encode() }}; let output = {{ crate_name }}::{{ fn_names[0] }}(input); diff --git a/exercises/practice/queen-attack/.meta/test_template.tera b/exercises/practice/queen-attack/.meta/test_template.tera index da0a35ab9..6886087b6 100644 --- a/exercises/practice/queen-attack/.meta/test_template.tera +++ b/exercises/practice/queen-attack/.meta/test_template.tera @@ -2,9 +2,7 @@ use queen_attack::*; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { {% if test.property == "create" %} let chess_position = ChessPosition::new({{ test.input.queen.position.row }}, {{ test.input.queen.position.column }}); diff --git a/exercises/practice/rail-fence-cipher/.meta/test_template.tera b/exercises/practice/rail-fence-cipher/.meta/test_template.tera index ce5af15b9..adbea054b 100644 --- a/exercises/practice/rail-fence-cipher/.meta/test_template.tera +++ b/exercises/practice/rail-fence-cipher/.meta/test_template.tera @@ -1,9 +1,7 @@ use rail_fence_cipher::RailFence; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input = {{ test.input.msg | json_encode() }}; let rails = {{ test.input.rails | json_encode() }}; diff --git a/exercises/practice/raindrops/.meta/test_template.tera b/exercises/practice/raindrops/.meta/test_template.tera index d7e68acbd..53aaae9b1 100644 --- a/exercises/practice/raindrops/.meta/test_template.tera +++ b/exercises/practice/raindrops/.meta/test_template.tera @@ -1,8 +1,6 @@ {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn test_{{ test.description | slugify | replace(from="-", to="_") }}() { let input = {{ test.input.number | json_encode() }}; let output = {{ crate_name }}::{{ fn_names[0] }}(input); diff --git a/exercises/practice/rectangles/.meta/test_template.tera b/exercises/practice/rectangles/.meta/test_template.tera index 0813a456a..5c7c99c3b 100644 --- a/exercises/practice/rectangles/.meta/test_template.tera +++ b/exercises/practice/rectangles/.meta/test_template.tera @@ -1,8 +1,6 @@ {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn test_{{ test.description | slugify | replace(from="-", to="_") }}() { {% if test.input.strings | length > 1 -%} #[rustfmt::skip] diff --git a/exercises/practice/reverse-string/.meta/test_template.tera b/exercises/practice/reverse-string/.meta/test_template.tera index cf8485eb7..3ad0cbafe 100644 --- a/exercises/practice/reverse-string/.meta/test_template.tera +++ b/exercises/practice/reverse-string/.meta/test_template.tera @@ -1,8 +1,6 @@ {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} {% if test.description is starting_with("grapheme cluster") -%} #[cfg(feature = "grapheme")] {% endif -%} diff --git a/exercises/practice/rna-transcription/.meta/test_template.tera b/exercises/practice/rna-transcription/.meta/test_template.tera index f85eac220..30693ca00 100644 --- a/exercises/practice/rna-transcription/.meta/test_template.tera +++ b/exercises/practice/rna-transcription/.meta/test_template.tera @@ -1,9 +1,7 @@ use rna_transcription::{Dna, Rna}; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input = {{ test.input.dna | json_encode() }}; {% if test.property == "invalidDna" -%} diff --git a/exercises/practice/robot-simulator/.meta/test_template.tera b/exercises/practice/robot-simulator/.meta/test_template.tera index fb0647357..e441b3958 100644 --- a/exercises/practice/robot-simulator/.meta/test_template.tera +++ b/exercises/practice/robot-simulator/.meta/test_template.tera @@ -2,9 +2,7 @@ use {{ crate_name }}::*; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { {%- if test.property == "create" %} let robot = Robot::new({{ test.input.position.x }}, {{ test.input.position.y }}, Direction::{{ test.input.direction | title }}); diff --git a/exercises/practice/roman-numerals/.meta/test_template.tera b/exercises/practice/roman-numerals/.meta/test_template.tera index 9b1114af4..97e0c4d01 100644 --- a/exercises/practice/roman-numerals/.meta/test_template.tera +++ b/exercises/practice/roman-numerals/.meta/test_template.tera @@ -2,9 +2,7 @@ use roman_numerals::Roman; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn number_{{ test.description | slugify | replace(from="-", to="_") }}() { let input = {{ test.input.number | json_encode() }}; let output = Roman::from(input).to_string(); diff --git a/exercises/practice/rotational-cipher/.meta/test_template.tera b/exercises/practice/rotational-cipher/.meta/test_template.tera index 561e69115..1f10fb77f 100644 --- a/exercises/practice/rotational-cipher/.meta/test_template.tera +++ b/exercises/practice/rotational-cipher/.meta/test_template.tera @@ -1,9 +1,7 @@ use rotational_cipher as cipher; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let text = {{ test.input.text | json_encode() }}; let shift_key = {{ test.input.shiftKey | json_encode() }}; diff --git a/exercises/practice/run-length-encoding/.meta/test_template.tera b/exercises/practice/run-length-encoding/.meta/test_template.tera index 15e8ffe88..d82ce7a24 100644 --- a/exercises/practice/run-length-encoding/.meta/test_template.tera +++ b/exercises/practice/run-length-encoding/.meta/test_template.tera @@ -2,9 +2,7 @@ use run_length_encoding as rle; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.property }}_{{ test.description | slugify | replace(from="-", to="_") }}() { let input = {{ test.input.string | json_encode() }}; {% if test.property == "consistency" -%} diff --git a/exercises/practice/saddle-points/.meta/test_template.tera b/exercises/practice/saddle-points/.meta/test_template.tera index 20dc39e80..722a4d346 100644 --- a/exercises/practice/saddle-points/.meta/test_template.tera +++ b/exercises/practice/saddle-points/.meta/test_template.tera @@ -6,9 +6,7 @@ fn find_sorted_saddle_points(input: &[Vec]) -> Vec<(usize, usize)> { } {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input = &[{% for row in test.input.matrix %} vec!{{ row }}, diff --git a/exercises/practice/say/.meta/test_template.tera b/exercises/practice/say/.meta/test_template.tera index 51753e6f7..6118ad8ad 100644 --- a/exercises/practice/say/.meta/test_template.tera +++ b/exercises/practice/say/.meta/test_template.tera @@ -1,8 +1,6 @@ {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input = {{ test.input.number | json_encode() }}; let output = {{ crate_name }}::{{ fn_names[0] }}(input); diff --git a/exercises/practice/scrabble-score/.meta/test_template.tera b/exercises/practice/scrabble-score/.meta/test_template.tera index 093d6dc57..e79e7248e 100644 --- a/exercises/practice/scrabble-score/.meta/test_template.tera +++ b/exercises/practice/scrabble-score/.meta/test_template.tera @@ -1,8 +1,6 @@ {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input = {{ test.input.word | json_encode() }}; let output = {{ crate_name }}::{{ fn_names[0] }}(input); diff --git a/exercises/practice/series/.meta/test_template.tera b/exercises/practice/series/.meta/test_template.tera index 64a9fc5fc..eb3d1a34b 100644 --- a/exercises/practice/series/.meta/test_template.tera +++ b/exercises/practice/series/.meta/test_template.tera @@ -2,9 +2,7 @@ use {{ crate_name }}::*; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input = {{ test.input.series | json_encode() }}; let length = {{ test.input.sliceLength | json_encode() }}; diff --git a/exercises/practice/sieve/.meta/test_template.tera b/exercises/practice/sieve/.meta/test_template.tera index aab8df430..ccee077df 100644 --- a/exercises/practice/sieve/.meta/test_template.tera +++ b/exercises/practice/sieve/.meta/test_template.tera @@ -1,8 +1,6 @@ {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input = {{ test.input.limit | json_encode() }}; let output = {{ crate_name }}::{{ fn_names[0] }}(input); diff --git a/exercises/practice/space-age/.meta/test_template.tera b/exercises/practice/space-age/.meta/test_template.tera index cde9b9498..fe5b89626 100644 --- a/exercises/practice/space-age/.meta/test_template.tera +++ b/exercises/practice/space-age/.meta/test_template.tera @@ -9,9 +9,7 @@ fn assert_in_delta(expected: f64, actual: f64) { } {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let seconds = {{ test.input.seconds | json_encode() }}; let duration = Duration::from(seconds); diff --git a/exercises/practice/spiral-matrix/.meta/test_template.tera b/exercises/practice/spiral-matrix/.meta/test_template.tera index ab4e24399..c4aa606fe 100644 --- a/exercises/practice/spiral-matrix/.meta/test_template.tera +++ b/exercises/practice/spiral-matrix/.meta/test_template.tera @@ -1,8 +1,6 @@ {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input = {{ test.input.size | json_encode() }}; let output = {{ crate_name }}::{{ fn_names[0] }}(input); diff --git a/exercises/practice/sublist/.meta/test_template.tera b/exercises/practice/sublist/.meta/test_template.tera index 2b1f97d93..f5897a584 100644 --- a/exercises/practice/sublist/.meta/test_template.tera +++ b/exercises/practice/sublist/.meta/test_template.tera @@ -1,9 +1,7 @@ use sublist::Comparison; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let list_one: &[i32] = &{{ test.input.listOne | json_encode() }}; let list_two: &[i32] = &{{ test.input.listTwo | json_encode() }}; diff --git a/exercises/practice/sum-of-multiples/.meta/test_template.tera b/exercises/practice/sum-of-multiples/.meta/test_template.tera index 5fd13a19d..df26c4a93 100644 --- a/exercises/practice/sum-of-multiples/.meta/test_template.tera +++ b/exercises/practice/sum-of-multiples/.meta/test_template.tera @@ -1,8 +1,6 @@ {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let factors = &{{ test.input.factors | json_encode() }}; let limit = {{ test.input.limit | json_encode() }}; diff --git a/exercises/practice/tournament/.meta/test_template.tera b/exercises/practice/tournament/.meta/test_template.tera index e469e04d3..e27c5d2a8 100644 --- a/exercises/practice/tournament/.meta/test_template.tera +++ b/exercises/practice/tournament/.meta/test_template.tera @@ -1,8 +1,6 @@ {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input: &[&str] = &{{ test.input.rows | json_encode() }}; let input = input.join("\n"); diff --git a/exercises/practice/triangle/.meta/test_template.tera b/exercises/practice/triangle/.meta/test_template.tera index ed7c03a9f..18263a183 100644 --- a/exercises/practice/triangle/.meta/test_template.tera +++ b/exercises/practice/triangle/.meta/test_template.tera @@ -4,9 +4,7 @@ use triangle::Triangle; {% if test.property != "equilateral" %}{% continue %}{% endif %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} {% if test.description is containing("float") %} #[cfg(feature = "generic")] {% endif -%} diff --git a/exercises/practice/two-bucket/.meta/test_template.tera b/exercises/practice/two-bucket/.meta/test_template.tera index b6de2697b..28ddaff03 100644 --- a/exercises/practice/two-bucket/.meta/test_template.tera +++ b/exercises/practice/two-bucket/.meta/test_template.tera @@ -9,9 +9,7 @@ use two_bucket::{Bucket, BucketStats}; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let output = {{ crate_name }}::{{ fn_names[0] }}( {{ test.input.bucketOne }}, {{ test.input.bucketTwo }}, {{ test.input.goal }}, diff --git a/exercises/practice/variable-length-quantity/.meta/test_template.tera b/exercises/practice/variable-length-quantity/.meta/test_template.tera index 27cd22a1c..7e6441992 100644 --- a/exercises/practice/variable-length-quantity/.meta/test_template.tera +++ b/exercises/practice/variable-length-quantity/.meta/test_template.tera @@ -1,9 +1,7 @@ use variable_length_quantity as vlq; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { {%- if test.property == "encode" %} let input = &{{ test.input.integers | json_encode() }}; diff --git a/exercises/practice/word-count/.meta/test_template.tera b/exercises/practice/word-count/.meta/test_template.tera index faec5732d..f459c4d16 100644 --- a/exercises/practice/word-count/.meta/test_template.tera +++ b/exercises/practice/word-count/.meta/test_template.tera @@ -2,9 +2,7 @@ use word_count::*; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input = {{ test.input.sentence | json_encode() }}; let mut output = word_count(input); diff --git a/exercises/practice/wordy/.meta/test_template.tera b/exercises/practice/wordy/.meta/test_template.tera index 8a362161f..3706fecc0 100644 --- a/exercises/practice/wordy/.meta/test_template.tera +++ b/exercises/practice/wordy/.meta/test_template.tera @@ -1,8 +1,6 @@ {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} {% if test.property == "exponentials" -%} #[cfg(feature = "exponentials")] {% endif -%} diff --git a/rust-tooling/generate/src/lib.rs b/rust-tooling/generate/src/lib.rs index 0090dee66..a726cd1a0 100644 --- a/rust-tooling/generate/src/lib.rs +++ b/rust-tooling/generate/src/lib.rs @@ -121,7 +121,13 @@ fn generate_tests(slug: &str, fn_names: Vec) -> String { context.insert("cases", &single_cases); let rendered = template.render("test_template.tera", &context).unwrap(); - let rendered = rendered.trim_start(); + + // Remove ignore-annotation on first test. + // This could be done in the template itself, + // but doing it here makes all templates more readable. + // Also, it is harder to do this in the template when the template + // generates test functions inside a macro for modules. + let rendered = rendered.replacen("#[ignore]\n", "", 1); let mut child = Command::new("rustfmt") .args(["--color=always"]) @@ -155,7 +161,7 @@ It probably generates invalid Rust code." ); // still return the unformatted content to be written to the file - rendered.into() + rendered } } diff --git a/rust-tooling/generate/templates/default_test_template.tera b/rust-tooling/generate/templates/default_test_template.tera index 94d4c88c8..9c7d6fe83 100644 --- a/rust-tooling/generate/templates/default_test_template.tera +++ b/rust-tooling/generate/templates/default_test_template.tera @@ -2,9 +2,7 @@ use {{ crate_name }}::*; {% for test in cases %} #[test] -{% if loop.index != 1 -%} #[ignore] -{% endif -%} fn {{ test.description | slugify | replace(from="-", to="_") }}() { let input = {{ test.input | json_encode() }}; let output = {{ fn_names[0] }}(input);