use super::FeatureNameKind;
const GENE: FeatureNameKind = FeatureNameKind::Gene { delim: '_' };
const LOCUS: FeatureNameKind = FeatureNameKind::Locus {
merge_overlapping: true,
};
#[test]
fn all_exact_stays_exact() {
assert_eq!(
FeatureNameKind::reconcile(&[FeatureNameKind::Exact, FeatureNameKind::Exact]),
FeatureNameKind::Exact
);
}
#[test]
fn a_bare_symbol_file_adopts_the_gene_rule_of_its_neighbour() {
assert_eq!(
FeatureNameKind::reconcile(&[GENE, FeatureNameKind::Exact]),
GENE
);
assert_eq!(
FeatureNameKind::reconcile(&[FeatureNameKind::Exact, GENE]),
GENE
);
}
#[test]
fn agreeing_files_keep_their_kind() {
assert_eq!(FeatureNameKind::reconcile(&[GENE, GENE]), GENE);
assert_eq!(FeatureNameKind::reconcile(&[LOCUS, LOCUS]), LOCUS);
}
#[test]
fn genes_and_loci_across_files_dispatch_per_name() {
assert_eq!(
FeatureNameKind::reconcile(&[GENE, LOCUS]),
FeatureNameKind::Mixed
);
assert_eq!(
FeatureNameKind::reconcile(&[FeatureNameKind::Exact, LOCUS, GENE]),
FeatureNameKind::Mixed
);
}
#[test]
fn mixed_anywhere_is_mixed() {
assert_eq!(
FeatureNameKind::reconcile(&[FeatureNameKind::Mixed, GENE]),
FeatureNameKind::Mixed
);
assert_eq!(
FeatureNameKind::reconcile(&[FeatureNameKind::Exact, FeatureNameKind::Mixed]),
FeatureNameKind::Mixed
);
}
#[test]
fn no_files_is_exact() {
assert_eq!(FeatureNameKind::reconcile(&[]), FeatureNameKind::Exact);
}