is_contained_in

Macro is_contained_in 

Source
macro_rules! is_contained_in {
    ([$($matcher:expr),* $(,)?]) => { ... };
    ($($matcher:expr),* $(,)?) => { ... };
}
Expand description

Matches a JSON array where every element satisfies one of the provided matchers without reuse.

Matchers may remain unused; order is irrelevant.

§Examples

assert_that!(
    j!(["a", "b", j!("c")]),
    json::is_contained_in!["a", j!("c"), starts_with("b"), eq("d")]
);
assert_that!(
    j!(["a", "x"]),
    json::is_contained_in![eq("a"), eq("b")]
);

§Supported Inputs

  • Literal JSON-compatible values
  • Direct serde_json::Value
  • Native googletest matchers