diff --git a/exercises/iterators/iterators1.rs b/exercises/iterators/iterators1.rs index b3f698be..31076bb9 100644 --- a/exercises/iterators/iterators1.rs +++ b/exercises/iterators/iterators1.rs @@ -11,6 +11,7 @@ // I AM NOT DONE +#[test] fn main() { let my_fav_fruits = vec!["banana", "custard apple", "avocado", "peach", "raspberry"]; diff --git a/exercises/smart_pointers/rc1.rs b/exercises/smart_pointers/rc1.rs index ad3f1ce2..1b903469 100644 --- a/exercises/smart_pointers/rc1.rs +++ b/exercises/smart_pointers/rc1.rs @@ -35,6 +35,7 @@ impl Planet { } } +#[test] fn main() { let sun = Rc::new(Sun {}); println!("reference count = {}", Rc::strong_count(&sun)); // 1 reference diff --git a/exercises/threads/threads3.rs b/exercises/threads/threads3.rs index db7d41ba..91006bbc 100644 --- a/exercises/threads/threads3.rs +++ b/exercises/threads/threads3.rs @@ -48,6 +48,7 @@ fn send_tx(q: Queue, tx: mpsc::Sender) -> () { }); } +#[test] fn main() { let (tx, rx) = mpsc::channel(); let queue = Queue::new(); diff --git a/info.toml b/info.toml index 9267d467..452e4787 100644 --- a/info.toml +++ b/info.toml @@ -831,7 +831,7 @@ https://doc.rust-lang.org/stable/book/ch11-01-writing-tests.html#checking-for-pa [[exercises]] name = "iterators1" path = "exercises/iterators/iterators1.rs" -mode = "compile" +mode = "test" hint = """ Step 1: We need to apply something to the collection `my_fav_fruits` before we start to go through @@ -936,7 +936,7 @@ and try other types! [[exercises]] name = "rc1" path = "exercises/smart_pointers/rc1.rs" -mode = "compile" +mode = "test" hint = """ This is a straightforward exercise to use the Rc type. Each Planet has ownership of the Sun, and uses Rc::clone() to increment the reference count of the Sun. @@ -1025,7 +1025,7 @@ what you've learned :)""" [[exercises]] name = "threads3" path = "exercises/threads/threads3.rs" -mode = "compile" +mode = "test" hint = """ An alternate way to handle concurrency between threads is to use a mpsc (multiple producer, single consumer) channel to communicate.