summaryrefslogtreecommitdiffstats
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorMartin Nordholts <enselic@gmail.com>2022-02-26 17:03:54 +0100
committerGitHub <noreply@github.com>2022-02-26 17:03:54 +0100
commit1ee49b4d97cdb22c9303788b78366714c5db346c (patch)
tree66d0f476bcfc7975dd85e9796739fcece97e42d5 /CONTRIBUTING.md
parent14ddda0a8b9727208e68f74615534f1b9ca20f42 (diff)
CONTRIBUTING.md: Encourage regression tests (#2089)
* CONTRIBUTING.md: Encourage regression tests * Add colon before listing pros of regression tests Co-authored-by: Keith Hall <keith-hall@users.noreply.github.com>
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a1770575..666add17 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -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`.