From 06d89d20ae492918156a86c2f2f928d589f6ce39 Mon Sep 17 00:00:00 2001 From: Zakir Jiwani <108548454+JiwaniZakir@users.noreply.github.com> Date: Wed, 18 Mar 2026 22:49:52 +0000 Subject: [PATCH 1/2] Add test for modules1 to prevent passing by commenting out main --- exercises/10_modules/modules1.rs | 10 ++++++++++ solutions/10_modules/modules1.rs | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/exercises/10_modules/modules1.rs b/exercises/10_modules/modules1.rs index d97ab23a..65335ded 100644 --- a/exercises/10_modules/modules1.rs +++ b/exercises/10_modules/modules1.rs @@ -14,3 +14,13 @@ mod sausage_factory { fn main() { sausage_factory::make_sausage(); } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_make_sausage() { + sausage_factory::make_sausage(); + } +} diff --git a/solutions/10_modules/modules1.rs b/solutions/10_modules/modules1.rs index 873b4127..c9690549 100644 --- a/solutions/10_modules/modules1.rs +++ b/solutions/10_modules/modules1.rs @@ -13,3 +13,13 @@ mod sausage_factory { fn main() { sausage_factory::make_sausage(); } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_make_sausage() { + sausage_factory::make_sausage(); + } +} From 53fa6d73311d57b4071c130eac279590bd6d03ba Mon Sep 17 00:00:00 2001 From: Zakir Jiwani <108548454+JiwaniZakir@users.noreply.github.com> Date: Wed, 18 Mar 2026 22:54:43 +0000 Subject: [PATCH 2/2] Enable test runner for modules1 so the added test is actually executed --- rustlings-macros/info.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rustlings-macros/info.toml b/rustlings-macros/info.toml index e42b0f26..ba618d62 100644 --- a/rustlings-macros/info.toml +++ b/rustlings-macros/info.toml @@ -517,7 +517,7 @@ because "blue" is `&str`, not `String`.""" [[exercises]] name = "modules1" dir = "10_modules" -test = false +test = true hint = """ Everything is private in Rust by default. But there's a keyword we can use to make something public!"""