Commit febac524 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

tests: testing {approx_,}nb_sequences_in_fasta

parent f8a4008b
......@@ -26,6 +26,18 @@ void testOnlineFasta1() {
TAP_TEST(nb_seq == 5, TEST_O_FASTA_HAS_NEXT, "");
}
void testFastaNbSequences() {
TAP_TEST(nb_sequences_in_fasta("../../germline/IGHV.fa") == 344, TEST_FASTA_NB_SEQUENCES, "ccc");
int a1 = approx_nb_sequences_in_fasta("../../germline/IGHV.fa");
TAP_TEST(a1 >= 340 && a1 <= 348, TEST_FASTA_NB_SEQUENCES, "");
int a2 = nb_sequences_in_fasta("../../data/Stanford_S22.fasta", true);
TAP_TEST(a2 >= 13100 && a2 <= 13200, TEST_FASTA_NB_SEQUENCES, "");
}
void testFasta1() {
Fasta fa("../../data/test1.fa");
Fasta fq("../../data/test1.fq");
......@@ -284,6 +296,7 @@ void testNChooseK() {
void testTools() {
testOnlineFasta1();
testFastaNbSequences();
testFasta1();
testFastaAdd();
testFastaAddThrows();
......
......@@ -14,6 +14,7 @@ enum {
TEST_FASTA_ADD,
TEST_FASTA_INVALID_FILE,
TEST_FASTA_OUT,
TEST_FASTA_NB_SEQUENCES,
TEST_CREATE_SEQUENCE_LABEL_FULL,
TEST_CREATE_SEQUENCE_LABEL,
TEST_CREATE_SEQUENCE_SEQUENCE,
......@@ -167,6 +168,7 @@ inline void declare_tests() {
RECORD_TAP_TEST(TEST_FASTA_ADD, "Fasta add() method");
RECORD_TAP_TEST(TEST_FASTA_INVALID_FILE, "Fasta with invalid file");
RECORD_TAP_TEST(TEST_FASTA_OUT, "Test operator<< with Fasta");
RECORD_TAP_TEST(TEST_FASTA_NB_SEQUENCES, "Nb sequences in Fasta");
RECORD_TAP_TEST(TEST_CREATE_SEQUENCE_LABEL_FULL, "create_sequence: label_full field");
RECORD_TAP_TEST(TEST_CREATE_SEQUENCE_LABEL, "create_sequence: label field");
RECORD_TAP_TEST(TEST_CREATE_SEQUENCE_SEQUENCE, "create_sequence: sequence field");
......
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