summaryrefslogtreecommitdiff
path: root/exercises
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 /exercises
parentec51cdb22966b6c68cb806b181d1d3bf2ba73159 (diff)
parenta45486f2d05ce1081fab5709f629ae765368509b (diff)
Merge pull request #276 from stigjb-forks/testing-test4
Enable test for exercise test4
Diffstat (limited to 'exercises')
-rw-r--r--exercises/test4.rs15
1 files changed, 12 insertions, 3 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!");
}
}