Skip to content

Commit 9b5c1e7

Browse files
committed
apply improved test template to acronym
1 parent 5bf7df8 commit 9b5c1e7

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

exercises/practice/acronym/.meta/test_template.tera

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
{% if loop.index != 1 -%}
44
#[ignore]
55
{% endif -%}
6-
fn {{ test.description | replace(from=" ", to="_") }}() {
7-
let input = "{{ test.input.phrase }}";
8-
let output = acronym::abbreviate(input);
9-
let expected = "{{ test.expected }}";
6+
fn {{ test.description | lower | replace(from=" ", to="_") }}() {
7+
let input = {{ test.input.phrase | json_encode() }};
8+
let output = {{ crate_name }}::{{ fn_names[0] }}(input);
9+
let expected = {{ test.expected | json_encode() }};
1010
assert_eq!(output, expected);
1111
}
1212
{% endfor -%}

rust-tooling/src/default_test_template.tera

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#[ignore]
55
{% endif -%}
66
fn {{ test.description | lower | replace(from=" ", to="_") }}() {
7-
let input = {{ test.input }};
7+
let input = {{ test.input | json_encode() }};
88
let output = {{ crate_name }}::{{ fn_names[0] }}(input);
9-
let expected = {{ test.expected }};
9+
let expected = {{ test.expected | json_encode() }};
1010
assert_eq!(output, expected);
1111
}
1212
{% endfor -%}

0 commit comments

Comments
 (0)