Added basic tests for std::begin/end and friends (Issue #252).

This commit is contained in:
Neil MacIntosh 2016-08-08 13:48:12 -07:00
parent 0dd5f56bed
commit 32ee66d320

View File

@ -872,6 +872,19 @@ SUITE(span_tests)
TEST(begin_end) TEST(begin_end)
{ {
{
int a[] = { 1, 2, 3, 4 };
span<int> s = a;
span<int>::iterator it = s.begin();
span<int>::iterator it2 = std::begin(s);
CHECK(it == it2);
it = s.end();
it2 = std::end(s);
CHECK(it == it2);
}
{ {
int a[] = { 1, 2, 3, 4 }; int a[] = { 1, 2, 3, 4 };
span<int> s = a; span<int> s = a;
@ -916,6 +929,19 @@ SUITE(span_tests)
TEST(cbegin_cend) TEST(cbegin_cend)
{ {
{
int a[] = { 1, 2, 3, 4 };
span<int> s = a;
span<int>::const_iterator cit = s.cbegin();
span<int>::const_iterator cit2 = std::cbegin(s);
CHECK(cit == cit2);
cit = s.cend();
cit2 = std::cend(s);
CHECK(cit == cit2);
}
{ {
int a[] = {1, 2, 3, 4}; int a[] = {1, 2, 3, 4};
span<int> s = a; span<int> s = a;