Lines Matching +full:string +full:- +full:array +full:- +full:property
7 | :----------------------------------- | :------------------------------------ |
14 results. For example, `EXPECT_THAT(some_bool, "some string")` will compile and
21 Built-in matchers (where `argument` is the function argument, e.g.
30 :-------------------------- | :-----------------------------------------------
37 | :--------------------- | :-------------------------------------------------- |
47 | `NotNull()` | `argument` is a non-null pointer (raw or smart). |
65 ## Floating-Point Matchers {#FpMatchers}
68 | :------------------------------- | :--------------------------------- |
73 | `IsNan()` | `argument` is any floating-point type with a NaN value. |
75 The above matchers use ULP-based comparison (the same as used in googletest).
83 | :------------------------------------------------ | :----------------------- |
89 ## String Matchers
91 The `argument` can be either a C string or a C++ string object:
94 | :---------------------- | :------------------------------------------------- |
95 | `ContainsRegex(string)` | `argument` matches the given regular expression. |
96 | `EndsWith(suffix)` | `argument` ends with string `suffix`. |
97 | `HasSubstr(string)` | `argument` contains `string` as a sub-string. |
98 | `IsEmpty()` | `argument` is an empty string. |
99 | `MatchesRegex(string)` | `argument` matches the given regular expression with the match startin…
100 | `StartsWith(prefix)` | `argument` starts with string `prefix`. |
101 | `StrCaseEq(string)` | `argument` is equal to `string`, ignoring case. |
102 | `StrCaseNe(string)` | `argument` is not equal to `string`, ignoring case. |
103 | `StrEq(string)` | `argument` is equal to `string`. |
104 | `StrNe(string)` | `argument` is not equal to `string`. |
105 … a base-64 escaped string whose unescaped string matches `m`. The web-safe format from [RFC 4648]…
109 [here](../advanced.md#regular-expression-syntax). All of these matchers, except
114 Most STL-style containers support `==`, so you can use `Eq(expected_container)`
116 write the elements in-line, match them more flexibly, or get more informative
120 | :---------------------------------------- | :------------------------------- |
126 | `ElementsAre(e0, e1, ..., en)` | `argument` has `n + 1` elements, where the *i*-th element matche…
127 …array)`, or `ElementsAreArray(array, count)` | The same as `ElementsAre()` except that the expecte…
129 …SubsetOf(a_container)`, `IsSubsetOf(begin, end)`, `IsSubsetOf(array)`, or `IsSubsetOf(array, count…
130 …tOf(a_container)`, `IsSupersetOf(begin, end)`, `IsSupersetOf(array)`, or `IsSupersetOf(array, coun…
131 …ainer`, and for all i, (the i-th element in `argument`, the i-th element in `container`) match `m`…
134 …array)`, or `UnorderedElementsAreArray(array, count)` | The same as `UnorderedElementsAre()` excep…
142 1. a native array passed by reference (e.g. in `Foo(const int (&a)[5])`),
144 2. an array passed as a pointer and a count (e.g. in `Bar(const T* buffer,
145 int len)` -- see [Multi-argument Matchers](#MultiArgMatchers)).
146 * The array being matched may be multi-dimensional (i.e. its elements can be
165 | :------------------------------ | :----------------------------------------- |
166 | `Field(&class::field, m)` | `argument.field` (or `argument->field` when `argument` is a pla…
167 | `Field(field_name, &class::field, m)` | The same as the two-parameter version, but provides a bet…
171 …Property(&class::property, m)` | `argument.property()` (or `argument->property()` when `argument` …
172 | `Property(property_name, &class::property, m)` | The same as the two-parameter version, but provi…
177 bindings, such as `std::tuple`, `std::pair`, `std::array`, and aggregate
181 std::tuple<int, std::string> my_tuple{7, "hello world"};
186 std::string greeting = "aloha";
192 * Don't use `Property()` against member functions that you do not own, because
199 | :--------------- | :------------------------------------------------ |
201 | `ResultOf(result_description, f, m)` | The same as the two-parameter version, but provides a bett…
206 | :------------------------ | :---------------------------------------------- |
212 ## Multi-argument Matchers {#MultiArgMatchers}
214 Technically, all matchers match a *single* value. A "multi-argument" matcher is
219 :------ | :----------
231 | :------------------------- | :---------------------------------------------- |
233 | `Args<N1, N2, ..., Nk>(m)` | The tuple of the `k` selected (using 0-based indices) arguments matc…
240 | :------------------------------- | :-------------------------------------- |
242 …array)`, or `AllOfArray(array, count)` | The same as `AllOf()` except that the matchers come from …
244 …array)`, or `AnyOfArray(array, count)` | The same as `AnyOf()` except that the matchers come from …
251 | :---------------------- | :------------------------------------ |
262 | :---------------------------- | :------------------------------------------ |
270 | :----------------------------------- | :------------------------------------ |
282 string.
288 return ExplainMatchResult(matcher, arg.nested().property(), result_listener);