// @requires-reflection #include #include #include namespace { using Void::Testing::Test; // setup()/teardown() run around each test method (a fresh instance per // test), exactly like the old Fixture base — but discovered by reflection. struct ContainerFixture : Void::Testing::Suite { std::vector vec; void setup() { vec = {1, 2, 3}; } void teardown() { vec.clear(); } Test size() { Void::Testing::expect_eq(vec.size(), 3u); } [[= Void::Testing::tag("slow")]] Test push_back() { vec.push_back(4); Void::Testing::expect_eq(vec.size(), 4u); Void::Testing::expect_eq(vec.back(), 4); } }; } // namespace