mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-18 02:45:40 +02:00
Exception message testing now supports wildcards
- extracted WildcardPattern from TestSpec::NamePattern
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
#include "catch_interfaces_runner.h"
|
||||
#include "catch_interfaces_capture.h"
|
||||
#include "catch_interfaces_registry_hub.h"
|
||||
|
||||
#include "catch_wildcard_pattern.hpp"
|
||||
|
||||
namespace Catch {
|
||||
|
||||
@@ -78,7 +78,8 @@ namespace Catch {
|
||||
if( expectedMessage != "" ) {
|
||||
|
||||
std::string actualMessage = Catch::translateActiveException();
|
||||
if( expectedMessage != actualMessage ) {
|
||||
WildcardPattern pattern( expectedMessage, WildcardPattern::CaseInsensitive );
|
||||
if( !pattern.matches( actualMessage ) ) {
|
||||
data.resultType = ResultWas::ExpressionFailed;
|
||||
data.reconstructedExpression = actualMessage;
|
||||
}
|
||||
|
Reference in New Issue
Block a user