nanocov 0.1.0

Rust Coverage Calculator and QC Plot Generation Tool
Documentation
use assert_cmd::Command;
use std::fs;
use std::path::Path;

#[test]
fn test_nanocov_runs_and_outputs_file() {
    let bam = "test-data/small-test-phased.bam";
    if !Path::new(bam).exists() {
        eprintln!("Skipping integration test: missing test BAM {bam}");
        return;
    }
    let bed = "test-data/testbed.bed"; // Use a small BED file or create one
    let out_file = "test-out/coverage.tsv";
    // Remove output file if it exists
    let _ = fs::remove_file(out_file);
    let mut cmd = Command::cargo_bin("nanocov").unwrap();
    let result = cmd
        .arg("-i")
        .arg(bam)
        .arg("-b")
        .arg(bed)
        .arg("-o")
        .arg(out_file)
        .assert();
    result.success();
    assert!(Path::new(out_file).exists());
    let contents = fs::read_to_string(out_file).unwrap();
    assert!(contents.contains("#")); // Should contain at least one reference header
}