Skip to content

Commit 25b0b66

Browse files
authored
atbash-cipher: Use Tera template for tests (#2012)
[no important files changed]
1 parent 72ed949 commit 25b0b66

File tree

3 files changed

+67
-4
lines changed

3 files changed

+67
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use atbash_cipher as cipher;
2+
3+
{% for group in cases %}
4+
{% for test in group.cases %}
5+
#[test]
6+
#[ignore]
7+
fn {{ test.description | make_ident }}() {
8+
assert_eq!(
9+
cipher::{{ test.property }}("{{ test.input.phrase }}"),
10+
"{{ test.expected }}"
11+
);
12+
}
13+
{% endfor -%}
14+
{% endfor -%}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,52 @@
1-
# This is an auto-generated file. Regular comments will be removed when this
2-
# file is regenerated. Regenerating will not touch any manually added keys,
3-
# so comments can be added in a "comment" key.
1+
# This is an auto-generated file.
2+
#
3+
# Regenerating this file via `configlet sync` will:
4+
# - Recreate every `description` key/value pair
5+
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
6+
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
7+
# - Preserve any other key/value pair
8+
#
9+
# As user-added comments (using the # character) will be removed when this file
10+
# is regenerated, comments can be added via a `comment` key.
11+
12+
[2f47ebe1-eab9-4d6b-b3c6-627562a31c77]
13+
description = "encode -> encode yes"
14+
15+
[b4ffe781-ea81-4b74-b268-cc58ba21c739]
16+
description = "encode -> encode no"
17+
18+
[10e48927-24ab-4c4d-9d3f-3067724ace00]
19+
description = "encode -> encode OMG"
20+
21+
[d59b8bc3-509a-4a9a-834c-6f501b98750b]
22+
description = "encode -> encode spaces"
23+
24+
[31d44b11-81b7-4a94-8b43-4af6a2449429]
25+
description = "encode -> encode mindblowingly"
26+
27+
[d503361a-1433-48c0-aae0-d41b5baa33ff]
28+
description = "encode -> encode numbers"
29+
30+
[79c8a2d5-0772-42d4-b41b-531d0b5da926]
31+
description = "encode -> encode deep thought"
32+
33+
[9ca13d23-d32a-4967-a1fd-6100b8742bab]
34+
description = "encode -> encode all the letters"
35+
36+
[bb50e087-7fdf-48e7-9223-284fe7e69851]
37+
description = "decode -> decode exercism"
38+
39+
[ac021097-cd5d-4717-8907-b0814b9e292c]
40+
description = "decode -> decode a sentence"
41+
42+
[18729de3-de74-49b8-b68c-025eaf77f851]
43+
description = "decode -> decode numbers"
44+
45+
[0f30325f-f53b-415d-ad3e-a7a4f63de034]
46+
description = "decode -> decode all the letters"
47+
48+
[39640287-30c6-4c8c-9bac-9d613d1a5674]
49+
description = "decode -> decode with too many spaces"
50+
51+
[b34edf13-34c0-49b5-aa21-0768928000d5]
52+
description = "decode -> decode with no spaces"

exercises/practice/atbash-cipher/tests/atbash-cipher.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,6 @@ fn decode_with_too_many_spaces() {
9494
fn decode_with_no_spaces() {
9595
assert_eq!(
9696
cipher::decode("zmlyhgzxovrhlugvmzhgvkkrmthglmv"),
97-
"anobstacleisoftenasteppingstone",
97+
"anobstacleisoftenasteppingstone"
9898
);
9999
}

0 commit comments

Comments
 (0)