Skip to content

Commit 7c0c2c9

Browse files
hovinenbcopybara-github
authored andcommitted
Remove the (already deprecated) alias google_test for the macro googletest::test.
This alias has been deprecated for a while and we'd like to remove it prior to the release of version 1.0. This is a breaking change for anyone still using that alias. To update code, just replace `#[google_test]` with `#[googletest::test]` and remove any `use googletest::google_test` imports. PiperOrigin-RevId: 551524028
1 parent 4b7f548 commit 7c0c2c9

File tree

4 files changed

+5
-17
lines changed

4 files changed

+5
-17
lines changed

googletest/src/assertions.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ macro_rules! assert_pred {
344344
/// execution in the event of assertion failure.
345345
///
346346
/// This can only be invoked inside tests with the
347-
/// [`google_test`][crate::google_test] attribute. The assertion must occur in
348-
/// the same thread as that running the test itself.
347+
/// [`googletest::test`][crate::test] attribute. The assertion must
348+
/// occur in the same thread as that running the test itself.
349349
///
350350
/// Invoking this macro is equivalent to using
351351
/// [`and_log_failure`](crate::GoogleTestSupport::and_log_failure) as follows:
@@ -368,8 +368,8 @@ macro_rules! expect_that {
368368
/// continues execution in the event of assertion failure.
369369
///
370370
/// This can only be invoked inside tests with the
371-
/// [`google_test`][crate::google_test] attribute. The assertion must occur in
372-
/// the same thread as that running the test itself.
371+
/// [`googletest::test`][crate::test] attribute. The assertion must
372+
/// occur in the same thread as that running the test itself.
373373
///
374374
/// Invoking this macro is equivalent to using
375375
/// [`and_log_failure`](crate::GoogleTestSupport::and_log_failure) as follows:

googletest/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ pub mod prelude {
5858

5959
pub use googletest_macro::test;
6060

61-
// For backwards compatibility.
62-
#[deprecated(since = "0.5.0", note = "Use googletest::test instead")]
63-
pub use googletest_macro::test as google_test;
64-
6561
use internal::test_outcome::{TestAssertionFailure, TestOutcome};
6662

6763
/// A `Result` whose `Err` variant indicates a test failure.

integration_tests/src/failure_due_to_returned_error.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ fn main() {}
1616

1717
#[cfg(test)]
1818
mod tests {
19-
use googletest::google_test;
20-
21-
#[google_test]
19+
#[googletest::test]
2220
fn should_fail_due_to_returned_error() -> Result<(), i32> {
2321
Err(123)
2422
}

integration_tests/src/integration_tests.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ mod tests {
3636
verify_that!(vec![1, 2], {eq(2), eq(1)})
3737
}
3838

39-
#[googletest::google_test]
40-
fn should_pass_with_google_test() -> Result<()> {
41-
let value = 2;
42-
verify_that!(value, eq(2))
43-
}
44-
4539
#[test]
4640
fn should_pass_with_assert_that() -> Result<()> {
4741
let value = 2;

0 commit comments

Comments
 (0)