From 32ee66d3201179b261cf498ab41b11966aab6c35 Mon Sep 17 00:00:00 2001 From: Neil MacIntosh Date: Mon, 8 Aug 2016 13:48:12 -0700 Subject: [PATCH] Added basic tests for std::begin/end and friends (Issue #252). --- tests/span_tests.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/span_tests.cpp b/tests/span_tests.cpp index 55610c7..5e71410 100644 --- a/tests/span_tests.cpp +++ b/tests/span_tests.cpp @@ -872,6 +872,19 @@ SUITE(span_tests) TEST(begin_end) { + { + int a[] = { 1, 2, 3, 4 }; + span s = a; + + span::iterator it = s.begin(); + span::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 s = a; @@ -916,6 +929,19 @@ SUITE(span_tests) TEST(cbegin_cend) { + { + int a[] = { 1, 2, 3, 4 }; + span s = a; + + span::const_iterator cit = s.cbegin(); + span::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 s = a;