Skip to content

Commit

Permalink
test travis bug?
Browse files Browse the repository at this point in the history
  • Loading branch information
marehr committed Dec 7, 2017
1 parent c136544 commit 3ba7ece
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions test/range/container/container_concept_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,60 @@ TEST(container_concept, container_concept)
EXPECT_TRUE((seqan3::container_concept<std::string>));
}

TEST(container_concept, container_concept_travis_bug)
{
// travis failed on this statement
// concept bool sequence_concept = requires (type val, type val2)
// ^~~~~~~~~~~~~~~~
// /include/seqan3/range/container/concept.hpp:113:14: note: with ‘std::basic_string<char> val’
// /include/seqan3/range/container/concept.hpp:113:14: note: with ‘std::basic_string<char> val2’
// /include/seqan3/range/container/concept.hpp:113:14: note: the required expression ‘val.insert(val.cbegin(), val2.front())’ would be ill-formed
// /include/seqan3/range/container/concept.hpp:113:14: note: the required expression ‘val.insert(val.cbegin(), typename type::value_type{})’ would be ill-formed
// /include/seqan3/range/container/concept.hpp:113:14: note: the required expression ‘val.insert(val.cbegin(), typename type::size_type{}, typename type::value_type{})’ would be ill-formed
// /include/seqan3/range/container/concept.hpp:113:14: note: the required expression ‘val.insert(val.cbegin(), val2.begin(), val2.end())’ would be ill-formed
// /include/seqan3/range/container/concept.hpp:113:14: note: the required expression ‘val.erase(val.cbegin())’ would be ill-formed
// /include/seqan3/range/container/concept.hpp:113:14: note: the required expression ‘val.erase(val.cbegin(), val.cend())’ would be ill-formed

std::string s = "xmplr";

// insert(size_type index, size_type count, char ch)
s.insert(0, 1, 'E');
EXPECT_EQ("Exmplr", s);

// insert(size_type index, const char* s)
s.insert(2, "e");
EXPECT_EQ("Exemplr", s);

// insert(size_type index, string const& str)
s.insert(6, "a"s);
EXPECT_EQ("Exemplar", s);

// insert(size_type index, string const& str,
// size_type index_str, size_type count)
s.insert(8, " is an example string."s, 0, 14);
EXPECT_EQ("Exemplar is an example", s);

// insert(const_iterator pos, char ch)
s.insert(s.cbegin() + s.find_first_of('n') + 1, ':');
EXPECT_EQ("Exemplar is an: example", s);

// insert(const_iterator pos, size_type count, char ch)
s.insert(s.cbegin() + s.find_first_of(':') + 1, 2, '=');
EXPECT_EQ("Exemplar is an:== example", s);

// insert(const_iterator pos, InputIt first, InputIt last)
{
std::string seq = " string";
s.insert(s.begin() + s.find_last_of('e') + 1,
std::begin(seq), std::end(seq));
EXPECT_EQ("Exemplar is an:== example string", s);
}

// insert(const_iterator pos, std::initializer_list<char>)
s.insert(s.cbegin() + s.find_first_of('g') + 1, { '.' });
EXPECT_EQ("Exemplar is an:== example string.", s);
}

TEST(container_concept, sequence_concept)
{
EXPECT_FALSE((seqan3::sequence_concept<std::array<char, 2>>));
Expand Down

0 comments on commit 3ba7ece

Please sign in to comment.