diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2016-04-27 10:05:45 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2016-04-27 11:57:48 +0200 |
| commit | 20be23c3b67dd181a2c4b468626490a7eb74e492 (patch) | |
| tree | dfbb7969263b5a5903cd8eb348cc38b892f4963a /tests | |
| parent | 068e476f68dd6eea9cb90269997d862025fbd696 (diff) | |
lint: Report synopses/descriptions that are not strings.
Suggested by John Darrington.
* guix/scripts/lint.scm (check-description-style): Emit a warning when
DESCRIPTION is not a string.
(check-synopsis-style): Likewise.
(check-gnu-synopsis+description): Likewise.
* tests/lint.scm ("description: not a string", "synopsis: not a
string"): New tests.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/lint.scm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/lint.scm b/tests/lint.scm index 4f0196491d2..9bc42990ef1 100644 --- a/tests/lint.scm +++ b/tests/lint.scm | |||
| @@ -138,6 +138,14 @@ requests." | |||
| 138 | (define-syntax-rule (with-warnings body ...) | 138 | (define-syntax-rule (with-warnings body ...) |
| 139 | (call-with-warnings (lambda () body ...))) | 139 | (call-with-warnings (lambda () body ...))) |
| 140 | 140 | ||
| 141 | (test-assert "description: not a string" | ||
| 142 | (->bool | ||
| 143 | (string-contains (with-warnings | ||
| 144 | (let ((pkg (dummy-package "x" | ||
| 145 | (description 'foobar)))) | ||
| 146 | (check-description-style pkg))) | ||
| 147 | "invalid description"))) | ||
| 148 | |||
| 141 | (test-assert "description: not empty" | 149 | (test-assert "description: not empty" |
| 142 | (->bool | 150 | (->bool |
| 143 | (string-contains (with-warnings | 151 | (string-contains (with-warnings |
| @@ -191,6 +199,14 @@ requests." | |||
| 191 | "E.g. Foo, i.e. Bar resp. Baz (a.k.a. DVD).")))) | 199 | "E.g. Foo, i.e. Bar resp. Baz (a.k.a. DVD).")))) |
| 192 | (check-description-style pkg))))) | 200 | (check-description-style pkg))))) |
| 193 | 201 | ||
| 202 | (test-assert "synopsis: not a string" | ||
| 203 | (->bool | ||
| 204 | (string-contains (with-warnings | ||
| 205 | (let ((pkg (dummy-package "x" | ||
| 206 | (synopsis #f)))) | ||
| 207 | (check-synopsis-style pkg))) | ||
| 208 | "invalid synopsis"))) | ||
| 209 | |||
| 194 | (test-assert "synopsis: not empty" | 210 | (test-assert "synopsis: not empty" |
| 195 | (->bool | 211 | (->bool |
| 196 | (string-contains (with-warnings | 212 | (string-contains (with-warnings |
