From 700eaeaed2fc74c8d79c806c6b438d1f69afe313 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Mon, 17 Aug 2026 12:25:56 +0200 Subject: [PATCH] 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. --- src/obikphylo/src/siblings/tests.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/obikphylo/src/siblings/tests.rs b/src/obikphylo/src/siblings/tests.rs index b21b21c2..e12cc1ce 100644 --- a/src/obikphylo/src/siblings/tests.rs +++ b/src/obikphylo/src/siblings/tests.rs @@ -1108,9 +1108,8 @@ fn diag_real_index_verify_kmer_resolution() { // The k-mer with A+other (mask 0b0011 = A+C) let kmer_str = "AGCTAGCTATTGAGCCTGGTCCGTATGAAAC"; - let kmer = CanonicalKmer::from_str(kmer_str, k).unwrap(); - let rc = kmer.revcomp(); - let rc_str = kmer_to_string(&rc, k); + let kmer = canonical(kmer_str.as_bytes()); + let rc_str = kmer_revcomp_to_string(&kmer, k); println!("kmer_forward={} kmer_revcomp={}", kmer_str, rc_str); println!("kmer partition={}", kmer.partition(n_parts));