Skip to content

Commit df602be

Browse files
committed
Move example into an example block
1 parent 8438647 commit df602be

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/attributes/testing.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,18 @@ In particular:
5656
* Tests that return `ExitCode::SUCCESS` pass, and tests that return `ExitCode::FAILURE` fail.
5757
* Tests that do not terminate neither pass nor fail.
5858
59-
```rust
60-
# use std::io;
61-
# fn setup_the_thing() -> io::Result<i32> { Ok(1) }
62-
# fn do_the_thing(s: &i32) -> io::Result<()> { Ok(()) }
63-
#[test]
64-
fn test_the_thing() -> io::Result<()> {
65-
let state = setup_the_thing()?; // expected to succeed
66-
do_the_thing(&state)?; // expected to succeed
67-
Ok(())
68-
}
69-
```
59+
> [!EXAMPLE]
60+
> ```rust
61+
> # use std::io;
62+
> # fn setup_the_thing() -> io::Result<i32> { Ok(1) }
63+
> # fn do_the_thing(s: &i32) -> io::Result<()> { Ok(()) }
64+
> #[test]
65+
> fn test_the_thing() -> io::Result<()> {
66+
> let state = setup_the_thing()?; // expected to succeed
67+
> do_the_thing(&state)?; // expected to succeed
68+
> Ok(())
69+
> }
70+
> ```
7071
7172
r[attributes.testing.ignore]
7273
## The `ignore` attribute

0 commit comments

Comments
 (0)