summaryrefslogtreecommitdiff
path: root/AK/Tests/TestVector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'AK/Tests/TestVector.cpp')
-rw-r--r--AK/Tests/TestVector.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/AK/Tests/TestVector.cpp b/AK/Tests/TestVector.cpp
index facff343cf..59e1cd0544 100644
--- a/AK/Tests/TestVector.cpp
+++ b/AK/Tests/TestVector.cpp
@@ -26,9 +26,9 @@
#include <AK/TestSuite.h>
-#include <AK/String.h>
#include <AK/NonnullOwnPtrVector.h>
#include <AK/OwnPtr.h>
+#include <AK/String.h>
#include <AK/Vector.h>
TEST_CASE(construct)
@@ -313,4 +313,18 @@ TEST_CASE(insert_trivial)
EXPECT_EQ(ints[5], 40);
}
+TEST_CASE(resize_initializes)
+{
+ struct A {
+ A() { initialized = true; }
+ bool initialized { false };
+ };
+
+ Vector<A> ints;
+ ints.resize(32);
+
+ for (size_t idx = 0; idx < 32; ++idx)
+ EXPECT(ints[idx].initialized);
+}
+
TEST_MAIN(Vector)