From 3314022480ada901e5422ca73bd72658f62ca89f Mon Sep 17 00:00:00 2001 From: kivancgnlp Date: Thu, 11 Dec 2025 10:51:44 +0300 Subject: [PATCH] Test properties updated --- rustlings-macros/info.toml | 3 +++ solutions/24_file_io/file_io1.rs | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/rustlings-macros/info.toml b/rustlings-macros/info.toml index a6ddd1b9..b0dbda54 100644 --- a/rustlings-macros/info.toml +++ b/rustlings-macros/info.toml @@ -1206,6 +1206,7 @@ Add `AsRef` or `AsMut` as a trait bound to the functions.""" [[exercises]] name = "file_io1" dir = "24_file_io" +test = false hint = """ Basic File Reading """ @@ -1213,6 +1214,7 @@ Basic File Reading [[exercises]] name = "file_io2" dir = "24_file_io" +test = false hint = """ Buffered Reading & Writing """ @@ -1220,6 +1222,7 @@ Buffered Reading & Writing [[exercises]] name = "file_io3" dir = "24_file_io" +test = false hint = """ Path Manipulation & Metadata """ diff --git a/solutions/24_file_io/file_io1.rs b/solutions/24_file_io/file_io1.rs index f9d75d6e..2f170e47 100644 --- a/solutions/24_file_io/file_io1.rs +++ b/solutions/24_file_io/file_io1.rs @@ -14,3 +14,22 @@ fn main() { } } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_working_directory() { + let working_directory_result = std::path::Path::new(".").canonicalize(); + + match working_directory_result { + Ok(working_directory) => { + println!("The working directory is {:?}", working_directory); + } + Err(error) => { + println!("Error: {:?}", error); + } + } + } +} \ No newline at end of file