Test that we can copy the iterators. (#1466)

This commit is contained in:
Daniel Lemire 2021-03-01 18:46:50 -05:00 committed by GitHub
parent 9d22372cc9
commit 036151c1e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -312,10 +312,12 @@ namespace document_stream_tests {
simdjson::dom::document_stream stream;
ASSERT_SUCCESS( parser.parse_many(json).get(stream) );
size_t count = 0;
simdjson::dom::document_stream::iterator previous_i; // just to check we can copy iters
// We do not touch the document, intentionally.
for(auto i = stream.begin(); i != stream.end(); ++i) {
if(count > 10) { break; }
count++;
previous_i = i;
}
return count == 1;
}