Skip to content

Commit

Permalink
sync: hello-world
Browse files Browse the repository at this point in the history
  • Loading branch information
senekor committed Apr 24, 2024
1 parent 9546f79 commit f4e3aed
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
9 changes: 9 additions & 0 deletions exercises/practice/hello-world/.meta/test_template.tera
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use hello_world::*;

{% for test in cases %}
#[test]
#[ignore]
fn {{ test.description | snake_case }}() {
assert_eq!(hello(), {{ test.expected | json_encode() }});
}
{% endfor -%}
16 changes: 13 additions & 3 deletions exercises/practice/hello-world/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# This is an auto-generated file. Regular comments will be removed when this
# file is regenerated. Regenerating will not touch any manually added keys,
# so comments can be added in a "comment" key.
# This is an auto-generated file.
#
# Regenerating this file via `configlet sync` will:
# - Recreate every `description` key/value pair
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
# - Preserve any other key/value pair
#
# As user-added comments (using the # character) will be removed when this file
# is regenerated, comments can be added via a `comment` key.

[af9ffe10-dc13-42d8-a742-e7bdafac449d]
description = "Say Hi!"
6 changes: 4 additions & 2 deletions exercises/practice/hello-world/tests/hello-world.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use hello_world::*;

#[test]
fn hello_world() {
assert_eq!("Hello, World!", hello_world::hello());
fn say_hi() {
assert_eq!(hello(), "Hello, World!");
}

0 comments on commit f4e3aed

Please sign in to comment.