From 73aa07068761e4af1e1626c92bac1f2bd96014ad Mon Sep 17 00:00:00 2001 From: merelymyself Date: Tue, 24 May 2022 20:27:58 +0800 Subject: [PATCH 1/5] Guide new users to add use `super::*;` --- src/cargo/ops/cargo_new.rs | 2 ++ tests/testsuite/init/auto_git/out/src/lib.rs | 2 ++ tests/testsuite/init/formats_source/out/src/lib.rs | 12 +++++++----- .../testsuite/init/fossil_autodetect/out/src/lib.rs | 2 ++ tests/testsuite/init/git_autodetect/out/src/lib.rs | 2 ++ .../out/src/lib.rs | 2 ++ .../ignores_failure_to_format_source/out/src/lib.rs | 2 ++ .../init/mercurial_autodetect/out/src/lib.rs | 2 ++ tests/testsuite/init/pijul_autodetect/out/src/lib.rs | 2 ++ tests/testsuite/init/simple_git/out/src/lib.rs | 2 ++ .../init/simple_git_ignore_exists/out/src/lib.rs | 2 ++ tests/testsuite/init/simple_hg/out/src/lib.rs | 2 ++ .../init/simple_hg_ignore_exists/out/src/lib.rs | 2 ++ tests/testsuite/init/simple_lib/out/src/lib.rs | 2 ++ tests/testsuite/new.rs | 2 ++ 15 files changed, 35 insertions(+), 5 deletions(-) diff --git a/src/cargo/ops/cargo_new.rs b/src/cargo/ops/cargo_new.rs index 0df39321e3f..281eec4aa4b 100644 --- a/src/cargo/ops/cargo_new.rs +++ b/src/cargo/ops/cargo_new.rs @@ -811,6 +811,8 @@ fn main() { b"\ #[cfg(test)] mod tests { + // Uncomment this to use items from the containing module. + // use super::*; #[test] fn it_works() { let result = 2 + 2; diff --git a/tests/testsuite/init/auto_git/out/src/lib.rs b/tests/testsuite/init/auto_git/out/src/lib.rs index 1b4a90c9383..d4dead24281 100644 --- a/tests/testsuite/init/auto_git/out/src/lib.rs +++ b/tests/testsuite/init/auto_git/out/src/lib.rs @@ -1,5 +1,7 @@ #[cfg(test)] mod tests { + // Uncomment this to use items from the containing module. + // use super::*; #[test] fn it_works() { let result = 2 + 2; diff --git a/tests/testsuite/init/formats_source/out/src/lib.rs b/tests/testsuite/init/formats_source/out/src/lib.rs index 059dc12384e..d4dead24281 100644 --- a/tests/testsuite/init/formats_source/out/src/lib.rs +++ b/tests/testsuite/init/formats_source/out/src/lib.rs @@ -1,8 +1,10 @@ #[cfg(test)] mod tests { - #[test] - fn it_works() { - let result = 2 + 2; - assert_eq!(result, 4); - } + // Uncomment this to use items from the containing module. + // use super::*; + #[test] + fn it_works() { + let result = 2 + 2; + assert_eq!(result, 4); + } } diff --git a/tests/testsuite/init/fossil_autodetect/out/src/lib.rs b/tests/testsuite/init/fossil_autodetect/out/src/lib.rs index 1b4a90c9383..d4dead24281 100644 --- a/tests/testsuite/init/fossil_autodetect/out/src/lib.rs +++ b/tests/testsuite/init/fossil_autodetect/out/src/lib.rs @@ -1,5 +1,7 @@ #[cfg(test)] mod tests { + // Uncomment this to use items from the containing module. + // use super::*; #[test] fn it_works() { let result = 2 + 2; diff --git a/tests/testsuite/init/git_autodetect/out/src/lib.rs b/tests/testsuite/init/git_autodetect/out/src/lib.rs index 1b4a90c9383..d4dead24281 100644 --- a/tests/testsuite/init/git_autodetect/out/src/lib.rs +++ b/tests/testsuite/init/git_autodetect/out/src/lib.rs @@ -1,5 +1,7 @@ #[cfg(test)] mod tests { + // Uncomment this to use items from the containing module. + // use super::*; #[test] fn it_works() { let result = 2 + 2; diff --git a/tests/testsuite/init/git_ignore_exists_no_conflicting_entries/out/src/lib.rs b/tests/testsuite/init/git_ignore_exists_no_conflicting_entries/out/src/lib.rs index 1b4a90c9383..d4dead24281 100644 --- a/tests/testsuite/init/git_ignore_exists_no_conflicting_entries/out/src/lib.rs +++ b/tests/testsuite/init/git_ignore_exists_no_conflicting_entries/out/src/lib.rs @@ -1,5 +1,7 @@ #[cfg(test)] mod tests { + // Uncomment this to use items from the containing module. + // use super::*; #[test] fn it_works() { let result = 2 + 2; diff --git a/tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs b/tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs index 1b4a90c9383..d4dead24281 100644 --- a/tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs +++ b/tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs @@ -1,5 +1,7 @@ #[cfg(test)] mod tests { + // Uncomment this to use items from the containing module. + // use super::*; #[test] fn it_works() { let result = 2 + 2; diff --git a/tests/testsuite/init/mercurial_autodetect/out/src/lib.rs b/tests/testsuite/init/mercurial_autodetect/out/src/lib.rs index 1b4a90c9383..d4dead24281 100644 --- a/tests/testsuite/init/mercurial_autodetect/out/src/lib.rs +++ b/tests/testsuite/init/mercurial_autodetect/out/src/lib.rs @@ -1,5 +1,7 @@ #[cfg(test)] mod tests { + // Uncomment this to use items from the containing module. + // use super::*; #[test] fn it_works() { let result = 2 + 2; diff --git a/tests/testsuite/init/pijul_autodetect/out/src/lib.rs b/tests/testsuite/init/pijul_autodetect/out/src/lib.rs index 1b4a90c9383..d4dead24281 100644 --- a/tests/testsuite/init/pijul_autodetect/out/src/lib.rs +++ b/tests/testsuite/init/pijul_autodetect/out/src/lib.rs @@ -1,5 +1,7 @@ #[cfg(test)] mod tests { + // Uncomment this to use items from the containing module. + // use super::*; #[test] fn it_works() { let result = 2 + 2; diff --git a/tests/testsuite/init/simple_git/out/src/lib.rs b/tests/testsuite/init/simple_git/out/src/lib.rs index 1b4a90c9383..d4dead24281 100644 --- a/tests/testsuite/init/simple_git/out/src/lib.rs +++ b/tests/testsuite/init/simple_git/out/src/lib.rs @@ -1,5 +1,7 @@ #[cfg(test)] mod tests { + // Uncomment this to use items from the containing module. + // use super::*; #[test] fn it_works() { let result = 2 + 2; diff --git a/tests/testsuite/init/simple_git_ignore_exists/out/src/lib.rs b/tests/testsuite/init/simple_git_ignore_exists/out/src/lib.rs index 1b4a90c9383..d4dead24281 100644 --- a/tests/testsuite/init/simple_git_ignore_exists/out/src/lib.rs +++ b/tests/testsuite/init/simple_git_ignore_exists/out/src/lib.rs @@ -1,5 +1,7 @@ #[cfg(test)] mod tests { + // Uncomment this to use items from the containing module. + // use super::*; #[test] fn it_works() { let result = 2 + 2; diff --git a/tests/testsuite/init/simple_hg/out/src/lib.rs b/tests/testsuite/init/simple_hg/out/src/lib.rs index 1b4a90c9383..d4dead24281 100644 --- a/tests/testsuite/init/simple_hg/out/src/lib.rs +++ b/tests/testsuite/init/simple_hg/out/src/lib.rs @@ -1,5 +1,7 @@ #[cfg(test)] mod tests { + // Uncomment this to use items from the containing module. + // use super::*; #[test] fn it_works() { let result = 2 + 2; diff --git a/tests/testsuite/init/simple_hg_ignore_exists/out/src/lib.rs b/tests/testsuite/init/simple_hg_ignore_exists/out/src/lib.rs index 1b4a90c9383..d4dead24281 100644 --- a/tests/testsuite/init/simple_hg_ignore_exists/out/src/lib.rs +++ b/tests/testsuite/init/simple_hg_ignore_exists/out/src/lib.rs @@ -1,5 +1,7 @@ #[cfg(test)] mod tests { + // Uncomment this to use items from the containing module. + // use super::*; #[test] fn it_works() { let result = 2 + 2; diff --git a/tests/testsuite/init/simple_lib/out/src/lib.rs b/tests/testsuite/init/simple_lib/out/src/lib.rs index 1b4a90c9383..d4dead24281 100644 --- a/tests/testsuite/init/simple_lib/out/src/lib.rs +++ b/tests/testsuite/init/simple_lib/out/src/lib.rs @@ -1,5 +1,7 @@ #[cfg(test)] mod tests { + // Uncomment this to use items from the containing module. + // use super::*; #[test] fn it_works() { let result = 2 + 2; diff --git a/tests/testsuite/new.rs b/tests/testsuite/new.rs index ae23842c14f..1c7abc1b25f 100644 --- a/tests/testsuite/new.rs +++ b/tests/testsuite/new.rs @@ -41,6 +41,8 @@ fn simple_lib() { contents, r#"#[cfg(test)] mod tests { + // Uncomment this to use items from the containing module. + // use super::*; #[test] fn it_works() { let result = 2 + 2; From 8401ef16f6c431a77bb2bfe3ed3e669832c7e5ba Mon Sep 17 00:00:00 2001 From: merelymyself Date: Tue, 24 May 2022 20:42:26 +0800 Subject: [PATCH 2/5] fixed issue with formats_source --- tests/testsuite/init/formats_source/out/src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/testsuite/init/formats_source/out/src/lib.rs b/tests/testsuite/init/formats_source/out/src/lib.rs index d4dead24281..97f71e00133 100644 --- a/tests/testsuite/init/formats_source/out/src/lib.rs +++ b/tests/testsuite/init/formats_source/out/src/lib.rs @@ -1,10 +1,10 @@ #[cfg(test)] mod tests { - // Uncomment this to use items from the containing module. - // use super::*; - #[test] - fn it_works() { - let result = 2 + 2; - assert_eq!(result, 4); - } + // Uncomment this to use items from the containing module. + // use super::*; + #[test] + fn it_works() { + let result = 2 + 2; + assert_eq!(result, 4); + } } From 3d21b1432325cfedfb915503f6ed9dfb6fb82d90 Mon Sep 17 00:00:00 2001 From: merelymyself Date: Fri, 27 May 2022 23:41:37 +0800 Subject: [PATCH 3/5] Guide new users to add use super::*; to mod test --- src/cargo/ops/cargo_new.rs | 10 +++++++--- tests/testsuite/init/auto_git/out/src/lib.rs | 10 +++++++--- tests/testsuite/init/formats_source/out/src/lib.rs | 10 +++++++--- .../testsuite/init/fossil_autodetect/out/src/lib.rs | 10 +++++++--- tests/testsuite/init/git_autodetect/out/src/lib.rs | 10 +++++++--- .../out/src/lib.rs | 10 +++++++--- .../ignores_failure_to_format_source/out/src/lib.rs | 10 +++++++--- .../init/mercurial_autodetect/out/src/lib.rs | 10 +++++++--- tests/testsuite/init/pijul_autodetect/out/src/lib.rs | 10 +++++++--- tests/testsuite/init/simple_git/out/src/lib.rs | 10 +++++++--- .../init/simple_git_ignore_exists/out/src/lib.rs | 10 +++++++--- tests/testsuite/init/simple_hg/out/src/lib.rs | 10 +++++++--- .../init/simple_hg_ignore_exists/out/src/lib.rs | 10 +++++++--- tests/testsuite/init/simple_lib/out/src/lib.rs | 10 +++++++--- tests/testsuite/new.rs | 12 ++++++++---- 15 files changed, 106 insertions(+), 46 deletions(-) diff --git a/src/cargo/ops/cargo_new.rs b/src/cargo/ops/cargo_new.rs index 281eec4aa4b..48b5e080394 100644 --- a/src/cargo/ops/cargo_new.rs +++ b/src/cargo/ops/cargo_new.rs @@ -809,13 +809,17 @@ fn main() { " } else { b"\ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + #[cfg(test)] mod tests { - // Uncomment this to use items from the containing module. - // use super::*; + use super::*; + #[test] fn it_works() { - let result = 2 + 2; + let result = add(2, 2); assert_eq!(result, 4); } } diff --git a/tests/testsuite/init/auto_git/out/src/lib.rs b/tests/testsuite/init/auto_git/out/src/lib.rs index d4dead24281..7d12d9af819 100644 --- a/tests/testsuite/init/auto_git/out/src/lib.rs +++ b/tests/testsuite/init/auto_git/out/src/lib.rs @@ -1,10 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + #[cfg(test)] mod tests { - // Uncomment this to use items from the containing module. - // use super::*; + use super::*; + #[test] fn it_works() { - let result = 2 + 2; + let result = add(2, 2); assert_eq!(result, 4); } } diff --git a/tests/testsuite/init/formats_source/out/src/lib.rs b/tests/testsuite/init/formats_source/out/src/lib.rs index 97f71e00133..3b9acffd5ad 100644 --- a/tests/testsuite/init/formats_source/out/src/lib.rs +++ b/tests/testsuite/init/formats_source/out/src/lib.rs @@ -1,10 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + #[cfg(test)] mod tests { - // Uncomment this to use items from the containing module. - // use super::*; + use super::*; + #[test] fn it_works() { - let result = 2 + 2; + let result = add(2, 2); assert_eq!(result, 4); } } diff --git a/tests/testsuite/init/fossil_autodetect/out/src/lib.rs b/tests/testsuite/init/fossil_autodetect/out/src/lib.rs index d4dead24281..7d12d9af819 100644 --- a/tests/testsuite/init/fossil_autodetect/out/src/lib.rs +++ b/tests/testsuite/init/fossil_autodetect/out/src/lib.rs @@ -1,10 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + #[cfg(test)] mod tests { - // Uncomment this to use items from the containing module. - // use super::*; + use super::*; + #[test] fn it_works() { - let result = 2 + 2; + let result = add(2, 2); assert_eq!(result, 4); } } diff --git a/tests/testsuite/init/git_autodetect/out/src/lib.rs b/tests/testsuite/init/git_autodetect/out/src/lib.rs index d4dead24281..7d12d9af819 100644 --- a/tests/testsuite/init/git_autodetect/out/src/lib.rs +++ b/tests/testsuite/init/git_autodetect/out/src/lib.rs @@ -1,10 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + #[cfg(test)] mod tests { - // Uncomment this to use items from the containing module. - // use super::*; + use super::*; + #[test] fn it_works() { - let result = 2 + 2; + let result = add(2, 2); assert_eq!(result, 4); } } diff --git a/tests/testsuite/init/git_ignore_exists_no_conflicting_entries/out/src/lib.rs b/tests/testsuite/init/git_ignore_exists_no_conflicting_entries/out/src/lib.rs index d4dead24281..7d12d9af819 100644 --- a/tests/testsuite/init/git_ignore_exists_no_conflicting_entries/out/src/lib.rs +++ b/tests/testsuite/init/git_ignore_exists_no_conflicting_entries/out/src/lib.rs @@ -1,10 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + #[cfg(test)] mod tests { - // Uncomment this to use items from the containing module. - // use super::*; + use super::*; + #[test] fn it_works() { - let result = 2 + 2; + let result = add(2, 2); assert_eq!(result, 4); } } diff --git a/tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs b/tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs index d4dead24281..7d12d9af819 100644 --- a/tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs +++ b/tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs @@ -1,10 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + #[cfg(test)] mod tests { - // Uncomment this to use items from the containing module. - // use super::*; + use super::*; + #[test] fn it_works() { - let result = 2 + 2; + let result = add(2, 2); assert_eq!(result, 4); } } diff --git a/tests/testsuite/init/mercurial_autodetect/out/src/lib.rs b/tests/testsuite/init/mercurial_autodetect/out/src/lib.rs index d4dead24281..7d12d9af819 100644 --- a/tests/testsuite/init/mercurial_autodetect/out/src/lib.rs +++ b/tests/testsuite/init/mercurial_autodetect/out/src/lib.rs @@ -1,10 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + #[cfg(test)] mod tests { - // Uncomment this to use items from the containing module. - // use super::*; + use super::*; + #[test] fn it_works() { - let result = 2 + 2; + let result = add(2, 2); assert_eq!(result, 4); } } diff --git a/tests/testsuite/init/pijul_autodetect/out/src/lib.rs b/tests/testsuite/init/pijul_autodetect/out/src/lib.rs index d4dead24281..7d12d9af819 100644 --- a/tests/testsuite/init/pijul_autodetect/out/src/lib.rs +++ b/tests/testsuite/init/pijul_autodetect/out/src/lib.rs @@ -1,10 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + #[cfg(test)] mod tests { - // Uncomment this to use items from the containing module. - // use super::*; + use super::*; + #[test] fn it_works() { - let result = 2 + 2; + let result = add(2, 2); assert_eq!(result, 4); } } diff --git a/tests/testsuite/init/simple_git/out/src/lib.rs b/tests/testsuite/init/simple_git/out/src/lib.rs index d4dead24281..7d12d9af819 100644 --- a/tests/testsuite/init/simple_git/out/src/lib.rs +++ b/tests/testsuite/init/simple_git/out/src/lib.rs @@ -1,10 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + #[cfg(test)] mod tests { - // Uncomment this to use items from the containing module. - // use super::*; + use super::*; + #[test] fn it_works() { - let result = 2 + 2; + let result = add(2, 2); assert_eq!(result, 4); } } diff --git a/tests/testsuite/init/simple_git_ignore_exists/out/src/lib.rs b/tests/testsuite/init/simple_git_ignore_exists/out/src/lib.rs index d4dead24281..7d12d9af819 100644 --- a/tests/testsuite/init/simple_git_ignore_exists/out/src/lib.rs +++ b/tests/testsuite/init/simple_git_ignore_exists/out/src/lib.rs @@ -1,10 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + #[cfg(test)] mod tests { - // Uncomment this to use items from the containing module. - // use super::*; + use super::*; + #[test] fn it_works() { - let result = 2 + 2; + let result = add(2, 2); assert_eq!(result, 4); } } diff --git a/tests/testsuite/init/simple_hg/out/src/lib.rs b/tests/testsuite/init/simple_hg/out/src/lib.rs index d4dead24281..7d12d9af819 100644 --- a/tests/testsuite/init/simple_hg/out/src/lib.rs +++ b/tests/testsuite/init/simple_hg/out/src/lib.rs @@ -1,10 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + #[cfg(test)] mod tests { - // Uncomment this to use items from the containing module. - // use super::*; + use super::*; + #[test] fn it_works() { - let result = 2 + 2; + let result = add(2, 2); assert_eq!(result, 4); } } diff --git a/tests/testsuite/init/simple_hg_ignore_exists/out/src/lib.rs b/tests/testsuite/init/simple_hg_ignore_exists/out/src/lib.rs index d4dead24281..7d12d9af819 100644 --- a/tests/testsuite/init/simple_hg_ignore_exists/out/src/lib.rs +++ b/tests/testsuite/init/simple_hg_ignore_exists/out/src/lib.rs @@ -1,10 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + #[cfg(test)] mod tests { - // Uncomment this to use items from the containing module. - // use super::*; + use super::*; + #[test] fn it_works() { - let result = 2 + 2; + let result = add(2, 2); assert_eq!(result, 4); } } diff --git a/tests/testsuite/init/simple_lib/out/src/lib.rs b/tests/testsuite/init/simple_lib/out/src/lib.rs index d4dead24281..7d12d9af819 100644 --- a/tests/testsuite/init/simple_lib/out/src/lib.rs +++ b/tests/testsuite/init/simple_lib/out/src/lib.rs @@ -1,10 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + #[cfg(test)] mod tests { - // Uncomment this to use items from the containing module. - // use super::*; + use super::*; + #[test] fn it_works() { - let result = 2 + 2; + let result = add(2, 2); assert_eq!(result, 4); } } diff --git a/tests/testsuite/new.rs b/tests/testsuite/new.rs index 1c7abc1b25f..92a5ed46555 100644 --- a/tests/testsuite/new.rs +++ b/tests/testsuite/new.rs @@ -39,13 +39,17 @@ fn simple_lib() { let contents = fs::read_to_string(&lib).unwrap(); assert_eq!( contents, - r#"#[cfg(test)] + r#"pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] mod tests { - // Uncomment this to use items from the containing module. - // use super::*; + use super::*; + #[test] fn it_works() { - let result = 2 + 2; + let result = add(2, 2); assert_eq!(result, 4); } } From 684a338693a884b74d676c22a4417f1f4aad79ef Mon Sep 17 00:00:00 2001 From: merelymyself Date: Sat, 28 May 2022 00:14:30 +0800 Subject: [PATCH 4/5] whitespace --- .../init/ignores_failure_to_format_source/out/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs b/tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs index 7d12d9af819..b46105ccdb7 100644 --- a/tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs +++ b/tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs @@ -5,7 +5,7 @@ pub fn add(left: usize, right: usize) -> usize { #[cfg(test)] mod tests { use super::*; - + #[test] fn it_works() { let result = add(2, 2); From 754a5bfbaa9b5c677e0d96ca7edc17051bf311e1 Mon Sep 17 00:00:00 2001 From: merelymyself Date: Sat, 28 May 2022 00:17:57 +0800 Subject: [PATCH 5/5] whitespace 2 --- src/cargo/ops/cargo_new.rs | 2 +- .../init/ignores_failure_to_format_source/out/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cargo/ops/cargo_new.rs b/src/cargo/ops/cargo_new.rs index 48b5e080394..c7ba255803a 100644 --- a/src/cargo/ops/cargo_new.rs +++ b/src/cargo/ops/cargo_new.rs @@ -816,7 +816,7 @@ pub fn add(left: usize, right: usize) -> usize { #[cfg(test)] mod tests { use super::*; - + #[test] fn it_works() { let result = add(2, 2); diff --git a/tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs b/tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs index b46105ccdb7..7d12d9af819 100644 --- a/tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs +++ b/tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs @@ -5,7 +5,7 @@ pub fn add(left: usize, right: usize) -> usize { #[cfg(test)] mod tests { use super::*; - + #[test] fn it_works() { let result = add(2, 2);