Skip to content

Commit

Permalink
generator: strip first ignore-annotation in Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
senekor committed Mar 30, 2024
1 parent 44c7a51 commit 19e5f44
Show file tree
Hide file tree
Showing 46 changed files with 7 additions and 99 deletions.
2 changes: 0 additions & 2 deletions exercises/practice/acronym/.meta/test_template.tera
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/affine-cipher/.meta/test_template.tera
Original file line number Diff line number Diff line change
@@ -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 }});
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/allergies/.meta/test_template.tera
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}() {
Expand Down
10 changes: 0 additions & 10 deletions exercises/practice/allergies/tests/allergies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ fn allergic_to_everything_cats() {

#[test]
#[ignore]

fn no_allergies() {
let allergies = Allergies::new(0).allergies();
let expected = &[];
Expand All @@ -345,7 +344,6 @@ fn no_allergies() {

#[test]
#[ignore]

fn just_eggs() {
let allergies = Allergies::new(1).allergies();
let expected = &[Allergen::Eggs];
Expand All @@ -355,7 +353,6 @@ fn just_eggs() {

#[test]
#[ignore]

fn just_peanuts() {
let allergies = Allergies::new(2).allergies();
let expected = &[Allergen::Peanuts];
Expand All @@ -365,7 +362,6 @@ fn just_peanuts() {

#[test]
#[ignore]

fn just_strawberries() {
let allergies = Allergies::new(8).allergies();
let expected = &[Allergen::Strawberries];
Expand All @@ -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];
Expand All @@ -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];
Expand All @@ -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 = &[
Expand All @@ -411,7 +404,6 @@ fn lots_of_stuff() {

#[test]
#[ignore]

fn everything() {
let allergies = Allergies::new(255).allergies();
let expected = &[
Expand All @@ -430,7 +422,6 @@ fn everything() {

#[test]
#[ignore]

fn no_allergen_score_parts() {
let allergies = Allergies::new(509).allergies();
let expected = &[
Expand All @@ -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];
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/anagram/.meta/test_template.tera
Original file line number Diff line number Diff line change
Expand Up @@ -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() }};
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/book-store/.meta/test_template.tera
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/custom-set/.meta/test_template.tera
Original file line number Diff line number Diff line change
@@ -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::<i32>::new(&{{ test.input.set | json_encode() }});
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/eliuds-eggs/.meta/test_template.tera
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/knapsack/.meta/test_template.tera
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/leap/.meta/test_template.tera
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}));
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/matrix/.meta/test_template.tera
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%}
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/pascals-triangle/.meta/test_template.tera
Original file line number Diff line number Diff line change
@@ -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<u32>> = vec![{% for row in test.expected -%}
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/perfect-numbers/.meta/test_template.tera
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/phone-number/.meta/test_template.tera
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/pig-latin/.meta/test_template.tera
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/poker/.meta/test_template.tera
Original file line number Diff line number Diff line change
Expand Up @@ -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::<HashSet<_>>();
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/prime-factors/.meta/test_template.tera
Original file line number Diff line number Diff line change
Expand Up @@ -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() }};
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/proverb/.meta/test_template.tera
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/queen-attack/.meta/test_template.tera
Original file line number Diff line number Diff line change
Expand Up @@ -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 }});
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/rail-fence-cipher/.meta/test_template.tera
Original file line number Diff line number Diff line change
@@ -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() }};
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/raindrops/.meta/test_template.tera
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/rectangles/.meta/test_template.tera
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/reverse-string/.meta/test_template.tera
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% for test in cases %}
#[test]
{% if loop.index != 1 -%}
#[ignore]
{% endif -%}
{% if test.description == "grapheme clusters" -%}
#[cfg(feature = "grapheme")]
{% endif -%}
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/rna-transcription/.meta/test_template.tera
Original file line number Diff line number Diff line change
@@ -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" -%}
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/robot-simulator/.meta/test_template.tera
Original file line number Diff line number Diff line change
Expand Up @@ -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 }});
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/roman-numerals/.meta/test_template.tera
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/rotational-cipher/.meta/test_template.tera
Original file line number Diff line number Diff line change
@@ -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() }};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" -%}
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/saddle-points/.meta/test_template.tera
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ fn find_sorted_saddle_points(input: &[Vec<u64>]) -> 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 }},
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/say/.meta/test_template.tera
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/scrabble-score/.meta/test_template.tera
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 0 additions & 2 deletions exercises/practice/series/.meta/test_template.tera
Original file line number Diff line number Diff line change
Expand Up @@ -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() }};
Expand Down
Loading

0 comments on commit 19e5f44

Please sign in to comment.