mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Added basic tests for std::begin/end and friends (Issue #252).
This commit is contained in:
parent
0dd5f56bed
commit
32ee66d320
@ -872,6 +872,19 @@ SUITE(span_tests)
|
||||
|
||||
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 };
|
||||
span<int> s = a;
|
||||
@ -916,6 +929,19 @@ SUITE(span_tests)
|
||||
|
||||
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};
|
||||
span<int> s = a;
|
||||
|
Loading…
Reference in New Issue
Block a user