summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfmoko <mokou@posteo.de>2020-02-25 14:25:22 +0100
committerGitHub <noreply@github.com>2020-02-25 14:25:22 +0100
commit358fb473cd3ebf06085b58f8c7ff1f649ec6ec7a (patch)
tree186ca05f4266e6bde264a5a88d0b419273099212
parentec51cdb22966b6c68cb806b181d1d3bf2ba73159 (diff)
parenta45486f2d05ce1081fab5709f629ae765368509b (diff)
Merge pull request #276 from stigjb-forks/testing-test4
Enable test for exercise test4
-rw-r--r--exercises/test4.rs15
-rw-r--r--info.toml2
2 files changed, 13 insertions, 4 deletions
diff --git a/exercises/test4.rs b/exercises/test4.rs
index c543a64..ad1f6ac 100644
--- a/exercises/test4.rs
+++ b/exercises/test4.rs
@@ -7,8 +7,17 @@
// I AM NOT DONE
-fn main() {
- if my_macro!("world!") != "Hello world!" {
- panic!("Oh no! Wrong output!");
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn test_my_macro_world() {
+ assert_eq!(my_macro!("world!"), "Hello world!");
+ }
+
+ #[test]
+ fn test_my_macro_goodbye() {
+ assert_eq!(my_macro!("goodbye!"), "Hello goodbye!");
}
}
diff --git a/info.toml b/info.toml
index 2e6b0b4..4b89029 100644
--- a/info.toml
+++ b/info.toml
@@ -369,7 +369,7 @@ The way macros are written, it wants to see something between each
[[exercises]]
name = "test4"
path = "exercises/test4.rs"
-mode = "compile"
+mode = "test"
hint = "No hints this time ;)"
# MOVE SEMANTICS