Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
vidjil
vidjil
Commits
edb0e3b0
Commit
edb0e3b0
authored
Feb 27, 2016
by
Mathieu Giraud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: add tests, marked position
parent
fd6c7336
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
algo/tests/testTools.cpp
algo/tests/testTools.cpp
+19
-0
algo/tests/tests.h
algo/tests/tests.h
+2
-0
No files found.
algo/tests/testTools.cpp
View file @
edb0e3b0
...
...
@@ -193,6 +193,24 @@ void testFastaAddThrows() {
TAP_TEST
(
caught
==
true
,
TEST_FASTA_INVALID_FILE
,
""
);
}
void
testFastaLabelAndMark
()
{
Fasta
fa
(
1
,
"="
,
9
);
istringstream
seq1
(
">tic=tac=toe
\n
ACGTACGTACGT
\n
"
);
seq1
>>
fa
;
TAP_TEST
(
fa
.
read
(
0
).
label
==
"tic"
,
TEST_FASTA_LABEL
,
""
);
TAP_TEST
(
fa
.
read
(
0
).
marked_pos
==
9
,
TEST_FASTA_MARK
,
""
);
istringstream
seq2
(
">seq2
\n
A.G.ACGTACGT
\n
"
);
seq2
>>
fa
;
TAP_TEST
(
fa
.
read
(
1
).
marked_pos
==
7
,
TEST_FASTA_MARK
,
""
);
istringstream
seq3
(
">seq2
\n
..........GT
\n
"
);
seq3
>>
fa
;
TAP_TEST
(
fa
.
read
(
2
).
marked_pos
==
0
,
TEST_FASTA_MARK
,
""
);
}
void
testSequenceOutputOperator
()
{
ostringstream
oss
;
Sequence
seq
=
{
"a b c"
,
"a"
,
"GATTACA"
,
"AIIIIIH"
,
NULL
,
0
};
...
...
@@ -329,6 +347,7 @@ void testTools() {
testFasta1
();
testFastaAdd
();
testFastaAddThrows
();
testFastaLabelAndMark
();
testSequenceOutputOperator
();
testFastaOutputOperator
();
testRevcomp
();
...
...
algo/tests/tests.h
View file @
edb0e3b0
...
...
@@ -15,6 +15,8 @@ enum {
TEST_FASTA_INVALID_FILE
,
TEST_FASTA_OUT
,
TEST_FASTA_NB_SEQUENCES
,
TEST_FASTA_MARK
,
TEST_CREATE_SEQUENCE_LABEL_FULL
,
TEST_CREATE_SEQUENCE_LABEL
,
TEST_CREATE_SEQUENCE_SEQUENCE
,
...
...
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