diff --git a/src/tests/util/buffer.cpp b/src/tests/util/buffer.cpp index 71caa5d41..f952e7658 100644 --- a/src/tests/util/buffer.cpp +++ b/src/tests/util/buffer.cpp @@ -44,8 +44,23 @@ static void tst1() { lean_assert(b1.back() == 10); } +static void tst2() { + buffer b1; + buffer b2; + b1.push_back(1); b1.push_back(2); b1.push_back(3); + b2 = b1; + lean_assert(b1.size() == 3); + b2.resize(2); + lean_assert(b2.size() == 2); + b2.resize(10, 0); + lean_assert(b2.size() == 10); + b2.resize(1); + lean_assert(b2.size() == 1); +} + int main() { loop>(100); tst1(); + tst2(); return has_violations() ? 1 : 0; }