1 // Copyright 2022 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //      http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 //! All built-in matchers of this crate are in submodules of this module.
16 
17 mod all_matcher;
18 mod any_matcher;
19 mod anything_matcher;
20 mod char_count_matcher;
21 mod conjunction_matcher;
22 mod container_eq_matcher;
23 mod contains_matcher;
24 mod contains_regex_matcher;
25 mod disjunction_matcher;
26 mod display_matcher;
27 mod each_matcher;
28 mod elements_are_matcher;
29 mod empty_matcher;
30 mod eq_deref_of_matcher;
31 mod eq_matcher;
32 mod err_matcher;
33 mod field_matcher;
34 mod ge_matcher;
35 mod gt_matcher;
36 mod has_entry_matcher;
37 mod is_encoded_string_matcher;
38 mod is_matcher;
39 mod is_nan_matcher;
40 mod le_matcher;
41 mod len_matcher;
42 mod lt_matcher;
43 mod matches_pattern;
44 mod matches_regex_matcher;
45 mod near_matcher;
46 mod none_matcher;
47 mod not_matcher;
48 mod ok_matcher;
49 mod points_to_matcher;
50 mod pointwise_matcher;
51 mod predicate_matcher;
52 mod property_matcher;
53 mod some_matcher;
54 mod str_matcher;
55 mod subset_of_matcher;
56 mod superset_of_matcher;
57 mod tuple_matcher;
58 mod unordered_elements_are_matcher;
59 
60 pub use anything_matcher::anything;
61 pub use char_count_matcher::char_count;
62 pub use container_eq_matcher::container_eq;
63 pub use contains_matcher::{contains, ContainsMatcher};
64 pub use contains_regex_matcher::contains_regex;
65 pub use display_matcher::displays_as;
66 pub use each_matcher::each;
67 pub use empty_matcher::empty;
68 pub use eq_deref_of_matcher::eq_deref_of;
69 pub use eq_matcher::{eq, EqMatcher};
70 pub use err_matcher::err;
71 pub use ge_matcher::ge;
72 pub use gt_matcher::gt;
73 pub use has_entry_matcher::has_entry;
74 pub use is_encoded_string_matcher::is_utf8_string;
75 pub use is_nan_matcher::is_nan;
76 pub use le_matcher::le;
77 pub use len_matcher::len;
78 pub use lt_matcher::lt;
79 pub use matches_regex_matcher::matches_regex;
80 pub use near_matcher::{approx_eq, near, NearMatcher};
81 pub use none_matcher::none;
82 pub use not_matcher::not;
83 pub use ok_matcher::ok;
84 pub use points_to_matcher::points_to;
85 pub use predicate_matcher::{predicate, PredicateMatcher};
86 pub use some_matcher::some;
87 pub use str_matcher::{
88     contains_substring, ends_with, starts_with, StrMatcher, StrMatcherConfigurator,
89 };
90 pub use subset_of_matcher::subset_of;
91 pub use superset_of_matcher::superset_of;
92 
93 // Reexport and unmangle the macros.
94 #[doc(inline)]
95 pub use crate::{
96     __all as all, __any as any, __contains_each as contains_each, __elements_are as elements_are,
97     __field as field, __is_contained_in as is_contained_in, __matches_pattern as matches_pattern,
98     __pat as pat, __pointwise as pointwise, __property as property,
99     __unordered_elements_are as unordered_elements_are,
100 };
101 
102 // Types and functions used by macros matchers.
103 // Do not use directly.
104 // We may perform incompatible changes without major release. These elements
105 // should only be used through their respective macros.
106 #[doc(hidden)]
107 pub mod __internal_unstable_do_not_depend_on_these {
108     pub use super::all_matcher::internal::AllMatcher;
109     pub use super::any_matcher::internal::AnyMatcher;
110     pub use super::conjunction_matcher::ConjunctionMatcher;
111     pub use super::disjunction_matcher::DisjunctionMatcher;
112     pub use super::elements_are_matcher::internal::ElementsAre;
113     pub use super::field_matcher::internal::field_matcher;
114     pub use super::is_matcher::is;
115     pub use super::pointwise_matcher::internal::PointwiseMatcher;
116     pub use super::property_matcher::internal::{property_matcher, property_ref_matcher};
117     pub use super::unordered_elements_are_matcher::internal::{
118         Requirements, UnorderedElementsAreMatcher, UnorderedElementsOfMapAreMatcher,
119     };
120 }
121