Macro pact_consumer::term

source ·
macro_rules! term {
    ($regex:expr, $example:expr) => { ... };
}
Expand description

A pattern which matches the regular expression $regex (specified as a string) literal, and which generates $example. This is an alias for matching_regex!

use pact_consumer::*;

json_pattern!({
  // Match a string consisting of numbers and lower case letters, and
  // generate `"10a"`.$crate::patterns::
  "id_string": term!("^[0-9a-z]$", "10a")
});