Skip to content

Add assert_true! and assert_false! macros to gtest_rust#801

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_910544641
May 11, 2026
Merged

Add assert_true! and assert_false! macros to gtest_rust#801
copybara-service[bot] merged 1 commit into
mainfrom
test_910544641

Conversation

@copybara-service
Copy link
Copy Markdown

Add assert_true! and assert_false! macros to gtest_rust

These macros provide fatal assertions, panicking if the condition is not met. This aligns with the assertion a developer would expect from other test frameworks.

The macros are added to assertions.rs and exported in lib.rs.

Integration tests are added to:

  • passing_tests.rs: Ensure the macros don't panic when the condition is met.
  • failing_tests.rs: Ensure the macros do panic when the condition is not met.
  • integration_tests.sh: Updated to expect the new failures in failing_tests_bin.

PUBLIC: Add assert_true! and assert_false! macros for fatal assertions.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 5, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@copybara-service copybara-service Bot force-pushed the test_910544641 branch 6 times, most recently from 234aeed to 66700a1 Compare May 11, 2026 06:44
These macros provide fatal assertions, panicking if the condition is not met. This aligns with the assertion a developer would expect from other test frameworks.

The macros are added to `assertions.rs` and exported in `lib.rs`.

Integration tests are added to:
- `passing_tests.rs`: Ensure the macros don't panic when the condition is met.
- `failing_tests.rs`: Ensure the macros *do* panic when the condition is not met.
- `integration_tests.sh`: Updated to expect the new failures in `failing_tests_bin`.

PUBLIC: Add assert_true! and assert_false! macros for fatal assertions.
PiperOrigin-RevId: 913525450
@copybara-service copybara-service Bot merged commit 0925bc9 into main May 11, 2026
@copybara-service copybara-service Bot deleted the test_910544641 branch May 11, 2026 06:54
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.

0 participants