File: KmerIteratorTest.cpp

package info (click to toggle)
abyss 2.3.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,284 kB
  • sloc: cpp: 78,182; ansic: 6,512; makefile: 2,252; perl: 672; sh: 509; haskell: 412; python: 4
file content (48 lines) | stat: -rw-r--r-- 869 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "Common/KmerIterator.h"
#include <gtest/gtest.h>

TEST(KmerIteratorTest, NoIllegalChars)
{
	unsigned k = 3;
	Kmer::setLength(k);
	KmerIterator i("AGCTA", k);

	ASSERT_EQ(Kmer("AGC"), *i);
	i++;
	ASSERT_EQ(Kmer("GCT"), *i);
	i++;
	ASSERT_EQ(Kmer("CTA"), *i);
	i++;
	ASSERT_EQ(KmerIterator::end(), i);
}

TEST(KmerIteratorTest, IllegalChars)
{
	unsigned k = 3;
	Kmer::setLength(k);
	KmerIterator i("AGCTNTAG", k);

	ASSERT_EQ(Kmer("AGC"), *i);
	i++;
	ASSERT_EQ(Kmer("GCT"), *i);
	i++;
	ASSERT_EQ(Kmer("TAG"), *i);
	i++;
	ASSERT_EQ(KmerIterator::end(), i);
}

TEST(KmerIteratorTest, SeqLengthOneLessThanK)
{
	unsigned k = 3;
	Kmer::setLength(k);
	KmerIterator i("AG", k);
	ASSERT_EQ(KmerIterator::end(), i);
}

TEST(KmerIteratorTest, SeqLengthMuchLessThanK)
{
	unsigned k = 10;
	Kmer::setLength(k);
	KmerIterator i("AG", k);
	ASSERT_EQ(KmerIterator::end(), i);
}