Skip to content

Commit

Permalink
feat: add test for prefix as phenotype name
Browse files Browse the repository at this point in the history
  • Loading branch information
zietzm committed Jul 22, 2024
1 parent 1ccc8d5 commit 3ba26d5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,25 @@ pub fn run(

Ok(())
}

mod tests {
#[test]
fn test_gwas_path_to_phenotype() {
let paths = [
"plink.glm",
"plink.glm.linear",
"plink.glm.linear.zst",
"plink.glm.linear.gz",
"plink.glm.linear.zst.gz",
];
for path in paths.iter() {
let result = crate::util::gwas_path_to_phenotype(path);
assert_eq!(result, "plink");
}

assert_eq!(
crate::util::gwas_path_to_phenotype("feature1.tsv"),
"feature1"
);
}
}

0 comments on commit 3ba26d5

Please sign in to comment.