Skip to content

Conversation

@copybara-service
Copy link

Use UFCS for with_message assertions

Before this CL, the assertion macro variants which accept messages
would add the message via a call to the with_message method from the
GoogleTestSupport trait. However, that trait may not be imported if
users are not bringing in the full googletest prelude.

This CL switches those method calls to UFCS and adds a utility method
and_log_failure_with_message in order to make such calls more readable.

@copybara-service copybara-service bot force-pushed the test_775268801 branch 8 times, most recently from 4201b70 to fd05494 Compare June 25, 2025 09:10
Before this CL, the assertion macro variants which accept messages
would add the message via a call to the `with_message` method from the
`GoogleTestSupport` trait. However, that trait may not be imported if
users are not bringing in the full googletest prelude.

This CL switches those method calls to UFCS and adds a utility method
`and_log_failure_with_message` in order to make such calls more readable.

PiperOrigin-RevId: 775593149
@copybara-service copybara-service bot merged commit faec46f into main Jun 25, 2025
@copybara-service copybara-service bot deleted the test_775268801 branch June 25, 2025 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants