From 7a6c4399395d5e1f3926c0650c18464fed5ad670 Mon Sep 17 00:00:00 2001 From: "Hudson C. Dalpra" Date: Sat, 23 Dec 2023 22:53:41 +1300 Subject: [PATCH] chore(box1): moved main to tests module --- exercises/19_smart_pointers/box1.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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())