Skip to content

Commit 193b600

Browse files
committed
Convert other exercises that have assertions to test mode
1 parent 16936d9 commit 193b600

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

exercises/iterators/iterators1.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
// I AM NOT DONE
1313

14+
#[test]
1415
fn main() {
1516
let my_fav_fruits = vec!["banana", "custard apple", "avocado", "peach", "raspberry"];
1617

exercises/smart_pointers/rc1.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ impl Planet {
3535
}
3636
}
3737

38+
#[test]
3839
fn main() {
3940
let sun = Rc::new(Sun {});
4041
println!("reference count = {}", Rc::strong_count(&sun)); // 1 reference

exercises/threads/threads3.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ fn send_tx(q: Queue, tx: mpsc::Sender<u32>) -> () {
4848
});
4949
}
5050

51+
#[test]
5152
fn main() {
5253
let (tx, rx) = mpsc::channel();
5354
let queue = Queue::new();

info.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ https://doc.rust-lang.org/stable/book/ch11-01-writing-tests.html#checking-for-pa
831831
[[exercises]]
832832
name = "iterators1"
833833
path = "exercises/iterators/iterators1.rs"
834-
mode = "compile"
834+
mode = "test"
835835
hint = """
836836
Step 1:
837837
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!
936936
[[exercises]]
937937
name = "rc1"
938938
path = "exercises/smart_pointers/rc1.rs"
939-
mode = "compile"
939+
mode = "test"
940940
hint = """
941941
This is a straightforward exercise to use the Rc<T> type. Each Planet has
942942
ownership of the Sun, and uses Rc::clone() to increment the reference count of the Sun.
@@ -1025,7 +1025,7 @@ what you've learned :)"""
10251025
[[exercises]]
10261026
name = "threads3"
10271027
path = "exercises/threads/threads3.rs"
1028-
mode = "compile"
1028+
mode = "test"
10291029
hint = """
10301030
An alternate way to handle concurrency between threads is to use
10311031
a mpsc (multiple producer, single consumer) channel to communicate.

0 commit comments

Comments
 (0)