1 #pragma once 2 3 #include "rapidcheck/seq/Operations.h" 4 5 namespace rc { 6 namespace test { 7 8 /// Forwards Seq a random amount and copies it to see if it is equal to the 9 /// original. Must not be infinite, of course. 10 template <typename T> assertEqualCopies(Seq<T> seq)11void assertEqualCopies(Seq<T> seq) { 12 std::size_t len = seq::length(seq); 13 if (len != 0) { 14 std::size_t n = *gen::inRange<std::size_t>(0, len * 2); 15 while (n--) { 16 seq.next(); 17 } 18 } 19 const auto copy = seq; 20 RC_ASSERT(copy == seq); 21 } 22 23 } // namespace test 24 } // namespace rc 25