diff options
| author | liv <mokou@fastmail.com> | 2023-09-06 09:31:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-06 09:31:46 +0200 |
| commit | 4d04aad8902262d73d05b066ef0b8ffcd4fb634d (patch) | |
| tree | 31c90ca2ff727980780e5c29882ca17c53109f16 /exercises | |
| parent | 847b57423f2a2500b666ec0085cbd897b7b7139f (diff) | |
| parent | 193b600382ead22a24d2c26ca3a9117e7ad18be8 (diff) | |
Merge pull request #1641 from mo8it/move-semantics5-test
Convert exercises with assertions to tests
Diffstat (limited to 'exercises')
| -rw-r--r-- | exercises/iterators/iterators1.rs | 1 | ||||
| -rw-r--r-- | exercises/move_semantics/move_semantics3.rs | 2 | ||||
| -rw-r--r-- | exercises/move_semantics/move_semantics5.rs | 1 | ||||
| -rw-r--r-- | exercises/smart_pointers/rc1.rs | 1 | ||||
| -rw-r--r-- | exercises/threads/threads3.rs | 1 |
5 files changed, 5 insertions, 1 deletions
diff --git a/exercises/iterators/iterators1.rs b/exercises/iterators/iterators1.rs index b3f698b..31076bb 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/move_semantics/move_semantics3.rs b/exercises/move_semantics/move_semantics3.rs index 69e564a..7af9e69 100644 --- a/exercises/move_semantics/move_semantics3.rs +++ b/exercises/move_semantics/move_semantics3.rs @@ -1,6 +1,6 @@ // move_semantics3.rs // -// Make me compile without adding new lines-- just changing existing lines! (no +// Make me compile without adding new lines -- just changing existing lines! (no // lines with multiple semicolons necessary!) // // Execute `rustlings hint move_semantics3` or use the `hint` watch subcommand diff --git a/exercises/move_semantics/move_semantics5.rs b/exercises/move_semantics/move_semantics5.rs index 68db09e..267bdcc 100644 --- a/exercises/move_semantics/move_semantics5.rs +++ b/exercises/move_semantics/move_semantics5.rs @@ -8,6 +8,7 @@ // I AM NOT DONE +#[test] fn main() { let mut x = 100; let y = &mut x; diff --git a/exercises/smart_pointers/rc1.rs b/exercises/smart_pointers/rc1.rs index ad3f1ce..1b90346 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 db7d41b..91006bb 100644 --- a/exercises/threads/threads3.rs +++ b/exercises/threads/threads3.rs @@ -48,6 +48,7 @@ fn send_tx(q: Queue, tx: mpsc::Sender<u32>) -> () { }); } +#[test] fn main() { let (tx, rx) = mpsc::channel(); let queue = Queue::new(); |
