Commit 7a2239cd authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

tests: new unit tests, extended nucleotides

parent 24e760fa
......@@ -249,6 +249,17 @@ void testRevcompInt() {
TEST_REVCOMP_INT, "revcomp: " << revcomp_int(dna_to_int("ATTAGGA", 7), 7) <<", dna_to_int: " << dna_to_int("TCCTAAT", 7));
}
void testExtendedNucleotides() {
TAP_TEST(is_extended_nucleotide('A') == false, TEST_EXTENDED_NUCL, "");
TAP_TEST(is_extended_nucleotide('a') == false, TEST_EXTENDED_NUCL, "");
TAP_TEST(is_extended_nucleotide('N') == true, TEST_EXTENDED_NUCL, "");
TAP_TEST(is_extended_nucleotide(' ') == true, TEST_EXTENDED_NUCL, "");
TAP_TEST(has_extended_nucleotides("") == false, TEST_EXTENDED_NUCL, "");
TAP_TEST(has_extended_nucleotides("ACGTacgt") == false, TEST_EXTENDED_NUCL, "");
TAP_TEST(has_extended_nucleotides("ACGTnacgt") == true, TEST_EXTENDED_NUCL, "");
}
void testExtractBasename() {
TAP_TEST(extract_basename("/var/toto/titi/tutu/bla.bli.bluc", true) == "bla.bli",
TEST_EXTRACT_BASENAME, extract_basename("/var/toto/titi/tutu/bla.bli.bluc", true));
......@@ -276,5 +287,6 @@ void testTools() {
testNucToInt();
testDNAToInt();
testRevcompInt();
testExtendedNucleotides();
testExtractBasename();
}
......@@ -22,6 +22,7 @@ enum {
TEST_NUC_TO_INT,
TEST_DNA_TO_INT,
TEST_REVCOMP_INT,
TEST_EXTENDED_NUCL,
TEST_EXTRACT_BASENAME,
/* Storage tests */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment