diff options
| author | Eric Bavier <bavier@member.fsf.org> | 2014-10-22 13:47:01 -0500 |
|---|---|---|
| committer | Eric Bavier <bavier@member.fsf.org> | 2014-10-26 13:03:53 -0500 |
| commit | 574e847b8ea692aeea051d487cc95cec1257aba7 (patch) | |
| tree | ce7c980fba2aa15930e92f6813f7f9c370c7c99a /tests | |
| parent | c04b82ffce74612403b0c736713542ddbb4eed23 (diff) | |
guix: lint: Check for proper end-of-sentence space.
* guix/scripts/lint.scm (start-with-capital-letter?): Handle empty
strings.
(check-description-style): New check for end-of-sentence space.
* tests/lint.scm: Test it.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/lint.scm | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/lint.scm b/tests/lint.scm index 62a9df90d89..b013231b292 100644 --- a/tests/lint.scm +++ b/tests/lint.scm | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2012, 2013 Cyril Roelandt <tipecaml@gmail.com> | 2 | ;;; Copyright © 2012, 2013 Cyril Roelandt <tipecaml@gmail.com> |
| 3 | ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> | ||
| 3 | ;;; | 4 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 6 | ;;; |
| @@ -53,6 +54,34 @@ | |||
| 53 | (check-description-style pkg)))) | 54 | (check-description-style pkg)))) |
| 54 | "description should start with an upper-case letter"))) | 55 | "description should start with an upper-case letter"))) |
| 55 | 56 | ||
| 57 | (test-assert "description: two spaces after end of sentence" | ||
| 58 | (->bool | ||
| 59 | (string-contains (call-with-warnings | ||
| 60 | (lambda () | ||
| 61 | (let ((pkg (dummy-package "x" | ||
| 62 | (description "Bad. Quite bad.")))) | ||
| 63 | (check-description-style pkg)))) | ||
| 64 | "sentences in description should be followed by two spaces"))) | ||
| 65 | |||
| 66 | (test-assert "description: end-of-sentence detection with abbreviations" | ||
| 67 | (not | ||
| 68 | (string-contains (call-with-warnings | ||
| 69 | (lambda () | ||
| 70 | (let ((pkg (dummy-package "x" | ||
| 71 | (description | ||
| 72 | "E.g. Foo, i.e. Bar resp. Baz (a.k.a. DVD).")))) | ||
| 73 | (check-description-style pkg)))) | ||
| 74 | "sentences in description should be followed by two spaces"))) | ||
| 75 | |||
| 76 | (test-assert "synopsis: not empty" | ||
| 77 | (->bool | ||
| 78 | (string-contains (call-with-warnings | ||
| 79 | (lambda () | ||
| 80 | (let ((pkg (dummy-package "x" | ||
| 81 | (synopsis "")))) | ||
| 82 | (check-synopsis-style pkg)))) | ||
| 83 | "synopsis should not be empty"))) | ||
| 84 | |||
| 56 | (test-assert "synopsis: does not start with an upper-case letter" | 85 | (test-assert "synopsis: does not start with an upper-case letter" |
| 57 | (->bool | 86 | (->bool |
| 58 | (string-contains (call-with-warnings | 87 | (string-contains (call-with-warnings |
