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"; let out_file = "test-out/coverage.tsv";
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("#")); }