You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`NanSensitiveDoubleNear(a_double, max_abs_error)`|`argument` is a `double` value close to `a_double` (absolute error <= `max_abs_error`), treating two NaNs as equal. |
82
83
|`NanSensitiveFloatNear(a_float, max_abs_error)`|`argument` is a `float` value close to `a_float` (absolute error <= `max_abs_error`), treating two NaNs as equal. |
83
84
84
-
###String Matchers
85
+
## String Matchers
85
86
86
87
The `argument` can be either a C string or a C++ string object:
87
88
@@ -103,7 +104,7 @@ use the regular expression syntax defined
103
104
[here](../advanced.md#regular-expression-syntax). All of these matchers, except
104
105
`ContainsRegex()` and `MatchesRegex()` work for wide strings as well.
105
106
106
-
###Container Matchers
107
+
## Container Matchers
107
108
108
109
Most STL-style containers support `==`, so you can use `Eq(expected_container)`
109
110
or simply `expected_container` to match a container exactly. If you want to
|`Pointer(m)`|`argument` (either a smart pointer or a raw pointer) contains a pointer that matches `m`. `m` will match against the raw pointer regardless of the type of `argument`. |
203
204
|`WhenDynamicCastTo<T>(m)`| when `argument` is passed through `dynamic_cast<T>()`, it matches matcher `m`. |
204
205
205
-
###Multi-argument Matchers {#MultiArgMatchers}
206
+
## Multi-argument Matchers {#MultiArgMatchers}
206
207
207
208
Technically, all matchers match a *single* value. A "multi-argument" matcher is
208
209
just one that matches a *tuple*. The following matchers can be used to match a
@@ -225,7 +226,7 @@ reorder them) to participate in the matching:
225
226
|`AllArgs(m)`| Equivalent to `m`. Useful as syntactic sugar in `.With(AllArgs(m))`. |
226
227
|`Args<N1, N2, ..., Nk>(m)`| The tuple of the `k` selected (using 0-based indices) arguments matches `m`, e.g. `Args<1, 2>(Eq())`. |
227
228
228
-
###Composite Matchers
229
+
## Composite Matchers
229
230
230
231
You can make a matcher from one or more other matchers:
231
232
@@ -237,7 +238,7 @@ You can make a matcher from one or more other matchers:
237
238
|`AnyOfArray({m0, m1, ..., mn})`, `AnyOfArray(a_container)`, `AnyOfArray(begin, end)`, `AnyOfArray(array)`, or `AnyOfArray(array, count)`| The same as `AnyOf()` except that the matchers come from an initializer list, STL-style container, iterator range, or C-style array. |
0 commit comments