Standard container types were printed as `"{?}"`
(default `toString` implementation for unsupported class).
This was contradictory with the documentation:
> "Most [...] std types are supported out of the box"
when in fact only `string`, `vector` and `tupple` were supported.
- Renamed the `toStringVector.cpp` test file to `toStringContainers.cpp`
- Types are consider containers if they contain `value_type` and
`const_iterator` members and have `begin` and `end` support
(members or ADL findable) returning a `const_iterator`.
`const_iterator::operator*` must also return a `const value_type &`
- Beware that a trying to printing a type fulfilling those requirements
but returning invalid iterators will results in undefined behaviour. In
such case specialize the Catch::Detail::IsContainer trait to contain
`static const bool value = false` to revert to the default behaviour
(printing `"{?}"`).
Test pretty printing of `std::list`, `std::deque`, `std::forward_list`,
`std::array` in Catch assertion macro. More complex structure like
`std::queue` or `std::multi_map` should also be tested.
Signed-off-by: mat tso <mat-tso@topmail.ie>
This commit fixes the following scenario:
* You have a test that compares strings with embedded control
characters.
* The test fails.
* You are using JUnit tests within TeamCity.
Before this commit, the JUnit report watcher fails on parsing the XML
for two reasons: the control characters are missing a semicolon at the
end, and the XML document doesn't specify that it is XML 1.1.
XML 1.0 --- what we get if we don't specify an XML version --- doesn't support embedding control characters --- see
http://stackoverflow.com/questions/404107/why-are-control-characters-illegal-in-xml
for all of the gory details.
This is based on PR #588 by @mrpi
- simpler, polymorphic hierarchy-based, approach
- less bitty conditionals spread across the code
- all resolved up-front so now config class is immutable
(it had evolved the way it was and in need of a clean-up sweep for a long time)