Skip to content

Commit 32dc7c5

Browse files
committed
Applying review suggestions
1 parent 864df49 commit 32dc7c5

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

book/src/development/writing_tests.md

+11-16
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ that contains the code we want to check.
2424

2525
The output of Clippy is compared against a `.stderr` file. Note that you don't
2626
have to create this file yourself. We'll get to generating the `.stderr` files
27-
with the command [`cargo dev bless`](#cargo-dev-bless) (seen later on).
27+
with the command [`cargo bless`](#cargo-bless) (seen later on).
2828

2929
### Write Test Cases
3030

@@ -41,20 +41,20 @@ Update the file with some examples to get started:
4141
struct A;
4242
impl A {
4343
pub fn fo(&self) {}
44-
pub fn foo(&self) {}
44+
pub fn foo(&self) {} //~ ERROR: function called "foo"
4545
pub fn food(&self) {}
4646
}
4747

4848
// Default trait methods
4949
trait B {
5050
fn fo(&self) {}
51-
fn foo(&self) {}
51+
fn foo(&self) {} //~ ERROR: function called "foo"
5252
fn food(&self) {}
5353
}
5454

5555
// Plain functions
5656
fn fo() {}
57-
fn foo() {}
57+
fn foo() {} //~ ERROR: function called "foo"
5858
fn food() {}
5959

6060
fn main() {
@@ -126,27 +126,22 @@ Note the *failures* label at the top of the fragment, we'll get rid of it
126126
> _Note:_ You can run multiple test files by specifying a comma separated list:
127127
> `TESTNAME=foo_functions,bar_methods,baz_structs`.
128128
129-
### `cargo dev bless`
129+
### `cargo bless`
130130

131131
Once we are satisfied with the output, we need to run this command to
132132
generate or update the `.stderr` file for our lint:
133133

134134
```sh
135-
$ TESTNAME=foo_functions cargo uitest
136-
# (Output is as we want it to be)
137-
$ cargo dev bless
135+
$ TESTNAME=foo_functions cargo uibless
138136
```
139137

140-
This write the emitted lint suggestions and fixes to the `.stderr` file,
141-
with the reason for the lint, suggested fixes, and line numbers, etc.
142-
143-
> _Note:_ we need to run `TESTNAME=foo_functions cargo uitest` every time before
144-
> we run `cargo dev bless`.
138+
This writes the emitted lint suggestions and fixes to the `.stderr` file, with
139+
the reason for the lint, suggested fixes, and line numbers, etc.
145140

146141
Running `TESTNAME=foo_functions cargo uitest` should pass then. When we commit
147142
our lint, we need to commit the generated `.stderr` files, too.
148143

149-
In general, you should only commit files changed by `cargo dev bless` for the
144+
In general, you should only commit files changed by `cargo bless` for the
150145
specific lint you are creating/editing.
151146

152147
> _Note:_ If the generated `.stderr`, and `.fixed` files are empty,
@@ -165,7 +160,7 @@ To add a new test there, create a new directory and add the files:
165160
`clippy.toml` file.
166161

167162
The potential `.stderr` and `.fixed` files can again be generated with `cargo
168-
dev bless`.
163+
bless`.
169164

170165
## Cargo Lints
171166

@@ -209,7 +204,7 @@ compare that to the contents of a `.fixed` file.
209204
We'll talk about suggestions more in depth in a later chapter.
210205
<!-- FIXME: (blyxyas) Link to "Emitting lints" when that gets merged -->
211206

212-
Use `cargo dev bless` to automatically generate the `.fixed` file after running
207+
Use `cargo bless` to automatically generate the `.fixed` file after running
213208
the tests.
214209

215210
[rustfix]: https://github.com/rust-lang/rustfix

0 commit comments

Comments
 (0)