use rust_htslib::bam::{self, Read};
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_load_bam_file() {
let bam_file = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/example.bam");
let mut reader = bam::Reader::from_path(bam_file)
.expect("Failed to open BAM file");
let mut record = bam::Record::new();
let mut count = 0;
while let Some(result) = reader.read(&mut record) {
match result {
Ok(_) => count += 1,
Err(e) => panic!("Error reading BAM record: {:?}", e),
}
}
println!("Found {} records in BAM file", count);
assert!(count > 0, "No records found in BAM file");
}
}