assert_matches_regex 0.1.0

Macro for asserting that a string matches a regex
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented1 out of 1 items with examples
  • Size
  • Source code size: 19.26 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.35 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • zertosh/assert_matches_regex
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • zertosh

assert_matches_regex

Provides a macro, assert_matches_regex, which tests whether a string matches a given regex, causing a panic if it does not match.

CI Latest version Documentation License

[dev-dependencies]
assert_matches_regex = "0.1"

Example

use assert_matches_regex::assert_matches_regex;

assert_matches_regex!("Hello!", r"(?i)hello");

let data = "deadc0de";
assert_matches_regex!(data, "^[a-f0-9]$", "expected `{data}` to be a hex string");

License