Skip to content

Commit 290c29c

Browse files
committed
auto merge of #11654 : korenchkin/rust/doc_guide-testing_format, r=cmr
2 parents a0ecb15 + e0ea31f commit 290c29c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

doc/guide-testing.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
3333
# Unit testing in Rust
3434

3535
Rust has built in support for simple unit testing. Functions can be
36-
marked as unit tests using the 'test' attribute.
36+
marked as unit tests using the `test` attribute.
3737

3838
~~~
3939
#[test]
@@ -44,13 +44,13 @@ fn return_none_if_empty() {
4444

4545
A test function's signature must have no arguments and no return
4646
value. To run the tests in a crate, it must be compiled with the
47-
'--test' flag: `rustc myprogram.rs --test -o myprogram-tests`. Running
47+
`--test` flag: `rustc myprogram.rs --test -o myprogram-tests`. Running
4848
the resulting executable will run all the tests in the crate. A test
4949
is considered successful if its function returns; if the task running
5050
the test fails, through a call to `fail!`, a failed `check` or
5151
`assert`, or some other (`assert_eq`, ...) means, then the test fails.
5252

53-
When compiling a crate with the '--test' flag '--cfg test' is also
53+
When compiling a crate with the `--test` flag `--cfg test` is also
5454
implied, so that tests can be conditionally compiled.
5555

5656
~~~
@@ -64,17 +64,17 @@ mod tests {
6464
~~~
6565

6666
Additionally `#[test]` items behave as if they also have the
67-
`#[cfg(test)]` attribute, and will not be compiled when the --test flag
67+
`#[cfg(test)]` attribute, and will not be compiled when the `--test` flag
6868
is not used.
6969

70-
Tests that should not be run can be annotated with the 'ignore'
70+
Tests that should not be run can be annotated with the `ignore`
7171
attribute. The existence of these tests will be noted in the test
7272
runner output, but the test will not be run. Tests can also be ignored
7373
by configuration so, for example, to ignore a test on windows you can
7474
write `#[ignore(cfg(target_os = "win32"))]`.
7575

7676
Tests that are intended to fail can be annotated with the
77-
'should_fail' attribute. The test will be run, and if it causes its
77+
`should_fail` attribute. The test will be run, and if it causes its
7878
task to fail then the test will be counted as successful; otherwise it
7979
will be counted as a failure. For example:
8080

@@ -87,11 +87,11 @@ fn test_out_of_bounds_failure() {
8787
}
8888
~~~
8989

90-
A test runner built with the '--test' flag supports a limited set of
90+
A test runner built with the `--test` flag supports a limited set of
9191
arguments to control which tests are run: the first free argument
9292
passed to a test runner specifies a filter used to narrow down the set
93-
of tests being run; the '--ignored' flag tells the test runner to run
94-
only tests with the 'ignore' attribute.
93+
of tests being run; the `--ignored` flag tells the test runner to run
94+
only tests with the `ignore` attribute.
9595

9696
## Parallelism
9797

0 commit comments

Comments
 (0)