diff --git a/exercises/19_smart_pointers/box1.rs b/exercises/19_smart_pointers/box1.rs index 513e7daa..c5af8d9b 100644 --- a/exercises/19_smart_pointers/box1.rs +++ b/exercises/19_smart_pointers/box1.rs @@ -26,14 +26,6 @@ pub enum List { Nil, } -fn main() { - println!("This is an empty cons list: {:?}", create_empty_list()); - println!( - "This is a non-empty cons list: {:?}", - create_non_empty_list() - ); -} - pub fn create_empty_list() -> List { todo!() } @@ -46,6 +38,15 @@ pub fn create_non_empty_list() -> List { mod tests { use super::*; + #[test] + fn main() { + println!("This is an empty cons list: {:?}", create_empty_list()); + println!( + "This is a non-empty cons list: {:?}", + create_non_empty_list() + ); + } + #[test] fn test_create_empty_list() { assert_eq!(List::Nil, create_empty_list())