use super::*;
fn names(v: &[&str]) -> Vec<Box<str>> {
v.iter().map(|s| (*s).into()).collect()
}
#[test]
fn no_suffix_list_is_a_single_panel() {
assert!(feature_modality_from_suffix(&names(&["CD3E", "LYZ"]), None).is_none());
}
#[test]
fn one_distinct_suffix_is_a_single_panel() {
let n = names(&["CD3E/scRNA", "LYZ/scRNA"]);
assert!(feature_modality_from_suffix(&n, Some(&names(&["scRNA", "scRNA"]))).is_none());
}
#[test]
fn rows_are_keyed_by_the_suffix_they_were_namespaced_with() {
let n = names(&["CD3E/scRNA", "ADT-CD3/scADT", "LYZ/scRNA", "ADT-CD14/scADT"]);
let m = feature_modality_from_suffix(&n, Some(&names(&["scRNA", "scADT"]))).expect("two");
assert_eq!(m[0], m[2]);
assert_eq!(m[1], m[3]);
assert_ne!(m[0], m[1]);
}
#[test]
fn a_gem_splice_axis_is_not_two_modalities() {
let n = names(&[
"G1/count/spliced",
"G1/count/unspliced",
"G2/count/spliced",
"G2/count/unspliced",
]);
assert!(feature_modality_from_suffix(&n, None).is_none());
assert!(feature_modality_from_suffix(&n, Some(&names(&["scRNA", "scADT"]))).is_none());
}
#[test]
fn an_unsuffixed_row_declines_the_whole_axis() {
let n = names(&["CD3E/scRNA", "LYZ"]);
assert!(feature_modality_from_suffix(&n, Some(&names(&["scRNA", "scADT"]))).is_none());
}