Skip to content

Commit

Permalink
[MISC] style guide fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Lydia Buntrock <[email protected]>
  • Loading branch information
Irallia committed Mar 31, 2020
1 parent 3a9f06f commit 0ffaa02
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 81 deletions.
18 changes: 9 additions & 9 deletions test/unit/alphabet/adaptation/char_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ TYPED_TEST(char_adaptation, type_properties)

TYPED_TEST(char_adaptation, alphabet_char_t)
{
EXPECT_TRUE((std::is_same_v<seqan3::alphabet_char_t<TypeParam >, TypeParam>));
EXPECT_TRUE((std::is_same_v<seqan3::alphabet_char_t<TypeParam & >, TypeParam>));
EXPECT_TRUE((std::is_same_v<seqan3::alphabet_char_t<TypeParam>, TypeParam>));
EXPECT_TRUE((std::is_same_v<seqan3::alphabet_char_t<TypeParam &>, TypeParam>));
EXPECT_TRUE((std::is_same_v<seqan3::alphabet_char_t<TypeParam &&>, TypeParam>));
}

Expand All @@ -55,23 +55,23 @@ TYPED_TEST(char_adaptation, to_char)
TYPED_TEST(char_adaptation, assign_char_to)
{
TypeParam l{'A'};
EXPECT_TRUE((std::is_same_v<decltype(seqan3::assign_char_to('A', l )),
EXPECT_TRUE((std::is_same_v<decltype(seqan3::assign_char_to('A', l)),
seqan3::alphabet_char_t<TypeParam> &>));
EXPECT_TRUE((std::is_same_v<decltype(seqan3::assign_char_to('A', TypeParam{'A'})),
seqan3::alphabet_char_t<TypeParam> >));
seqan3::alphabet_char_t<TypeParam>>));
EXPECT_EQ((seqan3::assign_char_to('A', TypeParam{'C'})), l);
EXPECT_EQ((seqan3::assign_char_to('C', l )), TypeParam{'C'});
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<decltype(seqan3::assign_char_strictly_to('A', l )),
EXPECT_TRUE((std::is_same_v<decltype(seqan3::assign_char_strictly_to('A', l)),
seqan3::alphabet_char_t<TypeParam> &>));
EXPECT_TRUE((std::is_same_v<decltype(seqan3::assign_char_strictly_to('A', TypeParam{'A'})),
seqan3::alphabet_char_t<TypeParam> >));
seqan3::alphabet_char_t<TypeParam>>));
EXPECT_EQ((seqan3::assign_char_strictly_to('A', TypeParam{'C'})), l);
EXPECT_EQ((seqan3::assign_char_strictly_to('C', l )), TypeParam{'C'});
EXPECT_EQ((seqan3::assign_char_strictly_to('C', l)), TypeParam{'C'});
}

TYPED_TEST(char_adaptation, alphabet_rank_t)
Expand Down Expand Up @@ -99,7 +99,7 @@ TYPED_TEST(char_adaptation, assign_rank_to)
EXPECT_TRUE((std::is_same_v<decltype(seqan3::assign_rank_to(65, l)),
seqan3::alphabet_char_t<TypeParam> &>));
EXPECT_TRUE((std::is_same_v<decltype(seqan3::assign_rank_to(65, TypeParam{'A'})),
seqan3::alphabet_char_t<TypeParam> >));
seqan3::alphabet_char_t<TypeParam>>));
EXPECT_EQ((seqan3::assign_rank_to(65, TypeParam{'C'})), l);
EXPECT_EQ((seqan3::assign_rank_to(67, l)), TypeParam{'C'});
}
Expand Down
14 changes: 7 additions & 7 deletions test/unit/alphabet/adaptation/uint_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ TYPED_TEST(uint_adaptation, type_properties)

TYPED_TEST(uint_adaptation, alphabet_rank_t)
{
EXPECT_TRUE((std::is_same_v<seqan3::alphabet_rank_t<TypeParam >, TypeParam>));
EXPECT_TRUE((std::is_same_v<seqan3::alphabet_rank_t<TypeParam & >, TypeParam>));
EXPECT_TRUE((std::is_same_v<seqan3::alphabet_rank_t<TypeParam>, TypeParam>));
EXPECT_TRUE((std::is_same_v<seqan3::alphabet_rank_t<TypeParam &>, TypeParam>));
EXPECT_TRUE((std::is_same_v<seqan3::alphabet_rank_t<TypeParam &&>, TypeParam>));
}

Expand All @@ -61,7 +61,7 @@ TYPED_TEST(uint_adaptation, assign_rank)
EXPECT_TRUE((std::is_same_v<decltype(seqan3::assign_rank_to(65, l)),
seqan3::alphabet_rank_t<TypeParam> &>));
EXPECT_TRUE((std::is_same_v<decltype(seqan3::assign_rank_to(65, TypeParam{65})),
seqan3::alphabet_rank_t<TypeParam> >));
seqan3::alphabet_rank_t<TypeParam>>));
EXPECT_EQ((seqan3::assign_rank_to(65, TypeParam{65})), l);
EXPECT_EQ((seqan3::assign_rank_to(67, l)), TypeParam{67});
}
Expand Down Expand Up @@ -96,20 +96,20 @@ TYPED_TEST(uint_adaptation, assign_char)
EXPECT_TRUE((std::is_same_v<decltype(seqan3::assign_char_to('A', l)),
seqan3::alphabet_rank_t<TypeParam> &>));
EXPECT_TRUE((std::is_same_v<decltype(seqan3::assign_char_to('A', TypeParam{'A'})),
seqan3::alphabet_rank_t<TypeParam> >));
seqan3::alphabet_rank_t<TypeParam>>));
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<decltype(seqan3::assign_char_strictly_to('A', l )),
EXPECT_TRUE((std::is_same_v<decltype(seqan3::assign_char_strictly_to('A', l)),
seqan3::alphabet_rank_t<TypeParam> &>));
EXPECT_TRUE((std::is_same_v<decltype(seqan3::assign_char_strictly_to('A', TypeParam{'A'})),
seqan3::alphabet_rank_t<TypeParam> >));
seqan3::alphabet_rank_t<TypeParam>>));
EXPECT_EQ((seqan3::assign_char_strictly_to('A', TypeParam{67})), l);
EXPECT_EQ((seqan3::assign_char_strictly_to('C', l )), TypeParam{67});
EXPECT_EQ((seqan3::assign_char_strictly_to('C', l)), TypeParam{67});
}

TYPED_TEST(uint_adaptation, alphabet_size)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/alphabet/aminoacid/aa20_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ TEST(aa20, assign_char)
EXPECT_EQ((seqan3::assign_char_to(chr, seqan3::aa20{})), alp);
}

TEST(aa20,to_char)
TEST(aa20, to_char)
{
std::vector<char> chars
{
Expand Down
127 changes: 63 additions & 64 deletions test/unit/alphabet/composite/composite_integration_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,46 +281,46 @@ TEST(composite, custom_comparison)
EXPECT_LT(t11, 'G'_rna4);
EXPECT_LT(t11, seqan3::phred42{4});

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);
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);

seqan3::qualified<seqan3::aa27, seqan3::phred63> t21{'K'_aa27, seqan3::phred63{3}};
EXPECT_EQ(t21, 'K'_aa27);
EXPECT_EQ(t21, seqan3::phred63{3});
EXPECT_LT(t21, 'L'_aa27);
EXPECT_LT(t21, seqan3::phred63{4});

EXPECT_EQ('K'_aa27, t21);
EXPECT_EQ(seqan3::phred63{3}, t21);
EXPECT_LT('C'_aa27, t21);
EXPECT_LT(seqan3::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_gapped_dna_phred42 t31{'C'_dna4, seqan3::phred42{3}};
EXPECT_EQ(t31, 'C'_dna4);
EXPECT_EQ(t31, 'C'_rna4);
EXPECT_EQ(t31, seqan3::phred42{3});
EXPECT_NE(t31, seqan3::gap{});
EXPECT_EQ(t31, seqan3::gapped<seqan3::dna4>('C'_dna4));
EXPECT_LT(t31, 'G'_dna4); // *
EXPECT_LT(t31, 'G'_rna4); // *
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::gap{}); // *
EXPECT_LT(t31, seqan3::gapped<seqan3::dna4>('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<seqan3::dna4>('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<seqan3::dna4>('A'_dna4), t31);
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<seqan3::dna4>('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<seqan3::dna4>('A'_dna4), t31);

gapped_qualified_dna_phred42 t41{qualified_dna_phred42{'C'_dna4, seqan3::phred42{3}}};
EXPECT_EQ(t41, 'C'_dna4);
Expand All @@ -329,23 +329,23 @@ TEST(composite, custom_comparison)
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, '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, 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('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); // *
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);
Expand All @@ -354,47 +354,46 @@ TEST(composite, custom_comparison)
EXPECT_EQ(t51, seqan3::gapped<seqan3::dna4>('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<seqan3::dna4>('G'_dna4)); // not supposed to work
// 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<seqan3::dna4>('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<seqan3::dna4>('C'_dna4), t51);
EXPECT_EQ(seqan3::phred42{0}, t51);
EXPECT_EQ('C'_dna4, t51);
EXPECT_EQ('C'_rna4, t51);
EXPECT_NE(seqan3::gap{}, t51);
EXPECT_EQ(seqan3::gapped<seqan3::dna4>('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<seqan3::dna4>('A'_dna4), t51); // not supposed to work
EXPECT_GT(seqan3::phred42{1}, 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<seqan3::dna4>('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, 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); // *
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_)
{
using seqan3::get;
Expand Down

0 comments on commit 0ffaa02

Please sign in to comment.