test: simplify k-mer test setup for updated canonical API

Adapts sibling k-mer tests to the updated canonical API by replacing string-based construction with direct byte conversion. Removes intermediate reverse complement steps and introduces a helper function to compute reverse complement strings directly from canonical k-mers, preserving existing test output while streamlining setup.
This commit is contained in:
Eric Coissac
2026-08-17 12:32:44 +02:00
parent f1f7940277
commit 700eaeaed2
+2 -3
View File
@@ -1108,9 +1108,8 @@ fn diag_real_index_verify_kmer_resolution() {
// The k-mer with A+other (mask 0b0011 = A+C) // The k-mer with A+other (mask 0b0011 = A+C)
let kmer_str = "AGCTAGCTATTGAGCCTGGTCCGTATGAAAC"; let kmer_str = "AGCTAGCTATTGAGCCTGGTCCGTATGAAAC";
let kmer = CanonicalKmer::from_str(kmer_str, k).unwrap(); let kmer = canonical(kmer_str.as_bytes());
let rc = kmer.revcomp(); let rc_str = kmer_revcomp_to_string(&kmer, k);
let rc_str = kmer_to_string(&rc, k);
println!("kmer_forward={} kmer_revcomp={}", kmer_str, rc_str); println!("kmer_forward={} kmer_revcomp={}", kmer_str, rc_str);
println!("kmer partition={}", kmer.partition(n_parts)); println!("kmer partition={}", kmer.partition(n_parts));