Skip to content

Commit 22da4ac

Browse files
author
Johanna
committed
update github workflow with debug statements 2
1 parent 970a859 commit 22da4ac

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

tests/common/mod.rs

+19-13
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,34 @@ impl TestSetup {
3737
pub fn setup() -> Self {
3838
let wd = assert_fs::TempDir::new().unwrap();
3939

40-
// Debug: Print current working directory
4140
println!("Current working directory: {:?}", std::env::current_dir().unwrap());
4241

4342
// Debug: Print FILE_IN and FILE_TEST paths
44-
println!("FILE_IN path: {:?}", Path::new(FILE_IN).canonicalize());
45-
println!("FILE_TEST path: {:?}", Path::new(FILE_TEST).canonicalize());
43+
println!("FILE_IN constant value: {:?}", FILE_IN);
44+
println!("FILE_TEST constant value: {:?}", FILE_TEST);
45+
46+
let file_in_path = Path::new(FILE_IN);
47+
let file_test_path = Path::new(FILE_TEST);
48+
49+
println!("FILE_IN absolute path: {:?}", file_in_path.canonicalize());
50+
println!("FILE_TEST absolute path: {:?}", file_test_path.canonicalize());
51+
52+
// Check if the directories exist
53+
println!("FILE_IN exists: {}", file_in_path.exists());
54+
println!("FILE_TEST exists: {}", file_test_path.exists());
4655

4756
// Attempt to create symlink for SYM_IN
48-
match wd.child(SYM_IN).symlink_to_dir(
49-
Path::new(FILE_IN)
50-
.canonicalize()
51-
.expect("Could not canonicalize FILE_IN path")
52-
) {
57+
match wd.child(SYM_IN).symlink_to_dir(file_in_path.canonicalize().unwrap_or_else(|e| {
58+
panic!("Failed to canonicalize FILE_IN path: {:?}. Error: {:?}", file_in_path, e);
59+
})) {
5360
Ok(_) => println!("Successfully created symlink for {}", SYM_IN),
5461
Err(e) => println!("Failed to create symlink for {}: {:?}", SYM_IN, e),
5562
}
5663

5764
// Attempt to create symlink for SYM_TEST
58-
match wd.child(SYM_TEST).symlink_to_dir(
59-
Path::new(FILE_TEST)
60-
.canonicalize()
61-
.expect("Could not canonicalize FILE_TEST path")
62-
) {
65+
match wd.child(SYM_TEST).symlink_to_dir(file_test_path.canonicalize().unwrap_or_else(|e| {
66+
panic!("Failed to canonicalize FILE_TEST path: {:?}. Error: {:?}", file_test_path, e);
67+
})) {
6368
Ok(_) => println!("Successfully created symlink for {}", SYM_TEST),
6469
Err(e) => println!("Failed to create symlink for {}: {:?}", SYM_TEST, e),
6570
}
@@ -73,6 +78,7 @@ impl TestSetup {
7378

7479
Self { wd }
7580
}
81+
7682
pub fn get_wd(&self) -> String {
7783
self.wd.path().display().to_string()
7884
}

0 commit comments

Comments
 (0)