Skip to content

Commit

Permalink
Consistent formatting for args and attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
tweber12 committed Jan 18, 2014
1 parent f3f2e69 commit e0ea31f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions doc/guide-testing.md
Expand Up @@ -33,7 +33,7 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
# Unit testing in Rust

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

~~~
#[test]
Expand All @@ -44,13 +44,13 @@ fn return_none_if_empty() {

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

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

~~~
Expand All @@ -64,17 +64,17 @@ mod tests {
~~~

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

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

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

Expand All @@ -87,11 +87,11 @@ fn test_out_of_bounds_failure() {
}
~~~

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

## Parallelism

Expand Down

5 comments on commit e0ea31f

@bors
Copy link
Contributor

@bors bors commented on e0ea31f Jan 20, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from cmr
at tweber12@e0ea31f

@bors
Copy link
Contributor

@bors bors commented on e0ea31f Jan 20, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging korenchkin/rust/doc_guide-testing_format = e0ea31f into auto

@bors
Copy link
Contributor

@bors bors commented on e0ea31f Jan 20, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

korenchkin/rust/doc_guide-testing_format = e0ea31f merged ok, testing candidate = 290c29c

@bors
Copy link
Contributor

@bors bors commented on e0ea31f Jan 20, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on e0ea31f Jan 20, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 290c29c

Please sign in to comment.