mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-25 23:06:10 +01:00
Standardize matcher headers to use .hpp suffix
This commit is contained in:
parent
64d7f9b98a
commit
c2daf468bb
@ -47,8 +47,8 @@ _both_ ends with the suffix "as a service" _and_ contains the string
|
|||||||
|
|
||||||
|
|
||||||
Both of the string matchers used in the examples above live in the
|
Both of the string matchers used in the examples above live in the
|
||||||
`catch_matchers_string.h` header, so to compile the code above also
|
`catch_matchers_string.hpp` header, so to compile the code above also
|
||||||
requires `#include <catch2/matchers/catch_matchers_string.h>`.
|
requires `#include <catch2/matchers/catch_matchers_string.hpp>`.
|
||||||
|
|
||||||
**IMPORTANT**: The combining operators do not take ownership of the
|
**IMPORTANT**: The combining operators do not take ownership of the
|
||||||
matcher objects being combined. This means that if you store combined
|
matcher objects being combined. This means that if you store combined
|
||||||
@ -108,7 +108,7 @@ the regex `"abc"` will not match input string `"abcd"`. To match
|
|||||||
The second argument sets whether the matching should be case-sensitive
|
The second argument sets whether the matching should be case-sensitive
|
||||||
or not. By default, it is case-sensitive.
|
or not. By default, it is case-sensitive.
|
||||||
|
|
||||||
> `std::string` matchers live in `catch2/matchers/catch_matchers_string.h`
|
> `std::string` matchers live in `catch2/matchers/catch_matchers_string.hpp`
|
||||||
|
|
||||||
|
|
||||||
### Vector matchers
|
### Vector matchers
|
||||||
@ -136,7 +136,7 @@ An example usage:
|
|||||||
This assertions will pass, because the elements given to the matchers
|
This assertions will pass, because the elements given to the matchers
|
||||||
are a permutation of the ones in `some_vec`.
|
are a permutation of the ones in `some_vec`.
|
||||||
|
|
||||||
> vector matchers live in `catch2/matchers/catch_matchers_vector.h`
|
> vector matchers live in `catch2/matchers/catch_matchers_vector.hpp`
|
||||||
|
|
||||||
|
|
||||||
### Floating point matchers
|
### Floating point matchers
|
||||||
@ -187,7 +187,7 @@ to zero, we would write this assertion:
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
> floating point matchers live in `catch2/matchers/catch_matchers_floating.h`
|
> floating point matchers live in `catch2/matchers/catch_matchers_floating.hpp`
|
||||||
|
|
||||||
|
|
||||||
### Miscellaneous matchers
|
### Miscellaneous matchers
|
||||||
@ -223,7 +223,7 @@ Catch2 provides an utility macro for asserting that an expression
|
|||||||
throws exception of specific type, and that the exception has desired
|
throws exception of specific type, and that the exception has desired
|
||||||
properties. The macro is `REQUIRE_THROWS_MATCHES(expr, ExceptionType, Matcher)`.
|
properties. The macro is `REQUIRE_THROWS_MATCHES(expr, ExceptionType, Matcher)`.
|
||||||
|
|
||||||
> `REQUIRE_THROWS_MATCHES` macro lives in `catch2/matchers/catch_matchers.h`
|
> `REQUIRE_THROWS_MATCHES` macro lives in `catch2/matchers/catch_matchers.hpp`
|
||||||
|
|
||||||
|
|
||||||
Catch2 currently provides only one matcher for exceptions,
|
Catch2 currently provides only one matcher for exceptions,
|
||||||
@ -311,7 +311,7 @@ written using the new style, combining old style matchers should
|
|||||||
generally compile faster. Also note that you can combine old and new
|
generally compile faster. Also note that you can combine old and new
|
||||||
style matchers arbitrarily.
|
style matchers arbitrarily.
|
||||||
|
|
||||||
> `MatcherBase` lives in `catch2/matchers/catch_matchers.h`
|
> `MatcherBase` lives in `catch2/matchers/catch_matchers.hpp`
|
||||||
|
|
||||||
|
|
||||||
## Writing custom matchers (new style)
|
## Writing custom matchers (new style)
|
||||||
|
@ -72,13 +72,13 @@ set(INTERNAL_HEADERS
|
|||||||
${SOURCES_DIR}/catch_interfaces_testcase.h
|
${SOURCES_DIR}/catch_interfaces_testcase.h
|
||||||
${SOURCES_DIR}/catch_leak_detector.h
|
${SOURCES_DIR}/catch_leak_detector.h
|
||||||
${SOURCES_DIR}/catch_list.h
|
${SOURCES_DIR}/catch_list.h
|
||||||
${SOURCES_DIR}/matchers/catch_matchers.h
|
${SOURCES_DIR}/matchers/catch_matchers.hpp
|
||||||
${SOURCES_DIR}/matchers/catch_matchers_exception.hpp
|
${SOURCES_DIR}/matchers/catch_matchers_exception.hpp
|
||||||
${SOURCES_DIR}/matchers/catch_matchers_floating.h
|
${SOURCES_DIR}/matchers/catch_matchers_floating.hpp
|
||||||
${SOURCES_DIR}/matchers/catch_matchers_generic.hpp
|
${SOURCES_DIR}/matchers/catch_matchers_generic.hpp
|
||||||
${SOURCES_DIR}/matchers/catch_matchers_string.h
|
${SOURCES_DIR}/matchers/catch_matchers_string.hpp
|
||||||
${SOURCES_DIR}/matchers/catch_matchers_templates.hpp
|
${SOURCES_DIR}/matchers/catch_matchers_templates.hpp
|
||||||
${SOURCES_DIR}/matchers/catch_matchers_vector.h
|
${SOURCES_DIR}/matchers/catch_matchers_vector.hpp
|
||||||
${SOURCES_DIR}/catch_message.h
|
${SOURCES_DIR}/catch_message.h
|
||||||
${SOURCES_DIR}/catch_meta.hpp
|
${SOURCES_DIR}/catch_meta.hpp
|
||||||
${SOURCES_DIR}/catch_objc.hpp
|
${SOURCES_DIR}/catch_objc.hpp
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <catch2/catch_interfaces_registry_hub.h>
|
#include <catch2/catch_interfaces_registry_hub.h>
|
||||||
#include <catch2/internal/catch_capture_matchers.h>
|
#include <catch2/internal/catch_capture_matchers.h>
|
||||||
#include <catch2/catch_run_context.h>
|
#include <catch2/catch_run_context.h>
|
||||||
#include <catch2/matchers/catch_matchers_string.h>
|
#include <catch2/matchers/catch_matchers_string.hpp>
|
||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
*/
|
*/
|
||||||
#include <catch2/internal/catch_capture_matchers.h>
|
#include <catch2/internal/catch_capture_matchers.h>
|
||||||
#include <catch2/matchers/catch_matchers.h>
|
#include <catch2/matchers/catch_matchers.hpp>
|
||||||
#include <catch2/catch_interfaces_registry_hub.h>
|
#include <catch2/catch_interfaces_registry_hub.h>
|
||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <catch2/matchers/catch_matchers.h>
|
#include <catch2/matchers/catch_matchers.hpp>
|
||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#ifndef TWOBLUECUBES_CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED
|
#ifndef TWOBLUECUBES_CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED
|
||||||
#define TWOBLUECUBES_CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED
|
#define TWOBLUECUBES_CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED
|
||||||
|
|
||||||
#include <catch2/matchers/catch_matchers.h>
|
#include <catch2/matchers/catch_matchers.hpp>
|
||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
namespace Matchers {
|
namespace Matchers {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <catch2/matchers/catch_matchers_floating.h>
|
#include <catch2/matchers/catch_matchers_floating.hpp>
|
||||||
#include <catch2/catch_enforce.h>
|
#include <catch2/catch_enforce.h>
|
||||||
#include <catch2/catch_polyfills.hpp>
|
#include <catch2/catch_polyfills.hpp>
|
||||||
#include <catch2/catch_to_string.hpp>
|
#include <catch2/catch_to_string.hpp>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#ifndef TWOBLUECUBES_CATCH_MATCHERS_FLOATING_H_INCLUDED
|
#ifndef TWOBLUECUBES_CATCH_MATCHERS_FLOATING_H_INCLUDED
|
||||||
#define TWOBLUECUBES_CATCH_MATCHERS_FLOATING_H_INCLUDED
|
#define TWOBLUECUBES_CATCH_MATCHERS_FLOATING_H_INCLUDED
|
||||||
|
|
||||||
#include <catch2/matchers/catch_matchers.h>
|
#include <catch2/matchers/catch_matchers.hpp>
|
||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
namespace Matchers {
|
namespace Matchers {
|
@ -8,7 +8,7 @@
|
|||||||
#define TWOBLUECUBES_CATCH_MATCHERS_GENERIC_HPP_INCLUDED
|
#define TWOBLUECUBES_CATCH_MATCHERS_GENERIC_HPP_INCLUDED
|
||||||
|
|
||||||
#include <catch2/catch_common.h>
|
#include <catch2/catch_common.h>
|
||||||
#include <catch2/matchers/catch_matchers.h>
|
#include <catch2/matchers/catch_matchers.hpp>
|
||||||
#include <catch2/catch_meta.hpp>
|
#include <catch2/catch_meta.hpp>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <catch2/matchers/catch_matchers_string.h>
|
#include <catch2/matchers/catch_matchers_string.hpp>
|
||||||
#include <catch2/catch_string_manip.h>
|
#include <catch2/catch_string_manip.h>
|
||||||
#include <catch2/catch_tostring.h>
|
#include <catch2/catch_tostring.h>
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#ifndef TWOBLUECUBES_CATCH_MATCHERS_STRING_H_INCLUDED
|
#ifndef TWOBLUECUBES_CATCH_MATCHERS_STRING_H_INCLUDED
|
||||||
#define TWOBLUECUBES_CATCH_MATCHERS_STRING_H_INCLUDED
|
#define TWOBLUECUBES_CATCH_MATCHERS_STRING_H_INCLUDED
|
||||||
|
|
||||||
#include <catch2/matchers/catch_matchers.h>
|
#include <catch2/matchers/catch_matchers.hpp>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
#define TWOBLUECUBES_CATCH_MATCHERS_TEMPLATES_HPP_INCLUDED
|
#define TWOBLUECUBES_CATCH_MATCHERS_TEMPLATES_HPP_INCLUDED
|
||||||
|
|
||||||
#include <catch2/catch_common.h>
|
#include <catch2/catch_common.h>
|
||||||
#include <catch2/matchers/catch_matchers.h>
|
#include <catch2/matchers/catch_matchers.hpp>
|
||||||
#include <catch2/catch_stringref.h>
|
#include <catch2/catch_stringref.h>
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#ifndef TWOBLUECUBES_CATCH_MATCHERS_VECTOR_H_INCLUDED
|
#ifndef TWOBLUECUBES_CATCH_MATCHERS_VECTOR_H_INCLUDED
|
||||||
#define TWOBLUECUBES_CATCH_MATCHERS_VECTOR_H_INCLUDED
|
#define TWOBLUECUBES_CATCH_MATCHERS_VECTOR_H_INCLUDED
|
||||||
|
|
||||||
#include <catch2/matchers/catch_matchers.h>
|
#include <catch2/matchers/catch_matchers.hpp>
|
||||||
#include <catch2/catch_approx.h>
|
#include <catch2/catch_approx.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
@ -6,7 +6,7 @@
|
|||||||
// the other branch as well
|
// the other branch as well
|
||||||
#include <catch2/catch_test_macros.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
#include <catch2/matchers/catch_matchers_generic.hpp>
|
#include <catch2/matchers/catch_matchers_generic.hpp>
|
||||||
#include <catch2/matchers/catch_matchers_string.h>
|
#include <catch2/matchers/catch_matchers_string.hpp>
|
||||||
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include <catch2/catch_approx.h>
|
#include <catch2/catch_approx.h>
|
||||||
#include <catch2/catch_test_macros.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
#include <catch2/matchers/catch_matchers_string.h>
|
#include <catch2/matchers/catch_matchers_string.hpp>
|
||||||
#include <catch2/catch_test_spec_parser.h>
|
#include <catch2/catch_test_spec_parser.h>
|
||||||
#include <catch2/catch_test_case_info.h>
|
#include <catch2/catch_test_case_info.h>
|
||||||
#include <catch2/catch_config.hpp>
|
#include <catch2/catch_config.hpp>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <catch2/catch_test_macros.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
#include <catch2/matchers/catch_matchers_vector.h>
|
#include <catch2/matchers/catch_matchers_vector.hpp>
|
||||||
#include <catch2/catch_string_manip.h>
|
#include <catch2/catch_string_manip.h>
|
||||||
|
|
||||||
static const char * const no_whitespace = "There is no extra whitespace here";
|
static const char * const no_whitespace = "There is no extra whitespace here";
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <catch2/matchers/catch_matchers_string.h>
|
#include <catch2/matchers/catch_matchers_string.hpp>
|
||||||
#include <catch2/matchers/catch_matchers_vector.h>
|
#include <catch2/matchers/catch_matchers_vector.hpp>
|
||||||
#include <catch2/catch_tag_alias_registry.h>
|
#include <catch2/catch_tag_alias_registry.h>
|
||||||
#include <catch2/catch_test_macros.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
#include <catch2/catch_test_case_info.h>
|
#include <catch2/catch_test_case_info.h>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <catch2/catch_enum_values_registry.h>
|
#include <catch2/catch_enum_values_registry.h>
|
||||||
#include <catch2/matchers/catch_matchers_vector.h>
|
#include <catch2/matchers/catch_matchers_vector.hpp>
|
||||||
#include <catch2/catch_test_macros.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
|
||||||
enum class EnumClass3 { Value1, Value2, Value3, Value4 };
|
enum class EnumClass3 { Value1, Value2, Value3, Value4 };
|
||||||
|
@ -29,7 +29,7 @@ std::ostream& operator<<(std::ostream& out, foo::helper_1403 const&) {
|
|||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
|
|
||||||
#include <catch2/catch_test_macros.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
#include <catch2/matchers/catch_matchers_string.h>
|
#include <catch2/matchers/catch_matchers_string.hpp>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <catch2/catch_test_macros.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
#include <catch2/matchers/catch_matchers_string.h>
|
#include <catch2/matchers/catch_matchers_string.hpp>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
|
|
||||||
#include <catch2/catch_test_macros.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
#include <catch2/matchers/catch_matchers_exception.hpp>
|
#include <catch2/matchers/catch_matchers_exception.hpp>
|
||||||
#include <catch2/matchers/catch_matchers_floating.h>
|
#include <catch2/matchers/catch_matchers_floating.hpp>
|
||||||
#include <catch2/matchers/catch_matchers_generic.hpp>
|
#include <catch2/matchers/catch_matchers_generic.hpp>
|
||||||
#include <catch2/matchers/catch_matchers_string.h>
|
#include <catch2/matchers/catch_matchers_string.hpp>
|
||||||
#include <catch2/matchers/catch_matchers_vector.h>
|
#include <catch2/matchers/catch_matchers_vector.hpp>
|
||||||
#include <catch2/matchers/catch_matchers_templates.hpp>
|
#include <catch2/matchers/catch_matchers_templates.hpp>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
Loading…
Reference in New Issue
Block a user