summaryrefslogtreecommitdiff
path: root/tests/lint.scm
diff options
context:
space:
mode:
authorEric Bavier <bavier@member.fsf.org>2014-10-22 13:47:01 -0500
committerEric Bavier <bavier@member.fsf.org>2014-10-26 13:03:53 -0500
commit574e847b8ea692aeea051d487cc95cec1257aba7 (patch)
treece7c980fba2aa15930e92f6813f7f9c370c7c99a /tests/lint.scm
parentc04b82ffce74612403b0c736713542ddbb4eed23 (diff)
downloadgnu-guix-574e847b8ea692aeea051d487cc95cec1257aba7.tar
gnu-guix-574e847b8ea692aeea051d487cc95cec1257aba7.tar.gz
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/lint.scm')
-rw-r--r--tests/lint.scm29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/lint.scm b/tests/lint.scm
index 62a9df90d8..b013231b29 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013 Cyril Roelandt <tipecaml@gmail.com>
+;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -53,6 +54,34 @@
(check-description-style pkg))))
"description should start with an upper-case letter")))
+(test-assert "description: two spaces after end of sentence"
+ (->bool
+ (string-contains (call-with-warnings
+ (lambda ()
+ (let ((pkg (dummy-package "x"
+ (description "Bad. Quite bad."))))
+ (check-description-style pkg))))
+ "sentences in description should be followed by two spaces")))
+
+(test-assert "description: end-of-sentence detection with abbreviations"
+ (not
+ (string-contains (call-with-warnings
+ (lambda ()
+ (let ((pkg (dummy-package "x"
+ (description
+ "E.g. Foo, i.e. Bar resp. Baz (a.k.a. DVD)."))))
+ (check-description-style pkg))))
+ "sentences in description should be followed by two spaces")))
+
+(test-assert "synopsis: not empty"
+ (->bool
+ (string-contains (call-with-warnings
+ (lambda ()
+ (let ((pkg (dummy-package "x"
+ (synopsis ""))))
+ (check-synopsis-style pkg))))
+ "synopsis should not be empty")))
+
(test-assert "synopsis: does not start with an upper-case letter"
(->bool
(string-contains (call-with-warnings