Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
assert_matches in snapbox - Rust
[go: Go Back, main page]

pub fn assert_matches(pattern: impl Into<Data>, actual: impl Into<Data>)
Expand description

Check if a value matches a pattern

Pattern syntax:

  • ... is a line-wildcard when on a line by itself
  • [..] is a character-wildcard when inside a line
  • [EXE] matches .exe on Windows

Normalization:

  • Newlines
  • \ to /
let output = "something";
let expected = "so[..]g";
snapbox::assert_matches(expected, output);