Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Sep 4, 2024
1 parent 816a124 commit 267b606
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/python/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,19 @@ def test_consume_bad_DNA_ignore_is_default():
assert cg.get("ATCG") == 1
assert cg.get("TCGG") == 1
assert cg.get("CCGA") == 1 # rc


def test_count_get():
# test a bug reported by adam taranto: count and get should work together!
kmer = 'TAAACCCTAACCCTAACCCTAACCCTAACCC'

cg = oxli.KmerCountTable(ksize=31)
hashkey = cg.hash_kmer(kmer)

assert cg.get(kmer) == 0
assert cg.count(kmer) == 1
assert cg.count(kmer) == 2

x = cg.get(kmer)
assert x == 2, x

0 comments on commit 267b606

Please sign in to comment.