From 549c5d061e3c5ea4acffb43c92b048dd16812805 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Mon, 15 Jun 2020 13:15:38 -0400 Subject: [PATCH] Googletest export gMock Cookbook: Fix incorrect comment about EXPECT priority order It's actually the last matching expectation that's used, not the first. PiperOrigin-RevId: 316490770 --- googlemock/docs/cook_book.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/googlemock/docs/cook_book.md b/googlemock/docs/cook_book.md index bffbb3c0..9550d912 100644 --- a/googlemock/docs/cook_book.md +++ b/googlemock/docs/cook_book.md @@ -1675,11 +1675,11 @@ times from calling it with the wrong arguments. ### Expecting Ordered Calls {#OrderedCalls} -Although an `EXPECT_CALL()` statement defined earlier takes precedence when -gMock tries to match a function call with an expectation, by default calls don't -have to happen in the order `EXPECT_CALL()` statements are written. For example, -if the arguments match the matchers in the third `EXPECT_CALL()`, but not those -in the first two, then the third expectation will be used. +Although an `EXPECT_CALL()` statement defined later takes precedence when gMock +tries to match a function call with an expectation, by default calls don't have +to happen in the order `EXPECT_CALL()` statements are written. For example, if +the arguments match the matchers in the second `EXPECT_CALL()`, but not those in +the first and third, then the second expectation will be used. If you would rather have all calls occur in the order of the expectations, put the `EXPECT_CALL()` statements in a block where you define a variable of type