Skip to content

Commit 78af10e

Browse files
authored
Merge pull request #6821 from jieyouxu/update-contrib-docs
Elaborate what `source/`-matches-`target/` tests can catch
2 parents cebab3e + 5c1c8e9 commit 78af10e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Contributing.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ to create regressions. Any tests you can add are very much appreciated.
2323
The tests can be run with `cargo test`. This does a number of things:
2424
* runs the unit tests for a number of internal functions;
2525
* makes sure that rustfmt run on every file in `./tests/source/` is equal to its
26-
associated file in `./tests/target/`;
26+
associated file in `./tests/target/`; this catches
27+
* unexpected formatting differences from changes to rustfmt
28+
* non-idempotency in formatting even when the file copy in `target/` is
29+
already in the canonical expected format. That is, if `source_start` is
30+
the starting formatting and `source_canonical` is the expected canonical
31+
formatting, catch cases where there is a converging sequence
32+
`source_start -> source_1 -> ... -> source_canonical` that takes multiple
33+
rustfmt runs.
2734
* runs idempotence tests on the files in `./tests/target/`. These files should
2835
not be changed by rustfmt;
2936
* checks that rustfmt's code is not changed by running on itself. This ensures

0 commit comments

Comments
 (0)