aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-11-28 15:05:55 +0100
committerLudovic Courtès <ludo@gnu.org>2017-11-28 15:05:55 +0100
commiteef01cfe8eac8dee8ecf727e4ca459ae065e15ea (patch)
tree0ad04efcbcd00d8c0366f5a6674c096051a5bbec /tests
parent1da3d2a3a1b53bdd71774194f4afc13f35bb18e3 (diff)
downloadpatches-eef01cfe8eac8dee8ecf727e4ca459ae065e15ea.tar
patches-eef01cfe8eac8dee8ecf727e4ca459ae065e15ea.tar.gz
lint: 'patch-file-names' checks for file name length.
Reported at <https://bugs.gnu.org/27943> by Danny Milosavljevic <dannym@scratchpost.org>. * guix/scripts/lint.scm (%distro-directory): New variable. (check-patch-file-names): Add check for the file name length. * tests/lint.scm ("patches: file name too long"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/lint.scm15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/lint.scm b/tests/lint.scm
index 1d0fc4708c..064f3d177e 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013 Cyril Roelandt <tipecaml@gmail.com>
;;; Copyright © 2014, 2015, 2016 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2017 Alex Kost <alezost@gmail.com>
@@ -331,6 +331,19 @@
(check-patch-file-names pkg)))
"file names of patches should start with the package name")))
+(test-assert "patches: file name too long"
+ (->bool
+ (string-contains
+ (with-warnings
+ (let ((pkg (dummy-package "x"
+ (source
+ (dummy-origin
+ (patches (list (string-append "x-"
+ (make-string 100 #\a)
+ ".patch"))))))))
+ (check-patch-file-names pkg)))
+ "file name is too long")))
+
(test-assert "patches: not found"
(->bool
(string-contains