Exception message testing now supports wildcards
- extracted WildcardPattern from TestSpec::NamePattern
This commit is contained in:
1 parent
93a842e2f0
commit
2104ca2aa4
10 files changed
+234
-51
No files matched your search
@@ -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