Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Johanna committed Sep 10, 2024
1 parent df66f24 commit 6bd1e3f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 16 deletions.
52 changes: 38 additions & 14 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,44 @@ impl TestSetup {
pub fn setup() -> Self {
let wd = assert_fs::TempDir::new().unwrap();

wd.child(SYM_IN)
.symlink_to_dir(
Path::new(FILE_IN)
.canonicalize()
.expect("Could not link expected files"),
)
.unwrap();
wd.child(SYM_TEST)
.symlink_to_dir(
Path::new(FILE_TEST)
.canonicalize()
.expect("Could not link expected files"),
)
.unwrap();
println!("Current working directory: {:?}", std::env::current_dir().unwrap());

// Debug: Print FILE_IN and FILE_TEST paths
println!("FILE_IN constant value: {:?}", FILE_IN);
println!("FILE_TEST constant value: {:?}", FILE_TEST);

let file_in_path = Path::new(FILE_IN);
let file_test_path = Path::new(FILE_TEST);

println!("FILE_IN absolute path: {:?}", file_in_path.canonicalize());
println!("FILE_TEST absolute path: {:?}", file_test_path.canonicalize());

// Check if the directories exist
println!("FILE_IN exists: {}", file_in_path.exists());
println!("FILE_TEST exists: {}", file_test_path.exists());

// Attempt to create symlink for SYM_IN
match wd.child(SYM_IN).symlink_to_dir(file_in_path.canonicalize().unwrap_or_else(|e| {
panic!("Failed to canonicalize FILE_IN path: {:?}. Error: {:?}", file_in_path, e);
})) {
Ok(_) => println!("Successfully created symlink for {}", SYM_IN),
Err(e) => println!("Failed to create symlink for {}: {:?}", SYM_IN, e),
}

// Attempt to create symlink for SYM_TEST
match wd.child(SYM_TEST).symlink_to_dir(file_test_path.canonicalize().unwrap_or_else(|e| {
panic!("Failed to canonicalize FILE_TEST path: {:?}. Error: {:?}", file_test_path, e);
})) {
Ok(_) => println!("Successfully created symlink for {}", SYM_TEST),
Err(e) => println!("Failed to create symlink for {}: {:?}", SYM_TEST, e),
}

// Debug: Print contents of temporary directory
println!("Contents of temporary directory:");
for entry in std::fs::read_dir(&wd.path()).unwrap() {
let entry = entry.unwrap();
println!(" {:?}", entry.path());
}

Self { wd }
}
Expand Down
2 changes: 0 additions & 2 deletions tests/concat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ use std::path::Path;

pub mod common;
use crate::common::*;
use sketchlib::io::*;

use sketchlib::multisketch::MultiSketch;

#[cfg(test)]

mod tests {
use super::*;
use sketchlib::io;

#[test]
fn test_concat_sketches() {
Expand Down

0 comments on commit 6bd1e3f

Please sign in to comment.