mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-01-15 00:00:03 +03:00
chore(box1): moved main to tests module
This commit is contained in:
parent
88b583f2bb
commit
7a6c439939
|
@ -26,14 +26,6 @@ pub enum List {
|
||||||
Nil,
|
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 {
|
pub fn create_empty_list() -> List {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
@ -46,6 +38,15 @@ pub fn create_non_empty_list() -> List {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
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]
|
#[test]
|
||||||
fn test_create_empty_list() {
|
fn test_create_empty_list() {
|
||||||
assert_eq!(List::Nil, create_empty_list())
|
assert_eq!(List::Nil, create_empty_list())
|
||||||
|
|
Loading…
Reference in a new issue