diff --git a/src/python/tests/test_basic.py b/src/python/tests/test_basic.py index 03e5325..edc2a8d 100644 --- a/src/python/tests/test_basic.py +++ b/src/python/tests/test_basic.py @@ -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 +