Skip to content

Commit 358fb47

Browse files
author
fmoko
authored
Merge pull request #276 from stigjb-forks/testing-test4
Enable test for exercise test4
2 parents ec51cdb + a45486f commit 358fb47

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

exercises/test4.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,17 @@
77

88
// I AM NOT DONE
99

10-
fn main() {
11-
if my_macro!("world!") != "Hello world!" {
12-
panic!("Oh no! Wrong output!");
10+
#[cfg(test)]
11+
mod tests {
12+
use super::*;
13+
14+
#[test]
15+
fn test_my_macro_world() {
16+
assert_eq!(my_macro!("world!"), "Hello world!");
17+
}
18+
19+
#[test]
20+
fn test_my_macro_goodbye() {
21+
assert_eq!(my_macro!("goodbye!"), "Hello goodbye!");
1322
}
1423
}

info.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ The way macros are written, it wants to see something between each
369369
[[exercises]]
370370
name = "test4"
371371
path = "exercises/test4.rs"
372-
mode = "compile"
372+
mode = "test"
373373
hint = "No hints this time ;)"
374374

375375
# MOVE SEMANTICS

0 commit comments

Comments
 (0)