xtd 0.2.0
Loading...
Searching...
No Matches

◆ matches_

#define matches_ (   ...)

#include <xtd.tunit/include/xtd/tunit/string_assert.h>

Asserts that matches regex pattern.

Parameters
regex_patternthe regex pattern.
actualthe actual value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::string_assert, xtd::tunit::string_assume and xtd::tunit::string_valid classes.
Examples
xtd::tunit::string_assert::matches_("^Hello", xtd::string("Hello, World!")); // test ok.
xtd::tunit::string_assert::matches_("^Salut", xtd::string("Hello, World!"), "User message..."); // test error.
xtd::tunit::string_assume::matches_("^Hello", xtd::string("Hello, World!")); // test ok.
xtd::tunit::string_assume::matches_("^Salut", xtd::string("Hello, World!"), "User message..."); // test error.
xtd::tunit::string_valid::matches_("^Hello", xtd::string("Hello, World!")); // test ok.
xtd::tunit::string_valid::matches_("^Salut", xtd::string("Hello, World!"), "User message..."); // test error.
Represents text as a sequence of character units.
Definition basic_string.h:79