From 97d764688e73e433e53853b0fde8f326469a8b57 Mon Sep 17 00:00:00 2001 From: Lydia Buntrock Date: Mon, 6 Apr 2020 20:48:51 +0200 Subject: [PATCH] [MISC] remove using namespace seqan3/test/unit/alphabet/a*-c* (#1657) * [MISC] Remove 'using namespace seqan3' from test/unit/alphabet/a*. * [MISC] Remove 'using namespace seqan3' from test/unit/alphabet/c*. * [MISC] style guide fixes --- test/unit/alphabet/adaptation/char_test.cpp | 62 ++- test/unit/alphabet/adaptation/uint_test.cpp | 62 ++- test/unit/alphabet/alphabet_cereal_test.cpp | 14 +- test/unit/alphabet/alphabet_hash_test.cpp | 4 +- test/unit/alphabet/aminoacid/aa10li_test.cpp | 60 ++- .../alphabet/aminoacid/aa10murphy_test.cpp | 60 ++- test/unit/alphabet/aminoacid/aa20_test.cpp | 80 +-- test/unit/alphabet/aminoacid/aa27_test.cpp | 91 ++-- .../aminoacid_conversion_integration_test.cpp | 16 +- .../aminoacid/aminoacid_test_template.hpp | 10 +- .../aminoacid/aminoacid_translation_test.cpp | 44 +- test/unit/alphabet/cigar/cigar_op_test.cpp | 2 + test/unit/alphabet/cigar/cigar_test.cpp | 22 +- .../cigar/debug_stream_cigar_test.cpp | 6 +- .../composite/alphabet_tuple_base_test.cpp | 25 +- .../alphabet_tuple_base_test_template.hpp | 4 +- .../alphabet_variant_detail_test.cpp | 32 +- .../composite/alphabet_variant_test.cpp | 95 ++-- .../composite/composite_integration_test.cpp | 500 +++++++++--------- test/unit/alphabet/quality/qualified_test.cpp | 22 +- 20 files changed, 630 insertions(+), 581 deletions(-) diff --git a/test/unit/alphabet/adaptation/char_test.cpp b/test/unit/alphabet/adaptation/char_test.cpp index ae8bc4f874..0889d3b793 100644 --- a/test/unit/alphabet/adaptation/char_test.cpp +++ b/test/unit/alphabet/adaptation/char_test.cpp @@ -16,8 +16,6 @@ #include "../semi_alphabet_constexpr_test_template.hpp" #include "../semi_alphabet_test_template.hpp" -using namespace seqan3; - using char_types = ::testing::Types; INSTANTIATE_TYPED_TEST_SUITE_P(char_adaptation, alphabet_, char_types, ); @@ -39,65 +37,75 @@ TYPED_TEST(char_adaptation, type_properties) TYPED_TEST(char_adaptation, alphabet_char_t) { - EXPECT_TRUE((std::is_same_v, TypeParam>)); - EXPECT_TRUE((std::is_same_v, TypeParam>)); - EXPECT_TRUE((std::is_same_v, TypeParam>)); + EXPECT_TRUE((std::is_same_v, TypeParam>)); + EXPECT_TRUE((std::is_same_v, TypeParam>)); + EXPECT_TRUE((std::is_same_v, TypeParam>)); } TYPED_TEST(char_adaptation, to_char) { TypeParam l{'A'}; - EXPECT_TRUE((std::is_same_v>)); - EXPECT_TRUE((std::is_same_v>)); - EXPECT_EQ(to_char(TypeParam{'A'}), l); + EXPECT_TRUE((std::is_same_v>)); + EXPECT_TRUE((std::is_same_v>)); + EXPECT_EQ(seqan3::to_char(TypeParam{'A'}), l); } TYPED_TEST(char_adaptation, assign_char_to) { TypeParam l{'A'}; - EXPECT_TRUE((std::is_same_v &>)); - EXPECT_TRUE((std::is_same_v >)); - EXPECT_EQ((assign_char_to('A', TypeParam{'C'})), l); - EXPECT_EQ((assign_char_to('C', l )), TypeParam{'C'}); + EXPECT_TRUE((std::is_same_v &>)); + EXPECT_TRUE((std::is_same_v>)); + EXPECT_EQ((seqan3::assign_char_to('A', TypeParam{'C'})), l); + EXPECT_EQ((seqan3::assign_char_to('C', l)), TypeParam{'C'}); } TYPED_TEST(char_adaptation, assign_char_strictly_to) { TypeParam l{'A'}; - EXPECT_TRUE((std::is_same_v &>)); - EXPECT_TRUE((std::is_same_v >)); - EXPECT_EQ((assign_char_strictly_to('A', TypeParam{'C'})), l); - EXPECT_EQ((assign_char_strictly_to('C', l )), TypeParam{'C'}); + EXPECT_TRUE((std::is_same_v &>)); + EXPECT_TRUE((std::is_same_v>)); + EXPECT_EQ((seqan3::assign_char_strictly_to('A', TypeParam{'C'})), l); + EXPECT_EQ((seqan3::assign_char_strictly_to('C', l)), TypeParam{'C'}); } TYPED_TEST(char_adaptation, alphabet_rank_t) { - EXPECT_TRUE((std::is_integral_v>)); - EXPECT_TRUE((std::is_unsigned_v>)); - EXPECT_GE(sizeof(alphabet_rank_t), sizeof(TypeParam)); + EXPECT_TRUE((std::is_integral_v>)); + EXPECT_TRUE((std::is_unsigned_v>)); + EXPECT_GE(sizeof(seqan3::alphabet_rank_t), sizeof(TypeParam)); } TYPED_TEST(char_adaptation, to_rank) { TypeParam l{'A'}; - EXPECT_TRUE((std::is_same_v>)); - EXPECT_TRUE((std::is_same_v>)); + EXPECT_TRUE((std::is_same_v>)); + EXPECT_TRUE((std::is_same_v>)); unsigned char cmp{'A'}; - EXPECT_EQ(to_rank(TypeParam{65}), cmp); + EXPECT_EQ(seqan3::to_rank(TypeParam{65}), cmp); } TYPED_TEST(char_adaptation, assign_rank_to) { TypeParam l{'A'}; - EXPECT_TRUE((std::is_same_v &>)); - EXPECT_TRUE((std::is_same_v >)); - EXPECT_EQ((assign_rank_to(65, TypeParam{'C'})), l); - EXPECT_EQ((assign_rank_to(67, l)), TypeParam{'C'}); + EXPECT_TRUE((std::is_same_v &>)); + EXPECT_TRUE((std::is_same_v>)); + EXPECT_EQ((seqan3::assign_rank_to(65, TypeParam{'C'})), l); + EXPECT_EQ((seqan3::assign_rank_to(67, l)), TypeParam{'C'}); } TYPED_TEST(char_adaptation, alphabet_size) { - EXPECT_EQ(alphabet_size, + EXPECT_EQ(seqan3::alphabet_size, static_cast(std::numeric_limits::max()) + 1 - std::numeric_limits::lowest()); } diff --git a/test/unit/alphabet/adaptation/uint_test.cpp b/test/unit/alphabet/adaptation/uint_test.cpp index c69af7f3b9..769b15a207 100644 --- a/test/unit/alphabet/adaptation/uint_test.cpp +++ b/test/unit/alphabet/adaptation/uint_test.cpp @@ -16,8 +16,6 @@ #include "../semi_alphabet_constexpr_test_template.hpp" #include "../semi_alphabet_test_template.hpp" -using namespace seqan3; - // uint32_t, too slow using fast_uint_types = ::testing::Types; @@ -42,70 +40,80 @@ TYPED_TEST(uint_adaptation, type_properties) TYPED_TEST(uint_adaptation, alphabet_rank_t) { - EXPECT_TRUE((std::is_same_v, TypeParam>)); - EXPECT_TRUE((std::is_same_v, TypeParam>)); - EXPECT_TRUE((std::is_same_v, TypeParam>)); + EXPECT_TRUE((std::is_same_v, TypeParam>)); + EXPECT_TRUE((std::is_same_v, TypeParam>)); + EXPECT_TRUE((std::is_same_v, TypeParam>)); } TYPED_TEST(uint_adaptation, to_rank) { TypeParam l{65}; - EXPECT_TRUE((std::is_same_v>)); - EXPECT_TRUE((std::is_same_v>)); - EXPECT_EQ(to_rank(TypeParam{65}), l); + EXPECT_TRUE((std::is_same_v>)); + EXPECT_TRUE((std::is_same_v>)); + EXPECT_EQ(seqan3::to_rank(TypeParam{65}), l); } TYPED_TEST(uint_adaptation, assign_rank) { TypeParam l{65}; - EXPECT_TRUE((std::is_same_v &>)); - EXPECT_TRUE((std::is_same_v >)); - EXPECT_EQ((assign_rank_to(65, TypeParam{65})), l); - EXPECT_EQ((assign_rank_to(67, l)), TypeParam{67}); + EXPECT_TRUE((std::is_same_v &>)); + EXPECT_TRUE((std::is_same_v>)); + EXPECT_EQ((seqan3::assign_rank_to(65, TypeParam{65})), l); + EXPECT_EQ((seqan3::assign_rank_to(67, l)), TypeParam{67}); } TYPED_TEST(uint_adaptation, alphabet_char_t) { - EXPECT_TRUE((std::is_integral_v>)); - EXPECT_GE(sizeof(alphabet_rank_t), sizeof(TypeParam)); + EXPECT_TRUE((std::is_integral_v>)); + EXPECT_GE(sizeof(seqan3::alphabet_rank_t), sizeof(TypeParam)); } TYPED_TEST(uint_adaptation, to_char) { TypeParam l{65}; - EXPECT_TRUE((std::is_same_v>)); - EXPECT_TRUE((std::is_same_v>)); + EXPECT_TRUE((std::is_same_v>)); + EXPECT_TRUE((std::is_same_v>)); if constexpr (std::is_unsigned_v) { unsigned char cmp{'A'}; - EXPECT_EQ(to_rank(TypeParam{65}), cmp); + EXPECT_EQ(seqan3::to_rank(TypeParam{65}), cmp); } else { - EXPECT_EQ(to_rank(TypeParam{65}), 'A'); + EXPECT_EQ(seqan3::to_rank(TypeParam{65}), 'A'); } } TYPED_TEST(uint_adaptation, assign_char) { TypeParam l{65}; - EXPECT_TRUE((std::is_same_v &>)); - EXPECT_TRUE((std::is_same_v >)); - EXPECT_EQ((assign_char_to('A', TypeParam{67})), l); - EXPECT_EQ((assign_char_to('C', l)), TypeParam{67}); + EXPECT_TRUE((std::is_same_v &>)); + EXPECT_TRUE((std::is_same_v>)); + EXPECT_EQ((seqan3::assign_char_to('A', TypeParam{67})), l); + EXPECT_EQ((seqan3::assign_char_to('C', l)), TypeParam{67}); } TYPED_TEST(uint_adaptation, assign_char_strictly_to) { TypeParam l{65}; - EXPECT_TRUE((std::is_same_v &>)); - EXPECT_TRUE((std::is_same_v >)); - EXPECT_EQ((assign_char_strictly_to('A', TypeParam{67})), l); - EXPECT_EQ((assign_char_strictly_to('C', l )), TypeParam{67}); + EXPECT_TRUE((std::is_same_v &>)); + EXPECT_TRUE((std::is_same_v>)); + EXPECT_EQ((seqan3::assign_char_strictly_to('A', TypeParam{67})), l); + EXPECT_EQ((seqan3::assign_char_strictly_to('C', l)), TypeParam{67}); } TYPED_TEST(uint_adaptation, alphabet_size) { - EXPECT_EQ(alphabet_size, + EXPECT_EQ(seqan3::alphabet_size, static_cast(std::numeric_limits::max()) + 1 - std::numeric_limits::lowest()); } diff --git a/test/unit/alphabet/alphabet_cereal_test.cpp b/test/unit/alphabet/alphabet_cereal_test.cpp index 961916d01d..f195423613 100644 --- a/test/unit/alphabet/alphabet_cereal_test.cpp +++ b/test/unit/alphabet/alphabet_cereal_test.cpp @@ -13,12 +13,12 @@ #include #include -using namespace seqan3; - template using alphabet_cereal = ::testing::Test; -using test_types = ::testing::Types, gapped>; +using test_types = ::testing::Types, + seqan3::gapped>; TYPED_TEST_SUITE(alphabet_cereal, test_types, ); @@ -26,12 +26,12 @@ TYPED_TEST(alphabet_cereal, serialisation) { TypeParam letter; - assign_rank_to(1 % alphabet_size, letter); - test::do_serialisation(letter); + seqan3::assign_rank_to(1 % seqan3::alphabet_size, letter); + seqan3::test::do_serialisation(letter); std::vector vec; vec.resize(10); for (unsigned i = 0; i < 10; ++i) - assign_rank_to(i % alphabet_size, vec[i]); - test::do_serialisation(vec); + seqan3::assign_rank_to(i % seqan3::alphabet_size, vec[i]); + seqan3::test::do_serialisation(vec); } diff --git a/test/unit/alphabet/alphabet_hash_test.cpp b/test/unit/alphabet/alphabet_hash_test.cpp index 9bc0b3f6b2..3f59f94ca9 100644 --- a/test/unit/alphabet/alphabet_hash_test.cpp +++ b/test/unit/alphabet/alphabet_hash_test.cpp @@ -16,7 +16,9 @@ template using alphabet_hashing = ::testing::Test; -using test_types = ::testing::Types, seqan3::gapped>; +using test_types = ::testing::Types, + seqan3::gapped>; TYPED_TEST_SUITE(alphabet_hashing, test_types, ); diff --git a/test/unit/alphabet/aminoacid/aa10li_test.cpp b/test/unit/alphabet/aminoacid/aa10li_test.cpp index 8472f2b59f..973acc8be5 100644 --- a/test/unit/alphabet/aminoacid/aa10li_test.cpp +++ b/test/unit/alphabet/aminoacid/aa10li_test.cpp @@ -16,11 +16,13 @@ #include #include -INSTANTIATE_TYPED_TEST_SUITE_P(aa10li, alphabet_, aa10li, ); -INSTANTIATE_TYPED_TEST_SUITE_P(aa10li, semi_alphabet_test, aa10li, ); -INSTANTIATE_TYPED_TEST_SUITE_P(aa10li, alphabet_constexpr, aa10li, ); -INSTANTIATE_TYPED_TEST_SUITE_P(aa10li, semi_alphabet_constexpr, aa10li, ); -INSTANTIATE_TYPED_TEST_SUITE_P(aa10li, aminoacid, aa10li, ); +using seqan3::operator""_aa10li; + +INSTANTIATE_TYPED_TEST_SUITE_P(aa10li, alphabet_, seqan3::aa10li, ); +INSTANTIATE_TYPED_TEST_SUITE_P(aa10li, semi_alphabet_test, seqan3::aa10li, ); +INSTANTIATE_TYPED_TEST_SUITE_P(aa10li, alphabet_constexpr, seqan3::aa10li, ); +INSTANTIATE_TYPED_TEST_SUITE_P(aa10li, semi_alphabet_constexpr, seqan3::aa10li, ); +INSTANTIATE_TYPED_TEST_SUITE_P(aa10li, aminoacid, seqan3::aa10li, ); TEST(aa10li, assign_char) { @@ -33,7 +35,7 @@ TEST(aa10li, assign_char) '*', '!' }; - std::vector alphabets + std::vector alphabets { 'A'_aa10li, 'B'_aa10li, 'C'_aa10li, 'B'_aa10li, 'B'_aa10li, 'F'_aa10li, 'G'_aa10li, 'H'_aa10li, 'I'_aa10li, 'J'_aa10li, 'K'_aa10li, 'J'_aa10li, 'J'_aa10li, @@ -46,8 +48,8 @@ TEST(aa10li, assign_char) 'F'_aa10li, 'A'_aa10li }; - for (auto [ chr, alp ] : views::zip(chars, alphabets)) - EXPECT_EQ((assign_char_to(chr, aa10li{})), alp); + for (auto [ chr, alp ] : seqan3::views::zip(chars, alphabets)) + EXPECT_EQ((seqan3::assign_char_to(chr, seqan3::aa10li{})), alp); } TEST(aa10li, to_char) @@ -58,7 +60,7 @@ TEST(aa10li, to_char) 'B', 'K', 'A', 'A', 'I', 'F', 'F', 'B', 'J', 'K', 'C', 'A', 'B' }; - std::vector alphabets + std::vector alphabets { 'A'_aa10li, 'C'_aa10li, 'D'_aa10li, 'E'_aa10li, 'F'_aa10li, 'G'_aa10li, 'H'_aa10li, 'I'_aa10li, 'K'_aa10li, 'L'_aa10li, 'M'_aa10li, 'N'_aa10li, 'P'_aa10li, @@ -66,8 +68,8 @@ TEST(aa10li, to_char) 'B'_aa10li, 'J'_aa10li, 'O'_aa10li, 'U'_aa10li, 'X'_aa10li, 'Z'_aa10li }; - for (auto [ chr, alp ] : views::zip(chars, alphabets)) - EXPECT_EQ(to_char(alp), chr); + for (auto [ chr, alp ] : seqan3::views::zip(chars, alphabets)) + EXPECT_EQ(seqan3::to_char(alp), chr); } // ------------------------------------------------------------------ @@ -76,35 +78,35 @@ TEST(aa10li, to_char) TEST(literals, char_literal) { - EXPECT_EQ(to_char('A'_aa10li), 'A'); - EXPECT_EQ(to_char('B'_aa10li), 'B'); - EXPECT_EQ(to_char('C'_aa10li), 'C'); - EXPECT_EQ(to_char('F'_aa10li), 'F'); - EXPECT_EQ(to_char('G'_aa10li), 'G'); - EXPECT_EQ(to_char('H'_aa10li), 'H'); - EXPECT_EQ(to_char('I'_aa10li), 'I'); - EXPECT_EQ(to_char('J'_aa10li), 'J'); - EXPECT_EQ(to_char('K'_aa10li), 'K'); - EXPECT_EQ(to_char('P'_aa10li), 'P'); - - EXPECT_EQ(to_char('*'_aa10li), 'F'); - EXPECT_EQ(to_char('!'_aa10li), 'A'); + EXPECT_EQ(seqan3::to_char('A'_aa10li), 'A'); + EXPECT_EQ(seqan3::to_char('B'_aa10li), 'B'); + EXPECT_EQ(seqan3::to_char('C'_aa10li), 'C'); + EXPECT_EQ(seqan3::to_char('F'_aa10li), 'F'); + EXPECT_EQ(seqan3::to_char('G'_aa10li), 'G'); + EXPECT_EQ(seqan3::to_char('H'_aa10li), 'H'); + EXPECT_EQ(seqan3::to_char('I'_aa10li), 'I'); + EXPECT_EQ(seqan3::to_char('J'_aa10li), 'J'); + EXPECT_EQ(seqan3::to_char('K'_aa10li), 'K'); + EXPECT_EQ(seqan3::to_char('P'_aa10li), 'P'); + + EXPECT_EQ(seqan3::to_char('*'_aa10li), 'F'); + EXPECT_EQ(seqan3::to_char('!'_aa10li), 'A'); } TEST(literals, vector) { - aa10li_vector v20; + seqan3::aa10li_vector v20; v20.resize(5, 'D'_aa10li); EXPECT_EQ(v20, "BBBBB"_aa10li); - std::vector w20{'A'_aa10li, 'D'_aa10li, 'N'_aa10li, 'O'_aa10li, 'U'_aa10li, 'X'_aa10li, 'R'_aa10li, '!'_aa10li, - '*'_aa10li, '*'_aa10li}; + std::vector w20{'A'_aa10li, 'D'_aa10li, 'N'_aa10li, 'O'_aa10li, 'U'_aa10li, 'X'_aa10li, 'R'_aa10li, + '!'_aa10li, '*'_aa10li, '*'_aa10li}; EXPECT_EQ(w20, "ABHKCAKAF*"_aa10li); } TEST(aa10li, char_is_valid) { - constexpr auto aa27_validator = (is_alpha || is_char<'*'>); + constexpr auto aa27_validator = (seqan3::is_alpha || seqan3::is_char<'*'>); for (char c : std::views::iota(std::numeric_limits::min(), std::numeric_limits::max())) { @@ -124,6 +126,6 @@ TEST(aa10li, char_is_valid) break; } - EXPECT_EQ(aa10li::char_is_valid(c), expect); + EXPECT_EQ(seqan3::aa10li::char_is_valid(c), expect); } } diff --git a/test/unit/alphabet/aminoacid/aa10murphy_test.cpp b/test/unit/alphabet/aminoacid/aa10murphy_test.cpp index 0a2250ed38..e54ab62960 100644 --- a/test/unit/alphabet/aminoacid/aa10murphy_test.cpp +++ b/test/unit/alphabet/aminoacid/aa10murphy_test.cpp @@ -16,11 +16,13 @@ #include #include -INSTANTIATE_TYPED_TEST_SUITE_P(aa10murphy, alphabet_, aa10murphy, ); -INSTANTIATE_TYPED_TEST_SUITE_P(aa10murphy, semi_alphabet_test, aa10murphy, ); -INSTANTIATE_TYPED_TEST_SUITE_P(aa10murphy, alphabet_constexpr, aa10murphy, ); -INSTANTIATE_TYPED_TEST_SUITE_P(aa10murphy, semi_alphabet_constexpr, aa10murphy, ); -INSTANTIATE_TYPED_TEST_SUITE_P(aa10murphy, aminoacid, aa10murphy, ); +using seqan3::operator""_aa10murphy; + +INSTANTIATE_TYPED_TEST_SUITE_P(aa10murphy, alphabet_, seqan3::aa10murphy, ); +INSTANTIATE_TYPED_TEST_SUITE_P(aa10murphy, semi_alphabet_test, seqan3::aa10murphy, ); +INSTANTIATE_TYPED_TEST_SUITE_P(aa10murphy, alphabet_constexpr, seqan3::aa10murphy, ); +INSTANTIATE_TYPED_TEST_SUITE_P(aa10murphy, semi_alphabet_constexpr, seqan3::aa10murphy, ); +INSTANTIATE_TYPED_TEST_SUITE_P(aa10murphy, aminoacid, seqan3::aa10murphy, ); TEST(aa10murphy, assign_char) { @@ -33,7 +35,7 @@ TEST(aa10murphy, assign_char) '*', '!' }; - std::vector alphabets + std::vector alphabets { 'A'_aa10murphy, 'B'_aa10murphy, 'C'_aa10murphy, 'B'_aa10murphy, 'B'_aa10murphy, 'F'_aa10murphy, 'G'_aa10murphy, 'H'_aa10murphy, 'I'_aa10murphy, 'I'_aa10murphy, 'K'_aa10murphy, 'I'_aa10murphy, 'I'_aa10murphy, @@ -46,8 +48,8 @@ TEST(aa10murphy, assign_char) 'F'_aa10murphy, 'S'_aa10murphy }; - for (auto [ chr, alp ] : views::zip(chars, alphabets)) - EXPECT_EQ((assign_char_to(chr, aa10murphy{})), alp); + for (auto [ chr, alp ] : seqan3::views::zip(chars, alphabets)) + EXPECT_EQ((seqan3::assign_char_to(chr, seqan3::aa10murphy{})), alp); } TEST(aa10murphy, to_char) @@ -58,7 +60,7 @@ TEST(aa10murphy, to_char) 'B', 'K', 'S', 'S', 'I', 'F', 'F', 'B', 'I', 'K', 'C', 'S', 'B' }; - std::vector alphabets + std::vector alphabets { 'A'_aa10murphy, 'C'_aa10murphy, 'D'_aa10murphy, 'E'_aa10murphy, 'F'_aa10murphy, 'G'_aa10murphy, 'H'_aa10murphy, 'I'_aa10murphy, 'K'_aa10murphy, 'L'_aa10murphy, 'M'_aa10murphy, 'N'_aa10murphy, 'P'_aa10murphy, @@ -66,8 +68,8 @@ TEST(aa10murphy, to_char) 'B'_aa10murphy, 'J'_aa10murphy, 'O'_aa10murphy, 'U'_aa10murphy, 'X'_aa10murphy, 'Z'_aa10murphy }; - for (auto [ chr, alp ] : views::zip(chars, alphabets)) - EXPECT_EQ(to_char(alp), chr); + for (auto [ chr, alp ] : seqan3::views::zip(chars, alphabets)) + EXPECT_EQ(seqan3::to_char(alp), chr); } // ------------------------------------------------------------------ @@ -76,35 +78,35 @@ TEST(aa10murphy, to_char) TEST(literals, char_literal) { - EXPECT_EQ(to_char('A'_aa10murphy), 'A'); - EXPECT_EQ(to_char('B'_aa10murphy), 'B'); - EXPECT_EQ(to_char('C'_aa10murphy), 'C'); - EXPECT_EQ(to_char('F'_aa10murphy), 'F'); - EXPECT_EQ(to_char('G'_aa10murphy), 'G'); - EXPECT_EQ(to_char('H'_aa10murphy), 'H'); - EXPECT_EQ(to_char('I'_aa10murphy), 'I'); - EXPECT_EQ(to_char('K'_aa10murphy), 'K'); - EXPECT_EQ(to_char('P'_aa10murphy), 'P'); - EXPECT_EQ(to_char('S'_aa10murphy), 'S'); - - EXPECT_EQ(to_char('*'_aa10murphy), 'F'); - EXPECT_EQ(to_char('!'_aa10murphy), 'S'); + EXPECT_EQ(seqan3::to_char('A'_aa10murphy), 'A'); + EXPECT_EQ(seqan3::to_char('B'_aa10murphy), 'B'); + EXPECT_EQ(seqan3::to_char('C'_aa10murphy), 'C'); + EXPECT_EQ(seqan3::to_char('F'_aa10murphy), 'F'); + EXPECT_EQ(seqan3::to_char('G'_aa10murphy), 'G'); + EXPECT_EQ(seqan3::to_char('H'_aa10murphy), 'H'); + EXPECT_EQ(seqan3::to_char('I'_aa10murphy), 'I'); + EXPECT_EQ(seqan3::to_char('K'_aa10murphy), 'K'); + EXPECT_EQ(seqan3::to_char('P'_aa10murphy), 'P'); + EXPECT_EQ(seqan3::to_char('S'_aa10murphy), 'S'); + + EXPECT_EQ(seqan3::to_char('*'_aa10murphy), 'F'); + EXPECT_EQ(seqan3::to_char('!'_aa10murphy), 'S'); } TEST(literals, vector) { - aa10murphy_vector v20; + seqan3::aa10murphy_vector v20; v20.resize(5, 'D'_aa10murphy); EXPECT_EQ(v20, "BBBBB"_aa10murphy); - std::vector w20{'A'_aa10murphy, 'D'_aa10murphy, 'J'_aa10murphy, 'O'_aa10murphy, 'U'_aa10murphy, 'X'_aa10murphy, 'R'_aa10murphy, '!'_aa10murphy, - '*'_aa10murphy, '*'_aa10murphy}; + std::vector w20{'A'_aa10murphy, 'D'_aa10murphy, 'J'_aa10murphy, 'O'_aa10murphy, 'U'_aa10murphy, + 'X'_aa10murphy, 'R'_aa10murphy, '!'_aa10murphy, '*'_aa10murphy, '*'_aa10murphy}; EXPECT_EQ(w20, "ABIKCSKSF*"_aa10murphy); } TEST(aa10murphy, char_is_valid) { - constexpr auto aa27_validator = (is_alpha || is_char<'*'>); + constexpr auto aa27_validator = (seqan3::is_alpha || seqan3::is_char<'*'>); for (char c : std::views::iota(std::numeric_limits::min(), std::numeric_limits::max())) { @@ -124,6 +126,6 @@ TEST(aa10murphy, char_is_valid) break; } - EXPECT_EQ(aa10murphy::char_is_valid(c), expect); + EXPECT_EQ(seqan3::aa10murphy::char_is_valid(c), expect); } } diff --git a/test/unit/alphabet/aminoacid/aa20_test.cpp b/test/unit/alphabet/aminoacid/aa20_test.cpp index c9dcc68dbe..77f7f98674 100644 --- a/test/unit/alphabet/aminoacid/aa20_test.cpp +++ b/test/unit/alphabet/aminoacid/aa20_test.cpp @@ -16,11 +16,13 @@ #include #include -INSTANTIATE_TYPED_TEST_SUITE_P(aa20, alphabet_, aa20, ); -INSTANTIATE_TYPED_TEST_SUITE_P(aa20, semi_alphabet_test, aa20, ); -INSTANTIATE_TYPED_TEST_SUITE_P(aa20, alphabet_constexpr, aa20, ); -INSTANTIATE_TYPED_TEST_SUITE_P(aa20, semi_alphabet_constexpr, aa20, ); -INSTANTIATE_TYPED_TEST_SUITE_P(aa20, aminoacid, aa20, ); +using seqan3::operator""_aa20; + +INSTANTIATE_TYPED_TEST_SUITE_P(aa20, alphabet_, seqan3::aa20, ); +INSTANTIATE_TYPED_TEST_SUITE_P(aa20, semi_alphabet_test, seqan3::aa20, ); +INSTANTIATE_TYPED_TEST_SUITE_P(aa20, alphabet_constexpr, seqan3::aa20, ); +INSTANTIATE_TYPED_TEST_SUITE_P(aa20, semi_alphabet_constexpr, seqan3::aa20, ); +INSTANTIATE_TYPED_TEST_SUITE_P(aa20, aminoacid, seqan3::aa20, ); TEST(aa20, assign_char) { @@ -33,7 +35,7 @@ TEST(aa20, assign_char) '*', '!' }; - std::vector alphabets + std::vector alphabets { 'A'_aa20, 'D'_aa20, 'C'_aa20, 'D'_aa20, 'E'_aa20, 'F'_aa20, 'G'_aa20, 'H'_aa20, 'I'_aa20, 'L'_aa20, 'K'_aa20, 'L'_aa20, 'M'_aa20, @@ -46,8 +48,8 @@ TEST(aa20, assign_char) 'W'_aa20, 'S'_aa20 }; - for (auto [ chr, alp ] : views::zip(chars, alphabets)) - EXPECT_EQ((assign_char_to(chr, aa20{})), alp); + for (auto [ chr, alp ] : seqan3::views::zip(chars, alphabets)) + EXPECT_EQ((seqan3::assign_char_to(chr, seqan3::aa20{})), alp); } TEST(aa20, to_char) @@ -59,7 +61,7 @@ TEST(aa20, to_char) 'W', 'S' }; - std::vector alphabets + std::vector alphabets { 'A'_aa20, 'C'_aa20, 'D'_aa20, 'E'_aa20, 'F'_aa20, 'G'_aa20, 'H'_aa20, 'I'_aa20, 'K'_aa20, 'L'_aa20, 'M'_aa20, 'N'_aa20, 'P'_aa20, @@ -68,8 +70,8 @@ TEST(aa20, to_char) 'W'_aa20, 'S'_aa20 }; - for (auto [ chr, alp ] : views::zip(chars, alphabets)) - EXPECT_EQ(to_char(alp), chr); + for (auto [ chr, alp ] : seqan3::views::zip(chars, alphabets)) + EXPECT_EQ(seqan3::to_char(alp), chr); } // ------------------------------------------------------------------ @@ -78,45 +80,45 @@ TEST(aa20, to_char) TEST(literals, char_literal) { - EXPECT_EQ(to_char('A'_aa20), 'A'); - EXPECT_EQ(to_char('C'_aa20), 'C'); - EXPECT_EQ(to_char('D'_aa20), 'D'); - EXPECT_EQ(to_char('E'_aa20), 'E'); - EXPECT_EQ(to_char('F'_aa20), 'F'); - EXPECT_EQ(to_char('G'_aa20), 'G'); - EXPECT_EQ(to_char('H'_aa20), 'H'); - EXPECT_EQ(to_char('I'_aa20), 'I'); - EXPECT_EQ(to_char('K'_aa20), 'K'); - EXPECT_EQ(to_char('L'_aa20), 'L'); - EXPECT_EQ(to_char('M'_aa20), 'M'); - EXPECT_EQ(to_char('N'_aa20), 'N'); - EXPECT_EQ(to_char('P'_aa20), 'P'); - EXPECT_EQ(to_char('Q'_aa20), 'Q'); - EXPECT_EQ(to_char('R'_aa20), 'R'); - EXPECT_EQ(to_char('S'_aa20), 'S'); - EXPECT_EQ(to_char('T'_aa20), 'T'); - EXPECT_EQ(to_char('V'_aa20), 'V'); - EXPECT_EQ(to_char('W'_aa20), 'W'); - EXPECT_EQ(to_char('Y'_aa20), 'Y'); - - EXPECT_EQ(to_char('*'_aa20), 'W'); - EXPECT_EQ(to_char('!'_aa20), 'S'); + EXPECT_EQ(seqan3::to_char('A'_aa20), 'A'); + EXPECT_EQ(seqan3::to_char('C'_aa20), 'C'); + EXPECT_EQ(seqan3::to_char('D'_aa20), 'D'); + EXPECT_EQ(seqan3::to_char('E'_aa20), 'E'); + EXPECT_EQ(seqan3::to_char('F'_aa20), 'F'); + EXPECT_EQ(seqan3::to_char('G'_aa20), 'G'); + EXPECT_EQ(seqan3::to_char('H'_aa20), 'H'); + EXPECT_EQ(seqan3::to_char('I'_aa20), 'I'); + EXPECT_EQ(seqan3::to_char('K'_aa20), 'K'); + EXPECT_EQ(seqan3::to_char('L'_aa20), 'L'); + EXPECT_EQ(seqan3::to_char('M'_aa20), 'M'); + EXPECT_EQ(seqan3::to_char('N'_aa20), 'N'); + EXPECT_EQ(seqan3::to_char('P'_aa20), 'P'); + EXPECT_EQ(seqan3::to_char('Q'_aa20), 'Q'); + EXPECT_EQ(seqan3::to_char('R'_aa20), 'R'); + EXPECT_EQ(seqan3::to_char('S'_aa20), 'S'); + EXPECT_EQ(seqan3::to_char('T'_aa20), 'T'); + EXPECT_EQ(seqan3::to_char('V'_aa20), 'V'); + EXPECT_EQ(seqan3::to_char('W'_aa20), 'W'); + EXPECT_EQ(seqan3::to_char('Y'_aa20), 'Y'); + + EXPECT_EQ(seqan3::to_char('*'_aa20), 'W'); + EXPECT_EQ(seqan3::to_char('!'_aa20), 'S'); } TEST(literals, vector) { - aa20_vector v20; + seqan3::aa20_vector v20; v20.resize(5, 'B'_aa20); EXPECT_EQ(v20, "DDDDD"_aa20); - std::vector w20{'A'_aa20, 'B'_aa20, 'J'_aa20, 'O'_aa20, 'U'_aa20, 'X'_aa20, 'Z'_aa20, '!'_aa20, - '*'_aa20, '*'_aa20}; + std::vector w20{'A'_aa20, 'B'_aa20, 'J'_aa20, 'O'_aa20, 'U'_aa20, 'X'_aa20, 'Z'_aa20, '!'_aa20, + '*'_aa20, '*'_aa20}; EXPECT_EQ(w20, "ADLLCSESW*"_aa20); } TEST(aa20, char_is_valid) { - constexpr auto aa27_validator = (is_alpha || is_char<'*'>); + constexpr auto aa27_validator = (seqan3::is_alpha || seqan3::is_char<'*'>); for (char c : std::views::iota(std::numeric_limits::min(), std::numeric_limits::max())) { @@ -132,6 +134,6 @@ TEST(aa20, char_is_valid) break; } - EXPECT_EQ(aa20::char_is_valid(c), expect); + EXPECT_EQ(seqan3::aa20::char_is_valid(c), expect); } } diff --git a/test/unit/alphabet/aminoacid/aa27_test.cpp b/test/unit/alphabet/aminoacid/aa27_test.cpp index 22c2b74937..25812807c1 100644 --- a/test/unit/alphabet/aminoacid/aa27_test.cpp +++ b/test/unit/alphabet/aminoacid/aa27_test.cpp @@ -14,11 +14,13 @@ #include #include -INSTANTIATE_TYPED_TEST_SUITE_P(aa27, alphabet_, aa27, ); -INSTANTIATE_TYPED_TEST_SUITE_P(aa27, semi_alphabet_test, aa27, ); -INSTANTIATE_TYPED_TEST_SUITE_P(aa27, alphabet_constexpr, aa27, ); -INSTANTIATE_TYPED_TEST_SUITE_P(aa27, semi_alphabet_constexpr, aa27, ); -INSTANTIATE_TYPED_TEST_SUITE_P(aa27, aminoacid, aa27, ); +using seqan3::operator""_aa27; + +INSTANTIATE_TYPED_TEST_SUITE_P(aa27, alphabet_, seqan3::aa27, ); +INSTANTIATE_TYPED_TEST_SUITE_P(aa27, semi_alphabet_test, seqan3::aa27, ); +INSTANTIATE_TYPED_TEST_SUITE_P(aa27, alphabet_constexpr, seqan3::aa27, ); +INSTANTIATE_TYPED_TEST_SUITE_P(aa27, semi_alphabet_constexpr, seqan3::aa27, ); +INSTANTIATE_TYPED_TEST_SUITE_P(aa27, aminoacid, seqan3::aa27, ); TEST(aa27, assign_char) { @@ -31,7 +33,7 @@ TEST(aa27, assign_char) '*', '!' }; - std::vector alphabets + std::vector alphabets { 'A'_aa27, 'B'_aa27, 'C'_aa27, 'D'_aa27, 'E'_aa27, 'F'_aa27, 'G'_aa27, 'H'_aa27, 'I'_aa27, 'J'_aa27, 'K'_aa27, 'L'_aa27, 'M'_aa27, @@ -44,8 +46,8 @@ TEST(aa27, assign_char) '*'_aa27, 'X'_aa27 }; - for (auto [ chr, alp ] : views::zip(chars, alphabets)) - EXPECT_EQ((assign_char_to(chr, aa27{})), alp); + for (auto [ chr, alp ] : seqan3::views::zip(chars, alphabets)) + EXPECT_EQ((seqan3::assign_char_to(chr, seqan3::aa27{})), alp); } TEST(aa27, to_char) @@ -57,7 +59,7 @@ TEST(aa27, to_char) '*', 'X' }; - std::vector alphabets + std::vector alphabets { 'A'_aa27, 'C'_aa27, 'D'_aa27, 'E'_aa27, 'F'_aa27, 'G'_aa27, 'H'_aa27, 'I'_aa27, 'K'_aa27, 'L'_aa27, 'M'_aa27, 'N'_aa27, 'P'_aa27, @@ -66,8 +68,8 @@ TEST(aa27, to_char) '*'_aa27, 'X'_aa27 }; - for (auto [ alp, chr ] : views::zip(alphabets, chars)) - EXPECT_EQ(to_char(alp), chr); + for (auto [ alp, chr ] : seqan3::views::zip(alphabets, chars)) + EXPECT_EQ(seqan3::to_char(alp), chr); } // ------------------------------------------------------------------ @@ -76,50 +78,51 @@ TEST(aa27, to_char) TEST(literals, char_literal) { - EXPECT_EQ(to_char('A'_aa27), 'A'); - EXPECT_EQ(to_char('B'_aa27), 'B'); - EXPECT_EQ(to_char('C'_aa27), 'C'); - EXPECT_EQ(to_char('D'_aa27), 'D'); - EXPECT_EQ(to_char('E'_aa27), 'E'); - EXPECT_EQ(to_char('F'_aa27), 'F'); - EXPECT_EQ(to_char('G'_aa27), 'G'); - EXPECT_EQ(to_char('H'_aa27), 'H'); - EXPECT_EQ(to_char('I'_aa27), 'I'); - EXPECT_EQ(to_char('J'_aa27), 'J'); - EXPECT_EQ(to_char('K'_aa27), 'K'); - EXPECT_EQ(to_char('L'_aa27), 'L'); - EXPECT_EQ(to_char('M'_aa27), 'M'); - EXPECT_EQ(to_char('N'_aa27), 'N'); - EXPECT_EQ(to_char('O'_aa27), 'O'); - EXPECT_EQ(to_char('P'_aa27), 'P'); - EXPECT_EQ(to_char('Q'_aa27), 'Q'); - EXPECT_EQ(to_char('R'_aa27), 'R'); - EXPECT_EQ(to_char('S'_aa27), 'S'); - EXPECT_EQ(to_char('T'_aa27), 'T'); - EXPECT_EQ(to_char('U'_aa27), 'U'); - EXPECT_EQ(to_char('V'_aa27), 'V'); - EXPECT_EQ(to_char('W'_aa27), 'W'); - EXPECT_EQ(to_char('X'_aa27), 'X'); - EXPECT_EQ(to_char('Y'_aa27), 'Y'); - EXPECT_EQ(to_char('Z'_aa27), 'Z'); - EXPECT_EQ(to_char('*'_aa27), '*'); - - EXPECT_EQ(to_char('!'_aa27), 'X'); + EXPECT_EQ(seqan3::to_char('A'_aa27), 'A'); + EXPECT_EQ(seqan3::to_char('B'_aa27), 'B'); + EXPECT_EQ(seqan3::to_char('C'_aa27), 'C'); + EXPECT_EQ(seqan3::to_char('D'_aa27), 'D'); + EXPECT_EQ(seqan3::to_char('E'_aa27), 'E'); + EXPECT_EQ(seqan3::to_char('F'_aa27), 'F'); + EXPECT_EQ(seqan3::to_char('G'_aa27), 'G'); + EXPECT_EQ(seqan3::to_char('H'_aa27), 'H'); + EXPECT_EQ(seqan3::to_char('I'_aa27), 'I'); + EXPECT_EQ(seqan3::to_char('J'_aa27), 'J'); + EXPECT_EQ(seqan3::to_char('K'_aa27), 'K'); + EXPECT_EQ(seqan3::to_char('L'_aa27), 'L'); + EXPECT_EQ(seqan3::to_char('M'_aa27), 'M'); + EXPECT_EQ(seqan3::to_char('N'_aa27), 'N'); + EXPECT_EQ(seqan3::to_char('O'_aa27), 'O'); + EXPECT_EQ(seqan3::to_char('P'_aa27), 'P'); + EXPECT_EQ(seqan3::to_char('Q'_aa27), 'Q'); + EXPECT_EQ(seqan3::to_char('R'_aa27), 'R'); + EXPECT_EQ(seqan3::to_char('S'_aa27), 'S'); + EXPECT_EQ(seqan3::to_char('T'_aa27), 'T'); + EXPECT_EQ(seqan3::to_char('U'_aa27), 'U'); + EXPECT_EQ(seqan3::to_char('V'_aa27), 'V'); + EXPECT_EQ(seqan3::to_char('W'_aa27), 'W'); + EXPECT_EQ(seqan3::to_char('X'_aa27), 'X'); + EXPECT_EQ(seqan3::to_char('Y'_aa27), 'Y'); + EXPECT_EQ(seqan3::to_char('Z'_aa27), 'Z'); + EXPECT_EQ(seqan3::to_char('*'_aa27), '*'); + + EXPECT_EQ(seqan3::to_char('!'_aa27), 'X'); } TEST(literals, vector) { - aa27_vector v27; + seqan3::aa27_vector v27; v27.resize(5, 'A'_aa27); EXPECT_EQ(v27, "AAAAA"_aa27); - std::vector w27{'A'_aa27, 'Y'_aa27, 'P'_aa27, 'T'_aa27, 'U'_aa27, 'N'_aa27, 'X'_aa27, '!'_aa27, '*'_aa27}; + std::vector w27{'A'_aa27, 'Y'_aa27, 'P'_aa27, 'T'_aa27, 'U'_aa27, 'N'_aa27, 'X'_aa27, '!'_aa27, + '*'_aa27}; EXPECT_EQ(w27, "AYPTUNXX*"_aa27); } TEST(aa27, char_is_valid) { - constexpr auto validator = is_alpha || is_char<'*'>; + constexpr auto validator = seqan3::is_alpha || seqan3::is_char<'*'>; for (char c : std::views::iota(std::numeric_limits::min(), std::numeric_limits::max())) - EXPECT_EQ(aa27::char_is_valid(c), validator(c)); + EXPECT_EQ(seqan3::aa27::char_is_valid(c), validator(c)); } diff --git a/test/unit/alphabet/aminoacid/aminoacid_conversion_integration_test.cpp b/test/unit/alphabet/aminoacid/aminoacid_conversion_integration_test.cpp index a4def24de5..a9f1c12e54 100644 --- a/test/unit/alphabet/aminoacid/aminoacid_conversion_integration_test.cpp +++ b/test/unit/alphabet/aminoacid/aminoacid_conversion_integration_test.cpp @@ -13,20 +13,18 @@ #include #include -using namespace seqan3; - template using aminoacid_conversion = ::testing::Test; -using aminoacid_types = type_list; // needed for some tests -using aminoacid_gtest_types = detail::transfer_template_args_onto_t; +using aminoacid_types = seqan3::type_list; +using aminoacid_gtest_types = seqan3::detail::transfer_template_args_onto_t; TYPED_TEST_SUITE(aminoacid_conversion, aminoacid_gtest_types, ); // conversion to any other amino acid type TYPED_TEST(aminoacid_conversion, explicit_conversion) { - detail::for_each([&] (auto aa) constexpr + seqan3::detail::for_each([&] (auto aa) constexpr { using out_type = std::decay_t; EXPECT_EQ(static_cast(TypeParam{}.assign_char('A')), out_type{}.assign_char('A')); @@ -38,7 +36,7 @@ TYPED_TEST(aminoacid_conversion, explicit_conversion) EXPECT_EQ(static_cast(TypeParam{}.assign_char('K')), out_type{}.assign_char('K')); EXPECT_EQ(static_cast(TypeParam{}.assign_char('P')), out_type{}.assign_char('P')); - if (std::is_same_v) + if (std::is_same_v) { EXPECT_EQ(static_cast(TypeParam{}.assign_char('D')), out_type{}.assign_char('D')); EXPECT_EQ(static_cast(TypeParam{}.assign_char('E')), out_type{}.assign_char('E')); @@ -61,7 +59,7 @@ TYPED_TEST(aminoacid_conversion, explicit_conversion) EXPECT_EQ(static_cast(TypeParam{}.assign_char('*')), out_type{}.assign_char('*')); EXPECT_EQ(static_cast(TypeParam{}.assign_char('!')), out_type{}.assign_char('!')); } - else if (std::is_same_v) + else if (std::is_same_v) { EXPECT_EQ(static_cast(TypeParam{}.assign_char('D')), out_type{}.assign_char('D')); EXPECT_EQ(static_cast(TypeParam{}.assign_char('E')), out_type{}.assign_char('E')); @@ -84,7 +82,7 @@ TYPED_TEST(aminoacid_conversion, explicit_conversion) EXPECT_EQ(static_cast(TypeParam{}.assign_char('*')), out_type{}.assign_char('W')); EXPECT_EQ(static_cast(TypeParam{}.assign_char('!')), out_type{}.assign_char('S')); } - else if (std::is_same_v) + else if (std::is_same_v) { EXPECT_EQ(static_cast(TypeParam{}.assign_char('D')), out_type{}.assign_char('B')); EXPECT_EQ(static_cast(TypeParam{}.assign_char('E')), out_type{}.assign_char('B')); @@ -106,7 +104,7 @@ TYPED_TEST(aminoacid_conversion, explicit_conversion) EXPECT_EQ(static_cast(TypeParam{}.assign_char('*')), out_type{}.assign_char('F')); EXPECT_EQ(static_cast(TypeParam{}.assign_char('!')), out_type{}.assign_char('S')); } - else if (std::is_same_v) + else if (std::is_same_v) { EXPECT_EQ(static_cast(TypeParam{}.assign_char('D')), out_type{}.assign_char('B')); EXPECT_EQ(static_cast(TypeParam{}.assign_char('E')), out_type{}.assign_char('B')); diff --git a/test/unit/alphabet/aminoacid/aminoacid_test_template.hpp b/test/unit/alphabet/aminoacid/aminoacid_test_template.hpp index d78aea30a0..f6d85e0807 100644 --- a/test/unit/alphabet/aminoacid/aminoacid_test_template.hpp +++ b/test/unit/alphabet/aminoacid/aminoacid_test_template.hpp @@ -13,8 +13,6 @@ #include #include -using namespace seqan3; - template using aminoacid = ::testing::Test; @@ -22,10 +20,10 @@ TYPED_TEST_SUITE_P(aminoacid); TYPED_TEST_P(aminoacid, concept_check) { - EXPECT_TRUE(aminoacid_alphabet); - EXPECT_TRUE(aminoacid_alphabet); - EXPECT_TRUE(aminoacid_alphabet); - EXPECT_TRUE(aminoacid_alphabet); + EXPECT_TRUE(seqan3::aminoacid_alphabet); + EXPECT_TRUE(seqan3::aminoacid_alphabet); + EXPECT_TRUE(seqan3::aminoacid_alphabet); + EXPECT_TRUE(seqan3::aminoacid_alphabet); } // ------------------------------------------------------------------ diff --git a/test/unit/alphabet/aminoacid/aminoacid_translation_test.cpp b/test/unit/alphabet/aminoacid/aminoacid_translation_test.cpp index 0334f15ea4..96e8e03b89 100644 --- a/test/unit/alphabet/aminoacid/aminoacid_translation_test.cpp +++ b/test/unit/alphabet/aminoacid/aminoacid_translation_test.cpp @@ -17,43 +17,45 @@ #include #include -using namespace seqan3; +using seqan3::operator""_aa27; +using seqan3::operator""_dna4; +using seqan3::operator""_dna15; TEST(translate_triplets, dna4) { - dna4 n1{'C'_dna4}; - dna4 n2{'T'_dna4}; - dna4 n3{'A'_dna4}; - aa27 c{'L'_aa27}; + seqan3::dna4 n1{'C'_dna4}; + seqan3::dna4 n2{'T'_dna4}; + seqan3::dna4 n3{'A'_dna4}; + seqan3::aa27 c{'L'_aa27}; - aa27 t1{translate_triplet(n1, n2, n3)}; + seqan3::aa27 t1{seqan3::translate_triplet(n1, n2, n3)}; EXPECT_EQ(t1, c); } TEST(translate_triplets, dna15) { - dna15 n1{'C'_dna15}; - dna15 n2{'T'_dna15}; - dna15 n3{'A'_dna15}; - aa27 c{'L'_aa27}; + seqan3::dna15 n1{'C'_dna15}; + seqan3::dna15 n2{'T'_dna15}; + seqan3::dna15 n3{'A'_dna15}; + seqan3::aa27 c{'L'_aa27}; - aa27 t1{translate_triplet(n1, n2, n3)}; + seqan3::aa27 t1{seqan3::translate_triplet(n1, n2, n3)}; EXPECT_EQ(t1, c); } TEST(translate_triplets, random_access_range) { - dna15 n1{'C'_dna15}; - dna15 n2{'T'_dna15}; - dna15 n3{'A'_dna15}; - aa27 c{'L'_aa27}; + seqan3::dna15 n1{'C'_dna15}; + seqan3::dna15 n2{'T'_dna15}; + seqan3::dna15 n3{'A'_dna15}; + seqan3::aa27 c{'L'_aa27}; auto range_triplet = ranges::view::concat(std::views::single(n1), std::views::single(n2), std::views::single(n3)); #pragma GCC diagnostic ignored "-Wdeprecated-declarations" - aa27 t2{translate_triplet(range_triplet)}; + seqan3::aa27 t2{seqan3::translate_triplet(range_triplet)}; EXPECT_TRUE(std::ranges::random_access_range); EXPECT_EQ(t2, c); @@ -61,14 +63,14 @@ TEST(translate_triplets, random_access_range) TEST(translate_triplets, tuple) { - dna15 n1{'C'_dna15}; - dna15 n2{'T'_dna15}; - dna15 n3{'A'_dna15}; - aa27 c{'L'_aa27}; + seqan3::dna15 n1{'C'_dna15}; + seqan3::dna15 n2{'T'_dna15}; + seqan3::dna15 n3{'A'_dna15}; + seqan3::aa27 c{'L'_aa27}; std::tuple tuple_triplet{n1, n2, n3}; #pragma GCC diagnostic ignored "-Wdeprecated-declarations" - aa27 t3{translate_triplet(tuple_triplet)}; + seqan3::aa27 t3{seqan3::translate_triplet(tuple_triplet)}; EXPECT_EQ(t3, c); } diff --git a/test/unit/alphabet/cigar/cigar_op_test.cpp b/test/unit/alphabet/cigar/cigar_op_test.cpp index 651dc498d3..caf28c0421 100644 --- a/test/unit/alphabet/cigar/cigar_op_test.cpp +++ b/test/unit/alphabet/cigar/cigar_op_test.cpp @@ -13,6 +13,8 @@ #include "../semi_alphabet_test_template.hpp" #include +using seqan3::operator""_cigar_op; + INSTANTIATE_TYPED_TEST_SUITE_P(cigar_op, alphabet_, seqan3::cigar_op, ); INSTANTIATE_TYPED_TEST_SUITE_P(cigar_op, semi_alphabet_test, seqan3::cigar_op, ); INSTANTIATE_TYPED_TEST_SUITE_P(cigar_op, alphabet_constexpr, seqan3::cigar_op, ); diff --git a/test/unit/alphabet/cigar/cigar_test.cpp b/test/unit/alphabet/cigar/cigar_test.cpp index 699f38651c..9b992473ad 100644 --- a/test/unit/alphabet/cigar/cigar_test.cpp +++ b/test/unit/alphabet/cigar/cigar_test.cpp @@ -13,30 +13,32 @@ #include "../semi_alphabet_test_template.hpp" #include "../semi_alphabet_constexpr_test_template.hpp" +using seqan3::get; + INSTANTIATE_TYPED_TEST_SUITE_P(cigar, semi_alphabet_test, seqan3::cigar, ); INSTANTIATE_TYPED_TEST_SUITE_P(cigar, semi_alphabet_constexpr, seqan3::cigar, ); -using namespace seqan3; - TEST(cigar, brace_init) { - cigar c1{uint32_t{223}, 'M'_cigar_op}; - EXPECT_EQ(c1.to_string(), small_string<11>{"223M"}); + using seqan3::operator""_cigar_op; + + seqan3::cigar c1{uint32_t{223}, 'M'_cigar_op}; + EXPECT_EQ(c1.to_string(), seqan3::small_string<11>{"223M"}); } TEST(cigar, to_string) { - cigar c1{}; + seqan3::cigar c1{}; - assign_rank_to(uint32_t{223}, get<0>(c1)); - assign_char_to('M', get<1>(c1)); - EXPECT_EQ(c1.to_string(), small_string<11>{"223M"}); + seqan3::assign_rank_to(uint32_t{223}, get<0>(c1)); + seqan3::assign_char_to('M', get<1>(c1)); + EXPECT_EQ(c1.to_string(), seqan3::small_string<11>{"223M"}); } TEST(cigar, assign_string) { - cigar c1{}; + seqan3::cigar c1{}; c1.assign_string("223M"); - EXPECT_EQ(uint32_t{223}, to_rank(get<0>(c1))); + EXPECT_EQ(uint32_t{223}, seqan3::to_rank(get<0>(c1))); EXPECT_EQ('M', get<1>(c1).to_char()); } diff --git a/test/unit/alphabet/cigar/debug_stream_cigar_test.cpp b/test/unit/alphabet/cigar/debug_stream_cigar_test.cpp index 8bc7c64a1e..7abbc57564 100644 --- a/test/unit/alphabet/cigar/debug_stream_cigar_test.cpp +++ b/test/unit/alphabet/cigar/debug_stream_cigar_test.cpp @@ -9,14 +9,12 @@ #include -using namespace seqan3; - TEST(debug_stream_test, cigar) { std::ostringstream o; - debug_stream_type my_stream{o}; + seqan3::debug_stream_type my_stream{o}; - cigar c1{}; + seqan3::cigar c1{}; c1.assign_string("223M"); my_stream << c1; diff --git a/test/unit/alphabet/composite/alphabet_tuple_base_test.cpp b/test/unit/alphabet/composite/alphabet_tuple_base_test.cpp index 47dae02c16..9f73af8700 100644 --- a/test/unit/alphabet/composite/alphabet_tuple_base_test.cpp +++ b/test/unit/alphabet/composite/alphabet_tuple_base_test.cpp @@ -14,41 +14,44 @@ #include "../semi_alphabet_test_template.hpp" #include "alphabet_tuple_base_test_template.hpp" -using namespace seqan3; +using seqan3::operator""_dna4; +using seqan3::operator""_dna5; +using seqan3::operator""_rna4; +using seqan3::operator""_rna5; template -struct test_composite : public alphabet_tuple_base, type1, type2> +struct test_composite : public seqan3::alphabet_tuple_base, type1, type2> { - using base_t = alphabet_tuple_base, type1, type2>; + using base_t = seqan3::alphabet_tuple_base, type1, type2>; using base_t::base_t; using base_t::operator=; }; template <> -class alphabet_tuple_base_test> : public ::testing::Test +class alphabet_tuple_base_test> : public ::testing::Test { public: - using T = test_composite; + using T = test_composite; T instance = T{value_1(), value_2()}; T zero_instance = T{decltype(value_1()){}, decltype(value_2()){}}; size_t tup_size{2}; - // test_composite + // test_composite // ------------------------------------------------------------------------- - dna4 value_1() + seqan3::dna4 value_1() { return 'G'_dna4; } - rna4 assignable_to_value_1() + seqan3::rna4 assignable_to_value_1() { return 'G'_rna4; } - dna5 value_2() + seqan3::dna5 value_2() { return 'G'_dna5; } - rna5 assignable_to_value_2() + seqan3::rna5 assignable_to_value_2() { return 'G'_rna5; } @@ -60,7 +63,7 @@ class alphabet_tuple_base_test> : public ::testing::T } }; -using test_composite_types = ::testing::Types>; +using test_composite_types = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(test_composite, semi_alphabet_test, test_composite_types, ); INSTANTIATE_TYPED_TEST_SUITE_P(test_composite, alphabet_tuple_base_test, test_composite_types, ); diff --git a/test/unit/alphabet/composite/alphabet_tuple_base_test_template.hpp b/test/unit/alphabet/composite/alphabet_tuple_base_test_template.hpp index 9e7a440b3c..c8293f0f94 100644 --- a/test/unit/alphabet/composite/alphabet_tuple_base_test_template.hpp +++ b/test/unit/alphabet/composite/alphabet_tuple_base_test_template.hpp @@ -10,7 +10,7 @@ #include #include -using namespace seqan3; +using seqan3::get; template class alphabet_tuple_base_test : public ::testing::Test {}; @@ -19,7 +19,7 @@ TYPED_TEST_SUITE_P(alphabet_tuple_base_test); TYPED_TEST_P(alphabet_tuple_base_test, concept_check) { - EXPECT_TRUE(tuple_like); + EXPECT_TRUE(seqan3::tuple_like); } // default/zero construction diff --git a/test/unit/alphabet/composite/alphabet_variant_detail_test.cpp b/test/unit/alphabet/composite/alphabet_variant_detail_test.cpp index edf7a95781..658544d1ed 100644 --- a/test/unit/alphabet/composite/alphabet_variant_detail_test.cpp +++ b/test/unit/alphabet/composite/alphabet_variant_detail_test.cpp @@ -14,33 +14,35 @@ #include #include -using namespace seqan3; - template -class detail_alphabet_variant : public alphabet_variant +class detail_alphabet_variant : public seqan3::alphabet_variant { public: - using alphabet_variant::partial_sum_sizes; - using alphabet_variant::rank_to_char; - using alphabet_variant::char_to_rank; + using seqan3::alphabet_variant::partial_sum_sizes; + using seqan3::alphabet_variant::rank_to_char; + using seqan3::alphabet_variant::char_to_rank; }; TEST(alphabet_variant_detail_test, partial_sum_sizes) { - constexpr std::array partial_sum2 = detail_alphabet_variant::partial_sum_sizes; + constexpr std::array partial_sum2 = detail_alphabet_variant::partial_sum_sizes; EXPECT_EQ(partial_sum2.size(), 3u); EXPECT_EQ(partial_sum2[0], 0); EXPECT_EQ(partial_sum2[1], 4); EXPECT_EQ(partial_sum2[2], 5); - constexpr std::array partial_sum3 = detail_alphabet_variant::partial_sum_sizes; + constexpr std::array partial_sum3 = detail_alphabet_variant::partial_sum_sizes; EXPECT_EQ(partial_sum3.size(), 4u); EXPECT_EQ(partial_sum3[0], 0); EXPECT_EQ(partial_sum3[1], 4); EXPECT_EQ(partial_sum3[2], 5); EXPECT_EQ(partial_sum3[3], 10); - constexpr std::array partial_sum4 = detail_alphabet_variant::partial_sum_sizes; + constexpr std::array partial_sum4 = detail_alphabet_variant::partial_sum_sizes; EXPECT_EQ(partial_sum4.size(), 4u); EXPECT_EQ(partial_sum4[0], 0); EXPECT_EQ(partial_sum4[1], 5); @@ -50,7 +52,7 @@ TEST(alphabet_variant_detail_test, partial_sum_sizes) TEST(alphabet_variant_detail_test, rank_to_char) { - constexpr std::array rank_to_char2 = detail_alphabet_variant::rank_to_char; + constexpr std::array rank_to_char2 = detail_alphabet_variant::rank_to_char; EXPECT_EQ(rank_to_char2.size(), 5u); EXPECT_EQ(rank_to_char2[0], 'A'); EXPECT_EQ(rank_to_char2[1], 'C'); @@ -58,7 +60,7 @@ TEST(alphabet_variant_detail_test, rank_to_char) EXPECT_EQ(rank_to_char2[3], 'T'); EXPECT_EQ(rank_to_char2[4], '-'); - constexpr std::array rank_to_char3 = detail_alphabet_variant::rank_to_char; + constexpr std::array rank_to_char3 = detail_alphabet_variant::rank_to_char; EXPECT_EQ(rank_to_char3.size(), 10u); EXPECT_EQ(rank_to_char3[0], 'A'); EXPECT_EQ(rank_to_char3[1], 'C'); @@ -71,7 +73,7 @@ TEST(alphabet_variant_detail_test, rank_to_char) EXPECT_EQ(rank_to_char3[8], 'N'); EXPECT_EQ(rank_to_char3[9], 'T'); - constexpr std::array rank_to_char4 = detail_alphabet_variant::rank_to_char; + constexpr std::array rank_to_char4 = detail_alphabet_variant::rank_to_char; EXPECT_EQ(rank_to_char4.size(), 10u); EXPECT_EQ(rank_to_char4[0], 'A'); EXPECT_EQ(rank_to_char4[1], 'C'); @@ -87,7 +89,7 @@ TEST(alphabet_variant_detail_test, rank_to_char) TEST(alphabet_variant_detail_test, char_to_rank) { - constexpr std::array char_to_rank2 = detail_alphabet_variant::char_to_rank; + constexpr std::array char_to_rank2 = detail_alphabet_variant::char_to_rank; EXPECT_EQ(char_to_rank2.size(), 256u); EXPECT_EQ(char_to_rank2['A'], 0); EXPECT_EQ(char_to_rank2['C'], 1); @@ -95,7 +97,7 @@ TEST(alphabet_variant_detail_test, char_to_rank) EXPECT_EQ(char_to_rank2['T'], 3); EXPECT_EQ(char_to_rank2['-'], 4); - constexpr std::array char_to_rank3 = detail_alphabet_variant::char_to_rank; + constexpr std::array char_to_rank3 = detail_alphabet_variant::char_to_rank; EXPECT_EQ(char_to_rank3.size(), 256u); EXPECT_EQ(char_to_rank3['A'], 0); EXPECT_EQ(char_to_rank3['C'], 1); @@ -108,7 +110,7 @@ TEST(alphabet_variant_detail_test, char_to_rank) EXPECT_EQ(char_to_rank3['N'], 8); EXPECT_EQ(char_to_rank3['T'], 3); - constexpr std::array char_to_rank4 = detail_alphabet_variant::char_to_rank; + constexpr std::array char_to_rank4 = detail_alphabet_variant::char_to_rank; EXPECT_EQ(char_to_rank4.size(), 256u); EXPECT_EQ(char_to_rank4['A'], 0); EXPECT_EQ(char_to_rank4['C'], 1); diff --git a/test/unit/alphabet/composite/alphabet_variant_test.cpp b/test/unit/alphabet/composite/alphabet_variant_test.cpp index bf645b10e0..428d2d4b6d 100644 --- a/test/unit/alphabet/composite/alphabet_variant_test.cpp +++ b/test/unit/alphabet/composite/alphabet_variant_test.cpp @@ -19,11 +19,14 @@ #include "../semi_alphabet_constexpr_test_template.hpp" #include "../semi_alphabet_test_template.hpp" -using namespace seqan3; +using seqan3::operator""_dna4; +using seqan3::operator""_dna5; +using seqan3::operator""_rna4; +using seqan3::operator""_rna5; -using alphabet_variant_types = ::testing::Types, - alphabet_variant, - alphabet_variant>; +using alphabet_variant_types = ::testing::Types, + seqan3::alphabet_variant, + seqan3::alphabet_variant>; INSTANTIATE_TYPED_TEST_SUITE_P(alphabet_variant, alphabet_, alphabet_variant_types, ); INSTANTIATE_TYPED_TEST_SUITE_P(alphabet_variant, semi_alphabet_test, alphabet_variant_types, ); @@ -37,10 +40,10 @@ TYPED_TEST_SUITE(alphabet_variant_test, alphabet_variant_types, ); TEST(alphabet_variant_test, initialise_from_component_alphabet) { - dna5 l('A'_rna5); + seqan3::dna5 l('A'_rna5); - using alphabet_t = alphabet_variant; - using variant_t = std::variant; + using alphabet_t = seqan3::alphabet_variant; + using variant_t = std::variant; constexpr variant_t variant0{'A'_dna4}; constexpr alphabet_t letter0{'A'_dna4}; @@ -69,8 +72,8 @@ TEST(alphabet_variant_test, initialise_from_component_alphabet) variant_t variant8 = static_cast('T'_dna5); alphabet_t letter8 = static_cast('T'_dna5); - variant_t variant9 = {static_cast(gap{})}; - alphabet_t letter9 = {static_cast(gap{})}; + variant_t variant9 = {static_cast(seqan3::gap{})}; + alphabet_t letter9 = {static_cast(seqan3::gap{})}; EXPECT_EQ(letter0.to_rank(), 0); EXPECT_EQ(letter1.to_rank(), 1); @@ -86,8 +89,8 @@ TEST(alphabet_variant_test, initialise_from_component_alphabet) TEST(alphabet_variant_test, initialise_from_component_alphabet_subtype) { - using alphabet_t = alphabet_variant; - using variant_t = std::variant; + using alphabet_t = seqan3::alphabet_variant; + using variant_t = std::variant; variant_t variant0{'A'_rna4}; alphabet_t letter0{'A'_rna4}; @@ -129,8 +132,8 @@ TEST(alphabet_variant_test, initialise_from_component_alphabet_subtype) TEST(alphabet_variant_test, assign_from_component_alphabet) { - using alphabet_t = alphabet_variant; - using variant_t = std::variant; + using alphabet_t = seqan3::alphabet_variant; + using variant_t = std::variant; alphabet_t letter{}; variant_t variant{}; @@ -168,14 +171,14 @@ TEST(alphabet_variant_test, assign_from_component_alphabet) letter = 'T'_dna5; EXPECT_EQ(letter.to_rank(), 8); - letter = gap{}; + letter = seqan3::gap{}; EXPECT_EQ(letter.to_rank(), 9); } TEST(alphabet_variant_test, assign_from_component_alphabet_subtype) { - using alphabet_t = alphabet_variant; - using variant_t = std::variant; + using alphabet_t = seqan3::alphabet_variant; + using variant_t = std::variant; alphabet_t letter{}; variant_t variant{}; @@ -216,7 +219,7 @@ TEST(alphabet_variant_test, assign_from_component_alphabet_subtype) TEST(alphabet_variant_test, compare_to_component_alphabet) { - using alphabet_t = alphabet_variant; + using alphabet_t = seqan3::alphabet_variant; constexpr alphabet_t letter0{'G'_dna4}; @@ -231,7 +234,7 @@ TEST(alphabet_variant_test, compare_to_component_alphabet) TEST(alphabet_variant_test, compare_to_component_alphabet_subtype) { - using alphabet_t = alphabet_variant; + using alphabet_t = seqan3::alphabet_variant; constexpr alphabet_t letter0{'G'_dna4}; @@ -246,20 +249,20 @@ TEST(alphabet_variant_test, compare_to_component_alphabet_subtype) TEST(alphabet_variant_test, rank_type) { - using alphabet1_t = alphabet_variant; - using alphabet2_t = alphabet_variant; - using alphabet3_t = alphabet_variant; + using alphabet1_t = seqan3::alphabet_variant; + using alphabet2_t = seqan3::alphabet_variant; + using alphabet3_t = seqan3::alphabet_variant; - EXPECT_TRUE((std::is_same_v, uint8_t>)); - EXPECT_TRUE((std::is_same_v, uint8_t>)); - EXPECT_TRUE((std::is_same_v, uint16_t>)); + EXPECT_TRUE((std::is_same_v, uint8_t>)); + EXPECT_TRUE((std::is_same_v, uint8_t>)); + EXPECT_TRUE((std::is_same_v, uint16_t>)); } TEST(alphabet_variant_test, alphabet_size_) { - using alphabet1_t = alphabet_variant; - using alphabet2_t = alphabet_variant; - using alphabet3_t = alphabet_variant; + using alphabet1_t = seqan3::alphabet_variant; + using alphabet2_t = seqan3::alphabet_variant; + using alphabet3_t = seqan3::alphabet_variant; EXPECT_TRUE((std::is_same_v)); EXPECT_TRUE((std::is_same_v)); @@ -272,7 +275,7 @@ TEST(alphabet_variant_test, alphabet_size_) TEST(alphabet_variant_test, convert_by_index) { - alphabet_variant u; + seqan3::alphabet_variant u; u = 'C'_dna5; EXPECT_FALSE(u.is_alternative<0>()); @@ -283,40 +286,40 @@ TEST(alphabet_variant_test, convert_by_index) EXPECT_NO_THROW(u.convert_to<1>()); EXPECT_THROW(u.convert_to<2>(), std::bad_variant_access); - dna5 out = u.convert_to<1>(); + seqan3::dna5 out = u.convert_to<1>(); EXPECT_EQ(out, 'C'_dna5); - u = gap{}; + u = seqan3::gap{}; - gap g = u.convert_unsafely_to<2>(); - EXPECT_EQ(g, gap{}); + seqan3::gap g = u.convert_unsafely_to<2>(); + EXPECT_EQ(g, seqan3::gap{}); } TEST(alphabet_variant_test, convert_by_type) { - alphabet_variant u; + seqan3::alphabet_variant u; u = 'C'_dna5; - EXPECT_FALSE(u.is_alternative()); - EXPECT_TRUE(u.is_alternative()); - EXPECT_FALSE(u.is_alternative()); + EXPECT_FALSE(u.is_alternative()); + EXPECT_TRUE(u.is_alternative()); + EXPECT_FALSE(u.is_alternative()); - EXPECT_THROW(u.convert_to(), std::bad_variant_access); - EXPECT_NO_THROW(u.convert_to()); - EXPECT_THROW(u.convert_to(), std::bad_variant_access); + EXPECT_THROW(u.convert_to(), std::bad_variant_access); + EXPECT_NO_THROW(u.convert_to()); + EXPECT_THROW(u.convert_to(), std::bad_variant_access); - dna5 out = u.convert_to(); + seqan3::dna5 out = u.convert_to(); EXPECT_EQ(out, 'C'_dna5); - u = gap{}; - gap g = u.convert_unsafely_to(); - EXPECT_EQ(g, gap{}); + u = seqan3::gap{}; + seqan3::gap g = u.convert_unsafely_to(); + EXPECT_EQ(g, seqan3::gap{}); } TEST(alphabet_variant_test, two_different_variants) { - alphabet_variant l{gap{}}; - alphabet_variant r{gap{}}; + seqan3::alphabet_variant l{seqan3::gap{}}; + seqan3::alphabet_variant r{seqan3::gap{}}; EXPECT_EQ(l, r); @@ -326,6 +329,6 @@ TEST(alphabet_variant_test, two_different_variants) EXPECT_NE(l, r); - alphabet_variant r2{'A'_rna4}; + seqan3::alphabet_variant r2{'A'_rna4}; EXPECT_EQ(l, r2); // this works because rna4 and dna4 are implicitly convertible to each other } diff --git a/test/unit/alphabet/composite/composite_integration_test.cpp b/test/unit/alphabet/composite/composite_integration_test.cpp index 5cab97e560..e8a7202a6c 100644 --- a/test/unit/alphabet/composite/composite_integration_test.cpp +++ b/test/unit/alphabet/composite/composite_integration_test.cpp @@ -9,48 +9,56 @@ #include -using namespace seqan3; +using seqan3::operator""_aa27; +using seqan3::operator""_dna4; +using seqan3::operator""_rna4; + +using qualified_dna_phred42 = seqan3::qualified; +using qualified_gapped_dna_phred42 = seqan3::qualified, seqan3::phred42>; +using gapped_qualified_dna_phred42 = seqan3::gapped; +using qualified_qualified_gapped_dna_phred42_phred42 = seqan3::qualified; +using gapped_alphabet_variant_dna_phred42 = seqan3::gapped>; // Some haessllihckeiten-tests TEST(composite, custom_constructors) { - qualified t11{'C'_dna4}; - qualified t12{'C'_rna4}; - qualified t13{phred42{3}}; - qualified t14{phred63{3}}; - - qualified t20{'K'_aa27, phred63{}}; - qualified t21{'K'_aa27}; - qualified t22{phred63{3}}; - qualified t23{phred42{3}}; - - qualified, phred42> t31{'C'_dna4}; - qualified, phred42> t32{'C'_rna4}; - qualified, phred42> t33{phred42{3}}; - qualified, phred42> t34{gap{}}; - qualified, phred42> t35{gapped('C'_dna4)}; - qualified, phred42> t36{gapped(gap{})}; - qualified, phred42> t37{gap{}, phred42{3}}; - - gapped> t41{'C'_dna4}; - gapped> t42{'C'_rna4}; - gapped> t43{phred42{3}}; - gapped> t44{gap{}}; - gapped> t45{qualified{'C'_dna4, phred42{0}}}; - - qualified, phred42>, phred42> t51{'C'_dna4}; - qualified, phred42>, phred42> t52{'C'_rna4}; - qualified, phred42>, phred42> t53{phred42{3}}; - qualified, phred42>, phred42> t54{gap{}}; - qualified, phred42>, phred42> t55{gapped('C'_dna4)}; - qualified, phred42>, phred42> t56{gapped(gap{})}; - - gapped> t61{'C'_dna4}; - gapped> t62{'C'_rna4}; - gapped> t63{phred42{3}}; - gapped> t64{gap{}}; - gapped> t65{qualified{'C'_dna4, phred42{0}}}; + qualified_dna_phred42 t11{'C'_dna4}; + qualified_dna_phred42 t12{'C'_rna4}; + qualified_dna_phred42 t13{seqan3::phred42{3}}; + qualified_dna_phred42 t14{seqan3::phred63{3}}; + + seqan3::qualified t20{'K'_aa27, seqan3::phred63{}}; + seqan3::qualified t21{'K'_aa27}; + seqan3::qualified t22{seqan3::phred63{3}}; + seqan3::qualified t23{seqan3::phred42{3}}; + + qualified_gapped_dna_phred42 t31{'C'_dna4}; + qualified_gapped_dna_phred42 t32{'C'_rna4}; + qualified_gapped_dna_phred42 t33{seqan3::phred42{3}}; + qualified_gapped_dna_phred42 t34{seqan3::gap{}}; + qualified_gapped_dna_phred42 t35{seqan3::gapped('C'_dna4)}; + qualified_gapped_dna_phred42 t36{seqan3::gapped(seqan3::gap{})}; + qualified_gapped_dna_phred42 t37{seqan3::gap{}, seqan3::phred42{3}}; + + gapped_qualified_dna_phred42 t41{'C'_dna4}; + gapped_qualified_dna_phred42 t42{'C'_rna4}; + gapped_qualified_dna_phred42 t43{seqan3::phred42{3}}; + gapped_qualified_dna_phred42 t44{seqan3::gap{}}; + gapped_qualified_dna_phred42 t45{qualified_dna_phred42{'C'_dna4, seqan3::phred42{0}}}; + + qualified_qualified_gapped_dna_phred42_phred42 t51{'C'_dna4}; + qualified_qualified_gapped_dna_phred42_phred42 t52{'C'_rna4}; + qualified_qualified_gapped_dna_phred42_phred42 t53{seqan3::phred42{3}}; + qualified_qualified_gapped_dna_phred42_phred42 t54{seqan3::gap{}}; + qualified_qualified_gapped_dna_phred42_phred42 t55{seqan3::gapped('C'_dna4)}; + qualified_qualified_gapped_dna_phred42_phred42 t56{seqan3::gapped(seqan3::gap{})}; + + gapped_alphabet_variant_dna_phred42 t61{'C'_dna4}; + gapped_alphabet_variant_dna_phred42 t62{'C'_rna4}; + gapped_alphabet_variant_dna_phred42 t63{seqan3::phred42{3}}; + gapped_alphabet_variant_dna_phred42 t64{seqan3::gap{}}; + gapped_alphabet_variant_dna_phred42 t65{qualified_dna_phred42{'C'_dna4, seqan3::phred42{0}}}; EXPECT_EQ(t11, t12); EXPECT_EQ(t13, t14); @@ -83,172 +91,174 @@ TEST(composite, custom_constructors) TEST(composite_constexpr, custom_constructor) { - constexpr qualified t11{'C'_dna4}; - constexpr qualified t12{'C'_rna4}; - constexpr qualified t13{phred42{3}}; - constexpr qualified t14{phred63{3}}; - - constexpr qualified t21{'K'_aa27}; - constexpr qualified t22{phred63{3}}; - constexpr qualified t23{phred42{3}}; - - constexpr qualified, phred42> t31{'C'_dna4}; - constexpr qualified, phred42> t32{'C'_rna4}; - constexpr qualified, phred42> t33{phred42{3}}; - constexpr qualified, phred42> t34{gap{}}; - constexpr qualified, phred42> t35{gapped('C'_dna4)}; - constexpr qualified, phred42> t36{gapped(gap{})}; - constexpr qualified, phred42> t37{gap{}, phred42{3}}; - - constexpr gapped> t41{'C'_dna4}; - constexpr gapped> t42{'C'_rna4}; - constexpr gapped> t43{phred42{3}}; - constexpr gapped> t44{gap{}}; - constexpr gapped> t45{qualified{'C'_dna4, phred42{0}}}; - - constexpr qualified, phred42>, phred42> t51{'C'_dna4}; - constexpr qualified, phred42>, phred42> t52{'C'_rna4}; - constexpr qualified, phred42>, phred42> t53{phred42{3}}; - constexpr qualified, phred42>, phred42> t54{gap{}}; - constexpr qualified, phred42>, phred42> t55{gapped('C'_dna4)}; - constexpr qualified, phred42>, phred42> t56{gapped(gap{})}; - - constexpr gapped> t61{'C'_dna4}; - constexpr gapped> t62{'C'_rna4}; - constexpr gapped> t63{phred42{3}}; - constexpr gapped> t64{gap{}}; - constexpr gapped> t65{qualified{'C'_dna4, phred42{0}}}; + constexpr qualified_dna_phred42 t11{'C'_dna4}; + constexpr qualified_dna_phred42 t12{'C'_rna4}; + constexpr qualified_dna_phred42 t13{seqan3::phred42{3}}; + constexpr qualified_dna_phred42 t14{seqan3::phred63{3}}; + + constexpr seqan3::qualified t21{'K'_aa27}; + constexpr seqan3::qualified t22{seqan3::phred63{3}}; + constexpr seqan3::qualified t23{seqan3::phred42{3}}; + + constexpr qualified_gapped_dna_phred42 t31{'C'_dna4}; + constexpr qualified_gapped_dna_phred42 t32{'C'_rna4}; + constexpr qualified_gapped_dna_phred42 t33{seqan3::phred42{3}}; + constexpr qualified_gapped_dna_phred42 t34{seqan3::gap{}}; + constexpr qualified_gapped_dna_phred42 t35{seqan3::gapped('C'_dna4)}; + constexpr qualified_gapped_dna_phred42 t36{seqan3::gapped(seqan3::gap{})}; + constexpr qualified_gapped_dna_phred42 t37{seqan3::gap{}, seqan3::phred42{3}}; + + constexpr gapped_qualified_dna_phred42 t41{'C'_dna4}; + constexpr gapped_qualified_dna_phred42 t42{'C'_rna4}; + constexpr gapped_qualified_dna_phred42 t43{seqan3::phred42{3}}; + constexpr gapped_qualified_dna_phred42 t44{seqan3::gap{}}; + constexpr gapped_qualified_dna_phred42 t45{qualified_dna_phred42{'C'_dna4, seqan3::phred42{0}}}; + + constexpr qualified_qualified_gapped_dna_phred42_phred42 t51{'C'_dna4}; + constexpr qualified_qualified_gapped_dna_phred42_phred42 t52{'C'_rna4}; + constexpr qualified_qualified_gapped_dna_phred42_phred42 t53{seqan3::phred42{3}}; + constexpr qualified_qualified_gapped_dna_phred42_phred42 t54{seqan3::gap{}}; + constexpr qualified_qualified_gapped_dna_phred42_phred42 t55{seqan3::gapped('C'_dna4)}; + constexpr qualified_qualified_gapped_dna_phred42_phred42 t56{seqan3::gapped(seqan3::gap{})}; + + constexpr gapped_alphabet_variant_dna_phred42 t61{'C'_dna4}; + constexpr gapped_alphabet_variant_dna_phred42 t62{'C'_rna4}; + constexpr gapped_alphabet_variant_dna_phred42 t63{seqan3::phred42{3}}; + constexpr gapped_alphabet_variant_dna_phred42 t64{seqan3::gap{}}; + constexpr gapped_alphabet_variant_dna_phred42 t65{qualified_dna_phred42{'C'_dna4, seqan3::phred42{0}}}; } TEST(composite, custom_assignment) { - qualified t11{}; - qualified t12{'C'_dna4}; - qualified t13{'C'_dna4, phred42{3}}; + qualified_dna_phred42 t11{}; + qualified_dna_phred42 t12{'C'_dna4}; + qualified_dna_phred42 t13{'C'_dna4, seqan3::phred42{3}}; t11 = 'C'_dna4; EXPECT_EQ(t11, t12); t11 = 'C'_rna4; EXPECT_EQ(t11, t12); - t11 = phred42{3}; + t11 = seqan3::phred42{3}; EXPECT_EQ(t11, t13); - // t11 = phred63{3}; // does not work because of explicit conversion + // t11 = seqan3::phred63{3}; // does not work because of explicit conversion - qualified t20{'K'_aa27, phred63{}}; - qualified t21{}; - qualified t22{'K'_aa27, phred63{3}}; + seqan3::qualified t20{'K'_aa27, seqan3::phred63{}}; + seqan3::qualified t21{}; + seqan3::qualified t22{'K'_aa27, seqan3::phred63{3}}; t21 = 'K'_aa27; EXPECT_EQ(t20, t21); - t21 = phred63{3}; + t21 = seqan3::phred63{3}; EXPECT_EQ(t21, t22); - qualified, phred42> t31{}; - qualified, phred42> t32{'C'_dna4}; - qualified, phred42> t33{'C'_dna4, phred42{3}}; - qualified, phred42> t34{gap{}, phred42{3}}; + qualified_gapped_dna_phred42 t31{}; + qualified_gapped_dna_phred42 t32{'C'_dna4}; + qualified_gapped_dna_phred42 t33{'C'_dna4, seqan3::phred42{3}}; + qualified_gapped_dna_phred42 t34{seqan3::gap{}, seqan3::phred42{3}}; t31 = 'C'_dna4; EXPECT_EQ(t31, t32); t31 = 'C'_rna4; EXPECT_EQ(t31, t32); - t31 = phred42{3}; + t31 = seqan3::phred42{3}; EXPECT_EQ(t31, t33); - t31 = gap{}; + t31 = seqan3::gap{}; EXPECT_EQ(t31, t34); - t31 = gapped('C'_dna4); + t31 = seqan3::gapped('C'_dna4); EXPECT_EQ(t31, t33); - t31 = gapped(gap{}); + t31 = seqan3::gapped(seqan3::gap{}); EXPECT_EQ(t31, t34); - gapped> t41{}; - gapped> t42{'C'_dna4}; - gapped> t43{qualified{'C'_dna4, phred42{3}}}; - gapped> t44{gap{}}; - gapped> t45{qualified{'C'_dna4, phred42{0}}}; + gapped_qualified_dna_phred42 t41{}; + gapped_qualified_dna_phred42 t42{'C'_dna4}; + gapped_qualified_dna_phred42 t43{qualified_dna_phred42{'C'_dna4, seqan3::phred42{3}}}; + gapped_qualified_dna_phred42 t44{seqan3::gap{}}; + gapped_qualified_dna_phred42 t45{qualified_dna_phred42{'C'_dna4, seqan3::phred42{0}}}; t41 = 'C'_dna4; EXPECT_EQ(t41, t42); t41 = 'C'_rna4; EXPECT_EQ(t41, t42); - t41 = phred42{3}; - // EXPECT_EQ(t41, t43); should work intuitively but does not because on assignment the qualified object is defaulted - t41 = gap{}; + t41 = seqan3::phred42{3}; + // EXPECT_EQ(t41, t43); should work intuitively but does not because on assignment the seqan3::qualified object is defaulted + t41 = seqan3::gap{}; EXPECT_EQ(t41, t44); - t41 = qualified{'C'_dna4, phred42{0}}; + t41 = qualified_dna_phred42{'C'_dna4, seqan3::phred42{0}}; EXPECT_EQ(t41, t45); - qualified, phred42>, phred42> t51{}; - qualified, phred42>, phred42> t52{'C'_dna4}; - qualified, phred42>, phred42> t53{qualified, phred42>{'C'_dna4, phred42{0}}, phred42{3}}; - qualified, phred42>, phred42> t54{qualified, phred42>{gap{}, phred42{0}}, phred42{3}}; + qualified_qualified_gapped_dna_phred42_phred42 t51{}; + qualified_qualified_gapped_dna_phred42_phred42 t52{'C'_dna4}; + qualified_qualified_gapped_dna_phred42_phred42 t53{qualified_gapped_dna_phred42{'C'_dna4, seqan3::phred42{0}}, + seqan3::phred42{3}}; + qualified_qualified_gapped_dna_phred42_phred42 t54{qualified_gapped_dna_phred42{seqan3::gap{}, seqan3::phred42{0}}, + seqan3::phred42{3}}; t51 = 'C'_dna4; EXPECT_EQ(t51, t52); t51 = 'C'_rna4; EXPECT_EQ(t51, t52); - t51 = phred42{3}; + t51 = seqan3::phred42{3}; EXPECT_EQ(t51, t53); - t51 = gap{}; + t51 = seqan3::gap{}; EXPECT_EQ(t51, t54); - t51 = gapped('C'_dna4); + t51 = seqan3::gapped('C'_dna4); EXPECT_EQ(t51, t53); - t51 = gapped(gap{}); + t51 = seqan3::gapped(seqan3::gap{}); EXPECT_EQ(t51, t54); - gapped> t61{}; - gapped> t62{'C'_dna4}; - gapped> t63{phred42{3}}; - gapped> t64{gap{}}; - gapped> t65{qualified{'C'_dna4, phred42{0}}}; + gapped_alphabet_variant_dna_phred42 t61{}; + gapped_alphabet_variant_dna_phred42 t62{'C'_dna4}; + gapped_alphabet_variant_dna_phred42 t63{seqan3::phred42{3}}; + gapped_alphabet_variant_dna_phred42 t64{seqan3::gap{}}; + gapped_alphabet_variant_dna_phred42 t65{qualified_dna_phred42{'C'_dna4, seqan3::phred42{0}}}; t61 = 'C'_dna4; EXPECT_EQ(t61, t62); t61 = 'C'_rna4; EXPECT_EQ(t61, t62); - t61 = phred42{3}; + t61 = seqan3::phred42{3}; EXPECT_EQ(t61, t63); - t61 = gap{}; + t61 = seqan3::gap{}; EXPECT_EQ(t61, t64); - t61 = qualified{'C'_dna4, phred42{0}}; + t61 = qualified_dna_phred42{'C'_dna4, seqan3::phred42{0}}; EXPECT_EQ(t61, t65); } constexpr bool do_assignment() { - qualified t11{}; + qualified_dna_phred42 t11{}; t11 = 'C'_dna4; t11 = 'C'_rna4; - t11 = phred42{3}; - // t11 = phred63{3}; // does not work because of explicit conversion + t11 = seqan3::phred42{3}; + // t11 = seqan3::phred63{3}; // does not work because of explicit conversion - qualified t21{}; + seqan3::qualified t21{}; t21 = 'K'_aa27; - t21 = phred63{3}; + t21 = seqan3::phred63{3}; - qualified, phred42> t31{}; + qualified_gapped_dna_phred42 t31{}; t31 = 'C'_dna4; t31 = 'C'_rna4; - t31 = phred42{3}; - t31 = gap{}; - t31 = gapped('C'_dna4); - t31 = gapped(gap{}); + t31 = seqan3::phred42{3}; + t31 = seqan3::gap{}; + t31 = seqan3::gapped('C'_dna4); + t31 = seqan3::gapped(seqan3::gap{}); - gapped> t41{}; + gapped_qualified_dna_phred42 t41{}; t41 = 'C'_dna4; t41 = 'C'_rna4; - t41 = phred42{3}; - t41 = gap{}; - t41 = qualified{'C'_dna4, phred42{0}}; + t41 = seqan3::phred42{3}; + t41 = seqan3::gap{}; + t41 = qualified_dna_phred42{'C'_dna4, seqan3::phred42{0}}; - qualified, phred42>, phred42> t51{}; + qualified_qualified_gapped_dna_phred42_phred42 t51{}; t51 = 'C'_dna4; t51 = 'C'_rna4; - t51 = phred42{3}; - t51 = gap{}; - t51 = gapped('C'_dna4); - t51 = gapped(gap{}); + t51 = seqan3::phred42{3}; + t51 = seqan3::gap{}; + t51 = seqan3::gapped('C'_dna4); + t51 = seqan3::gapped(seqan3::gap{}); - gapped> t61{}; + gapped_alphabet_variant_dna_phred42 t61{}; t61 = 'C'_rna4; - t61 = phred42{3}; - t61 = gap{}; - t61 = qualified{'C'_dna4, phred42{0}}; + t61 = seqan3::phred42{3}; + t61 = seqan3::gap{}; + t61 = qualified_dna_phred42{'C'_dna4, seqan3::phred42{0}}; return true; } @@ -263,141 +273,143 @@ TEST(composite, custom_comparison) /* Tests marked with "// *" would not be possible if all single argument constructors of alphabet_variant * are made explicit */ - qualified t11{'C'_dna4, phred42{3}}; + qualified_dna_phred42 t11{'C'_dna4, seqan3::phred42{3}}; EXPECT_EQ(t11, 'C'_dna4); EXPECT_EQ(t11, 'C'_rna4); - EXPECT_EQ(t11, phred42{3}); + EXPECT_EQ(t11, seqan3::phred42{3}); EXPECT_LT(t11, 'G'_dna4); EXPECT_LT(t11, 'G'_rna4); - EXPECT_LT(t11, phred42{4}); + EXPECT_LT(t11, seqan3::phred42{4}); - EXPECT_EQ('C'_dna4, t11); - EXPECT_EQ('C'_rna4, t11); - EXPECT_EQ(phred42{3}, t11); - EXPECT_LT('A'_dna4, t11); - EXPECT_LT('A'_rna4, t11); - EXPECT_LT(phred42{2}, t11); + EXPECT_EQ('C'_dna4, t11); + EXPECT_EQ('C'_rna4, t11); + EXPECT_EQ(seqan3::phred42{3}, t11); + EXPECT_LT('A'_dna4, t11); + EXPECT_LT('A'_rna4, t11); + EXPECT_LT(seqan3::phred42{2}, t11); - qualified t21{'K'_aa27, phred63{3}}; + seqan3::qualified t21{'K'_aa27, seqan3::phred63{3}}; EXPECT_EQ(t21, 'K'_aa27); - EXPECT_EQ(t21, phred63{3}); + EXPECT_EQ(t21, seqan3::phred63{3}); EXPECT_LT(t21, 'L'_aa27); - EXPECT_LT(t21, phred63{4}); + EXPECT_LT(t21, seqan3::phred63{4}); - EXPECT_EQ('K'_aa27, t21); - EXPECT_EQ(phred63{3}, t21); - EXPECT_LT('C'_aa27, t21); - EXPECT_LT(phred63{2}, t21); + EXPECT_EQ('K'_aa27, t21); + EXPECT_EQ(seqan3::phred63{3}, t21); + EXPECT_LT('C'_aa27, t21); + EXPECT_LT(seqan3::phred63{2}, t21); - qualified, phred42> t31{'C'_dna4, phred42{3}}; + qualified_gapped_dna_phred42 t31{'C'_dna4, seqan3::phred42{3}}; EXPECT_EQ(t31, 'C'_dna4); EXPECT_EQ(t31, 'C'_rna4); - EXPECT_EQ(t31, phred42{3}); - EXPECT_NE(t31, gap{}); - EXPECT_EQ(t31, gapped('C'_dna4)); - EXPECT_LT(t31, 'G'_dna4); // * - EXPECT_LT(t31, 'G'_rna4); // * - EXPECT_LT(t31, phred42{4}); - EXPECT_LT(t31, gap{}); // * - EXPECT_LT(t31, gapped('G'_dna4)); - - EXPECT_EQ('C'_dna4, t31); - EXPECT_EQ('C'_rna4, t31); - EXPECT_EQ(phred42{3}, t31); - EXPECT_NE(gap{}, t31); - EXPECT_EQ(gapped('C'_dna4), t31); - EXPECT_LT('A'_dna4, t31); // * - EXPECT_LT('A'_rna4, t31); // * - EXPECT_LT(phred42{2}, t31); - EXPECT_GT(gap{}, t31); // * - EXPECT_LT(gapped('A'_dna4), t31); - - gapped> t41{qualified{'C'_dna4, phred42{3}}}; + EXPECT_EQ(t31, seqan3::phred42{3}); + EXPECT_NE(t31, seqan3::gap{}); + EXPECT_EQ(t31, seqan3::gapped('C'_dna4)); + EXPECT_LT(t31, 'G'_dna4); // * + EXPECT_LT(t31, 'G'_rna4); // * + EXPECT_LT(t31, seqan3::phred42{4}); + EXPECT_LT(t31, seqan3::gap{}); // * + EXPECT_LT(t31, seqan3::gapped('G'_dna4)); + + EXPECT_EQ('C'_dna4, t31); + EXPECT_EQ('C'_rna4, t31); + EXPECT_EQ(seqan3::phred42{3}, t31); + EXPECT_NE(seqan3::gap{}, t31); + EXPECT_EQ(seqan3::gapped('C'_dna4), t31); + EXPECT_LT('A'_dna4, t31); // * + EXPECT_LT('A'_rna4, t31); // * + EXPECT_LT(seqan3::phred42{2}, t31); + EXPECT_GT(seqan3::gap{}, t31); // * + EXPECT_LT(seqan3::gapped('A'_dna4), t31); + + gapped_qualified_dna_phred42 t41{qualified_dna_phred42{'C'_dna4, seqan3::phred42{3}}}; EXPECT_EQ(t41, 'C'_dna4); EXPECT_EQ(t41, 'C'_rna4); - EXPECT_EQ(t41, phred42{3}); - EXPECT_NE(t41, gap{}); - EXPECT_EQ(t41, (qualified{'C'_dna4, phred42{3}})); - EXPECT_EQ(t41, (gapped>{qualified{'C'_dna4, phred42{3}}})); -// EXPECT_LT(t41, 'G'_dna4); // not supposed to work -// EXPECT_LT(t41, 'G'_rna4); // not supposed to work -// EXPECT_LT(t41, phred42{4}); // would never be LT, because dna4 part of tuple defaulted to 'A' on RHS - EXPECT_LT(t41, gap{}); // * - EXPECT_LT(t41, (qualified{'G'_dna4, phred42{2}})); // * - EXPECT_LT(t41, (gapped>{qualified{'G'_dna4, phred42{2}}})); - - EXPECT_EQ('C'_dna4, t41); - EXPECT_EQ('C'_rna4, t41); - EXPECT_EQ(phred42{3}, t41); - EXPECT_EQ((qualified{'C'_dna4, phred42{3}}), t41); - EXPECT_NE(gap{}, t41); -// EXPECT_LT('A'_dna4, t41); // not supposed to work -// EXPECT_LT('A'_rna4, t41); // not supposed to work -// EXPECT_LT(phred42{2}, t41); // not supposed to work - EXPECT_LT((qualified{'A'_dna4, phred42{2}}), t41); // * - EXPECT_GT(gap{}, t41); // * - - qualified, phred42>, phred42> t51{qualified, phred42>{'C'_dna4, phred42{3}}}; + EXPECT_EQ(t41, seqan3::phred42{3}); + EXPECT_NE(t41, seqan3::gap{}); + EXPECT_EQ(t41, (qualified_dna_phred42{'C'_dna4, seqan3::phred42{3}})); + EXPECT_EQ(t41, (gapped_qualified_dna_phred42{qualified_dna_phred42{'C'_dna4, seqan3::phred42{3}}})); +// EXPECT_LT(t41, 'G'_dna4); // not supposed to work +// EXPECT_LT(t41, 'G'_rna4); // not supposed to work +// EXPECT_LT(t41, seqan3::phred42{4}); // would never be LT, because seqan3::dna4 part of tuple defaulted to 'A' on RHS + EXPECT_LT(t41, seqan3::gap{}); // * + EXPECT_LT(t41, (qualified_dna_phred42{'G'_dna4, seqan3::phred42{2}})); // * + EXPECT_LT(t41, (gapped_qualified_dna_phred42{qualified_dna_phred42{'G'_dna4, seqan3::phred42{2}}})); + + EXPECT_EQ('C'_dna4, t41); + EXPECT_EQ('C'_rna4, t41); + EXPECT_EQ(seqan3::phred42{3}, t41); + EXPECT_EQ((qualified_dna_phred42{'C'_dna4, seqan3::phred42{3}}), t41); + EXPECT_NE(seqan3::gap{}, t41); +// EXPECT_LT('A'_dna4, t41); // not supposed to work +// EXPECT_LT('A'_rna4, t41); // not supposed to work +// EXPECT_LT(seqan3::phred42{2}, t41); // not supposed to work + EXPECT_LT((qualified_dna_phred42{'A'_dna4, seqan3::phred42{2}}), t41); // * + EXPECT_GT(seqan3::gap{}, t41); // * + + qualified_qualified_gapped_dna_phred42_phred42 t51{qualified_gapped_dna_phred42{'C'_dna4, seqan3::phred42{3}}}; EXPECT_EQ(t51, 'C'_dna4); EXPECT_EQ(t51, 'C'_rna4); - EXPECT_NE(t51, gap{}); - EXPECT_EQ(t51, gapped('C'_dna4)); - EXPECT_EQ(t51, phred42{0}); // "outer" phred element - EXPECT_EQ(t51, (qualified, phred42>{'C'_dna4, phred42{3}})); -// EXPECT_LT(t51, 'G'_dna4); // not supposed to work -// EXPECT_LT(t51, 'G'_rna4); // not supposed to work -// EXPECT_LT(t51, gap{}); // not supposed to work -// EXPECT_LT(t51, gapped('G'_dna4)); // not supposed to work - EXPECT_LT(t51, phred42{1}); - EXPECT_LT(t51, (qualified, phred42>{'C'_dna4, phred42{4}})); - - EXPECT_EQ('C'_dna4, t51); - EXPECT_EQ('C'_rna4, t51); - EXPECT_NE(gap{}, t51); - EXPECT_EQ(gapped('C'_dna4), t51); - EXPECT_EQ(phred42{0}, t51); - EXPECT_EQ((qualified, phred42>{'C'_dna4, phred42{3}}), t51); -// EXPECT_LT('A'_dna4, t51); // not supposed to work -// EXPECT_LT('A'_rna4, t51); // not supposed to work -// EXPECT_GT(gap{}, t51); // not supposed to work -// EXPECT_LT(gapped('A'_dna4), t51); // not supposed to work - EXPECT_GT(phred42{1}, t51); - EXPECT_GT((qualified, phred42>{'C'_dna4, phred42{4}}), t51); - - gapped> t61{'C'_rna4}; + EXPECT_NE(t51, seqan3::gap{}); + EXPECT_EQ(t51, seqan3::gapped('C'_dna4)); + EXPECT_EQ(t51, seqan3::phred42{0}); // "outer" phred element + EXPECT_EQ(t51, (qualified_gapped_dna_phred42{'C'_dna4, seqan3::phred42{3}})); +// EXPECT_LT(t51, 'G'_dna4); // not supposed to work +// EXPECT_LT(t51, 'G'_rna4); // not supposed to work +// EXPECT_LT(t51, seqan3::gap{}); // not supposed to work +// EXPECT_LT(t51, seqan3::gapped('G'_dna4)); // not supposed to work + EXPECT_LT(t51, seqan3::phred42{1}); + EXPECT_LT(t51, (qualified_gapped_dna_phred42{'C'_dna4, seqan3::phred42{4}})); + + EXPECT_EQ('C'_dna4, t51); + EXPECT_EQ('C'_rna4, t51); + EXPECT_NE(seqan3::gap{}, t51); + EXPECT_EQ(seqan3::gapped('C'_dna4), t51); + EXPECT_EQ(seqan3::phred42{0}, t51); + EXPECT_EQ((qualified_gapped_dna_phred42{'C'_dna4, seqan3::phred42{3}}), t51); +// EXPECT_LT('A'_dna4, t51); // not supposed to work +// EXPECT_LT('A'_rna4, t51); // not supposed to work +// EXPECT_GT(seqan3::gap{}, t51); // not supposed to work +// EXPECT_LT(seqan3::gapped('A'_dna4), t51); // not supposed to work + EXPECT_GT(seqan3::phred42{1}, t51); + EXPECT_GT((qualified_gapped_dna_phred42{'C'_dna4, seqan3::phred42{4}}), t51); + + gapped_alphabet_variant_dna_phred42 t61{'C'_rna4}; EXPECT_EQ(t61, 'C'_rna4); EXPECT_EQ(t61, 'C'_dna4); - EXPECT_NE(t61, gap{}); - EXPECT_NE(t61, phred42{0}); - EXPECT_LT(t61, 'G'_rna4); // * - EXPECT_LT(t61, 'G'_dna4); // * - EXPECT_LT(t61, gap{}); // * - EXPECT_LT(t61, phred42{1}); // * - - EXPECT_EQ('C'_rna4, t61); - EXPECT_EQ('C'_dna4, t61); - EXPECT_NE(gap{}, t61); - EXPECT_NE(phred42{0}, t61); - EXPECT_LT('A'_rna4, t61); // * - EXPECT_LT('A'_dna4, t61); // * - EXPECT_GT(gap{}, t61); // * - EXPECT_GT(phred42{0}, t61); // * + EXPECT_NE(t61, seqan3::gap{}); + EXPECT_NE(t61, seqan3::phred42{0}); + EXPECT_LT(t61, 'G'_rna4); // * + EXPECT_LT(t61, 'G'_dna4); // * + EXPECT_LT(t61, seqan3::gap{}); // * + EXPECT_LT(t61, seqan3::phred42{1}); // * + + EXPECT_EQ('C'_rna4, t61); + EXPECT_EQ('C'_dna4, t61); + EXPECT_NE(seqan3::gap{}, t61); + EXPECT_NE(seqan3::phred42{0}, t61); + EXPECT_LT('A'_rna4, t61); // * + EXPECT_LT('A'_dna4, t61); // * + EXPECT_GT(seqan3::gap{}, t61); // * + EXPECT_GT(seqan3::phred42{0}, t61); // * } TEST(composite, get_) { - qualified, phred42>, phred42> t51{qualified, phred42>{'C'_dna4, phred42{3}}}; + using seqan3::get; + + qualified_qualified_gapped_dna_phred42_phred42 t51{qualified_gapped_dna_phred42{'C'_dna4, seqan3::phred42{3}}}; EXPECT_EQ(get<0>(t51), 'C'_dna4); EXPECT_EQ(get<0>(get<0>(t51)), 'C'_dna4); EXPECT_EQ(get<0>(t51), 'C'_rna4); EXPECT_EQ(get<0>(get<0>(t51)), 'C'_rna4); - EXPECT_NE(get<0>(t51), gap{}); - EXPECT_NE(get<0>(get<0>(t51)), gap{}); + EXPECT_NE(get<0>(t51), seqan3::gap{}); + EXPECT_NE(get<0>(get<0>(t51)), seqan3::gap{}); - EXPECT_EQ(get<0>(t51), gapped('C'_dna4)); - EXPECT_EQ(get<0>(get<0>(t51)), gapped('C'_dna4)); + EXPECT_EQ(get<0>(t51), seqan3::gapped('C'_dna4)); + EXPECT_EQ(get<0>(get<0>(t51)), seqan3::gapped('C'_dna4)); - EXPECT_NE(get<0>(t51), phred42{0}); + EXPECT_NE(get<0>(t51), seqan3::phred42{0}); } diff --git a/test/unit/alphabet/quality/qualified_test.cpp b/test/unit/alphabet/quality/qualified_test.cpp index 374ef838bf..5877dfe3ec 100644 --- a/test/unit/alphabet/quality/qualified_test.cpp +++ b/test/unit/alphabet/quality/qualified_test.cpp @@ -23,14 +23,16 @@ #include "../composite/alphabet_tuple_base_test_template.hpp" template -class alphabet_tuple_base_test> : public ::testing::Test +class alphabet_tuple_base_test> : public ::testing::Test { public: - using T = qualified; + using T = seqan3::qualified; - using other_type = std::conditional_t, rna4, - std::conditional_t, aa27, - std::conditional_t>, gapped, alphabet_type>>>; + using other_type = std::conditional_t, seqan3::rna4, + std::conditional_t, seqan3::aa27, + std::conditional_t>, + seqan3::gapped, + alphabet_type>>>; T instance = T{value_1(), value_2()}; T zero_instance = T{decltype(value_1()){}, decltype(value_2()){}}; @@ -62,11 +64,11 @@ class alphabet_tuple_base_test> : public :: } }; -using qualified_types = ::testing::Types, - qualified, - qualified, - qualified, phred42>, - dna4q>; +using qualified_types = ::testing::Types, + seqan3::qualified, + seqan3::qualified, + seqan3::qualified, seqan3::phred42>, + seqan3::dna4q>; INSTANTIATE_TYPED_TEST_SUITE_P(qualified, alphabet_, qualified_types, ); INSTANTIATE_TYPED_TEST_SUITE_P(qualified, semi_alphabet_test, qualified_types, );