Skip to content

Commit bbeb3e4

Browse files
Merge pull request #363 from google:empty_any
PiperOrigin-RevId: 605637344
2 parents 65af6d4 + c44e109 commit bbeb3e4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

googletest/src/matchers/any_matcher.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
#[doc(hidden)]
5757
macro_rules! __any {
5858
($(,)?) => {{
59-
std::compile_error!("any![...] expects at least one argument");
59+
$crate::matchers::not($crate::matchers::anything())
6060
}} ;
6161
($matcher:expr $(,)?) => {{
6262
$matcher
@@ -129,4 +129,9 @@ mod tests {
129129
displays_as(eq("which does not start with \"Another\""))
130130
)
131131
}
132+
133+
#[test]
134+
fn empty_any_matcher_never_matches() -> Result<()> {
135+
verify_that!(123, not(any![]))
136+
}
132137
}

0 commit comments

Comments
 (0)