You have called a method that returns a collection of objects, and you want a nicer read-out than the standard verify() will give you.
- Copy this starter text.
std::vector<std::string> objectsToVerify{"hello", "world"};
ApprovalTests::Approvals::verifyAll("TITLE", objectsToVerify);
which would produce:
TITLE
[0] = hello
[1] = world
- Replace the
objectsToVerify
container with your collection of objects. - Change the TITLE to something meaningful
- Run it, and approve the output.
For some examples, see VectorTests.cpp.
For advice on effective formatting, see Tips for Designing Strings. As you write out larger volumes of data in your approval files, experience has shown that the choice of layout of text in approval files can make a big difference to maintainability of tests, when failures occur.