Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
7a2239cd
Commit
7a2239cd
authored
Mar 11, 2015
by
Mathieu Giraud
Browse files
tests: new unit tests, extended nucleotides
parent
24e760fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
algo/tests/testTools.cpp
View file @
7a2239cd
...
...
@@ -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
();
}
algo/tests/tests.h
View file @
7a2239cd
...
...
@@ -22,6 +22,7 @@ enum {
TEST_NUC_TO_INT
,
TEST_DNA_TO_INT
,
TEST_REVCOMP_INT
,
TEST_EXTENDED_NUCL
,
TEST_EXTRACT_BASENAME
,
/* Storage tests */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment