@@ -54,7 +54,7 @@ To make an assertion using a matcher, GoogleTest offers three macros:
5454 * [ ` assert_that! ` ] panics if the assertion fails, aborting the test.
5555 * [ ` expect_that! ` ] logs an assertion failure, marking the test as having
5656 failed, but allows the test to continue running (called a _ non-fatal
57- assertion_ ). It requires the use of the [ ` googletest::test ` ] attribute macro
57+ assertion_ ). It requires the use of the [ ` gtest ` ] attribute macro
5858 on the test itself.
5959 * [ ` verify_that! ` ] has no side effects and evaluates to a [ ` Result<()> ` ] whose
6060 ` Err ` variant describes the assertion failure, if there is one. In
@@ -74,7 +74,7 @@ fn fails_and_panics() {
7474 assert_that! (value , eq (4 ));
7575}
7676
77- #[googletest :: test ]
77+ #[gtest ]
7878fn two_logged_failures () {
7979 let value = 2 ;
8080 expect_that! (value , eq (4 )); // Test now failed, but continues executing.
@@ -107,7 +107,7 @@ Matchers are composable:
107107``` rust
108108use googletest :: prelude :: * ;
109109
110- #[googletest :: test ]
110+ #[gtest ]
111111fn contains_at_least_one_item_at_least_3 () {
112112 let value = vec! [1 , 2 , 3 ];
113113 expect_that! (value , contains (ge (3 )));
@@ -119,7 +119,7 @@ They can also be logically combined:
119119``` rust
120120use googletest :: prelude :: * ;
121121
122- #[googletest :: test ]
122+ #[gtest ]
123123fn strictly_between_9_and_11 () {
124124 let value = 10 ;
125125 expect_that! (value , gt (9 ). and (not (ge (11 ))));
@@ -194,7 +194,7 @@ pub fn eq_my_way<T: PartialEq + Debug>(expected: T) -> impl Matcher<T> {
194194The new matcher can then be used in the assertion macros:
195195
196196``` rust
197- #[googletest :: test ]
197+ #[gtest ]
198198fn should_be_equal_by_my_definition () {
199199 expect_that! (10 , eq_my_way (10 ));
200200}
@@ -209,12 +209,12 @@ failed, but execution continues until the test completes or otherwise aborts.
209209This is analogous to the ` EXPECT_* ` family of macros in GoogleTest.
210210
211211To make a non-fatal assertion, use the macro [ ` expect_that! ` ] . The test must
212- also be marked with [ ` googletest::test ` ] instead of the Rust-standard ` #[test] ` .
212+ also be marked with [ ` gtest ` ] instead of the Rust-standard ` #[test] ` .
213213
214214``` rust
215215use googletest :: prelude :: * ;
216216
217- #[googletest :: test ]
217+ #[gtest ]
218218fn three_non_fatal_assertions () {
219219 let value = 2 ;
220220 expect_that! (value , eq (2 )); // Passes; test still considered passing.
@@ -229,7 +229,7 @@ function must also return [`Result<()>`]:
229229``` rust
230230use googletest :: prelude :: * ;
231231
232- #[googletest :: test ]
232+ #[gtest ]
233233fn failing_non_fatal_assertion () -> Result <()> {
234234 let value = 2 ;
235235 expect_that! (value , eq (3 )); // Just marks the test as having failed.
@@ -242,7 +242,7 @@ fn failing_non_fatal_assertion() -> Result<()> {
242242``` rust
243243use googletest :: prelude :: * ;
244244
245- #[googletest :: test ]
245+ #[gtest ]
246246fn failing_fatal_assertion_after_non_fatal_assertion () -> Result <()> {
247247 let value = 2 ;
248248 verify_that! (value , eq (3 ))? ; // Fails and aborts the test.
@@ -253,12 +253,12 @@ fn failing_fatal_assertion_after_non_fatal_assertion() -> Result<()> {
253253
254254### Interoperability
255255
256- You can use the ` #[googletest::test ] ` macro together with many other libraries
256+ You can use the ` #[gtest ] ` macro together with many other libraries
257257such as [ rstest] ( https://crates.io/crates/rstest ) . Just apply both attribute
258258macros to the test:
259259
260260``` rust
261- #[googletest :: test ]
261+ #[gtest ]
262262#[rstest]
263263#[case(1)]
264264#[case(2)]
@@ -268,16 +268,16 @@ fn rstest_works_with_google_test(#[case] value: u32) -> Result<()> {
268268}
269269```
270270
271- Make sure to put ` #[googletest::test ] ` * before* ` #[rstest] ` . Otherwise the
271+ Make sure to put ` #[gtest ] ` * before* ` #[rstest] ` . Otherwise the
272272annotated test will run twice, since both macros will attempt to register a test
273273with the Rust test harness.
274274
275275The macro also works together with
276- [ async tests with Tokio] ( https://docs.rs/tokio/latest/tokio/attr.test .html ) in
276+ [ async tests with Tokio] ( https://docs.rs/tokio/latest/tokio/attr.gtest .html ) in
277277the same way:
278278
279279``` rust
280- #[googletest :: test ]
280+ #[gtest ]
281281#[tokio:: test]
282282async fn should_work_with_tokio () -> Result <()> {
283283 verify_that! (3 , gt (0 ))
@@ -355,7 +355,7 @@ to this project.
355355[ `expect_pred!` ] : https://docs.rs/googletest/*/googletest/macro.expect_pred.html
356356[ `expect_that!` ] : https://docs.rs/googletest/*/googletest/macro.expect_that.html
357357[ `fail!` ] : https://docs.rs/googletest/*/googletest/macro.fail.html
358- [ `googletest::test ` ] : https://docs.rs/googletest/*/googletest/attr.test .html
358+ [ `gtest ` ] : https://docs.rs/googletest/*/googletest/attr.gtest .html
359359[ `matches_pattern!` ] : https://docs.rs/googletest/*/googletest/macro.matches_pattern.html
360360[ `verify_pred!` ] : https://docs.rs/googletest/*/googletest/macro.verify_pred.html
361361[ `verify_that!` ] : https://docs.rs/googletest/*/googletest/macro.verify_that.html
0 commit comments