Add a test with an empty input range - should do nothing

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305268 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2017-06-13 02:28:40 +00:00
parent 3128b5abf0
commit 6bb9569124

View File

@@ -122,6 +122,12 @@ void basic_tests()
assert(v[i] == 40 + triangle(i));
}
{
std::vector<int> v, res;
std::transform_exclusive_scan(v.begin(), v.end(), std::back_inserter(res), 40, std::plus<>(), identity<>());
assert(res.empty());
}
// Make sure that the calculations are done using the init typedef
{
std::vector<unsigned char> v(10);