Skip to content

Commit

Permalink
CONTRIBUTING.md: Encourage regression tests (#2089)
Browse files Browse the repository at this point in the history
* CONTRIBUTING.md: Encourage regression tests

* Add colon before listing pros of regression tests

Co-authored-by: Keith Hall <[email protected]>
  • Loading branch information
Enselic and keith-hall authored Feb 26, 2022
1 parent 14ddda0 commit 1ee49b4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,25 @@ If you really think that a particular syntax or theme should be added for all
users, please read the corresponding
[documentation](https://github.com/sharkdp/bat/blob/master/doc/assets.md)
first.


## Regression tests

You are strongly encouraged to add regression tests. Regression tests are great,
not least because they:

* ensure that your contribution will never completely stop working,

* makes code review easier, because it becomes very clear what the code is
supposed to do.

For functional changes, you most likely want to add a test to
[`tests/integration_tests.rs`](https://github.com/sharkdp/bat/blob/master/tests/integration_tests.rs).
Look at existing tests to know how to write a new test. In short, you will
invoke the `bat` binary with a certain set of arguments, and then assert on
stdout/stderr.

To learn how to write regression tests for theme and syntax changes, read the
[Syntax
tests](https://github.com/sharkdp/bat/blob/master/doc/assets.md#syntax-tests)
section in `assets.md`.

0 comments on commit 1ee49b4

Please sign in to comment.