summaryrefslogtreecommitdiff
path: root/systems/_framework
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-03-18 11:05:21 +0800
committer魏曹先生 <1992414357@qq.com>2026-03-18 11:05:21 +0800
commit6f8906f06f3efd009275dc23f861f5aaba76ce72 (patch)
treef1ebe11da2b6c4e3718745ce8dd621dc28f6a6b8 /systems/_framework
parent0ed62fa6dddf7cc758aa32042c70cc2a5e2d8ef8 (diff)
Add debug prints and assertions to space root test
Diffstat (limited to 'systems/_framework')
-rw-r--r--systems/_framework/space_macro/src/lib.rs25
1 files changed, 22 insertions, 3 deletions
diff --git a/systems/_framework/space_macro/src/lib.rs b/systems/_framework/space_macro/src/lib.rs
index a43e833..e63ce82 100644
--- a/systems/_framework/space_macro/src/lib.rs
+++ b/systems/_framework/space_macro/src/lib.rs
@@ -35,16 +35,35 @@ pub fn space_root_test_derive(input: TokenStream) -> TokenStream {
let mut space = Space::new(#name::default());
match #name::get_pattern() {
- SpaceRootFindPattern::AbsolutePath(path_buf) => space.set_override_pattern(Some(
- SpaceRootFindPattern::AbsolutePath(temp_dir.join(path_buf)),
- )),
+ SpaceRootFindPattern::AbsolutePath(path_buf) => {
+ let dir = temp_dir.join("root");
+ println!("Redirect absolute path:");
+ println!(" from: `{}`", path_buf.display());
+ println!(" to: `{}`", dir.display());
+ space.set_override_pattern(Some(
+ SpaceRootFindPattern::AbsolutePath(dir.clone()),
+ ));
+
+ println!("Checking if {} absolute directory does not exist before initialization", stringify!(#name));
+ assert!(!dir.exists());
+
+ space.init_here().await.unwrap();
+
+ println!("Checking if {} absolute directory exists after initialization", stringify!(#name));
+ assert!(dir.exists());
+ println!("\u{001b}[33;1mwarning\u{001b}[0m: Absolute path test completed in isolated environment, may not fully represent system runtime conditions");
+
+ return;
+ },
_ => {}
}
+ println!("Checking if {} does not exist before initialization", stringify!(#name));
assert!(space.space_dir_current().is_err());
space.init_here().await.unwrap();
+ println!("Checking if {} exists after initialization", stringify!(#name));
assert!(space.space_dir_current().is_ok());
}
}