aboutsummaryrefslogtreecommitdiff
path: root/tests/lint.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-12-12 11:42:12 +0100
committerLudovic Courtès <ludo@gnu.org>2015-12-12 11:48:46 +0100
commite82e55e58c67b0215e768c4612ca542bc670f633 (patch)
tree856c4512fa1fbde59c1d9845c5a763ef8c4a14b4 /tests/lint.scm
parent98bd851ee891ca4a84e061fe1e78ba78c292b096 (diff)
parente35dff973375266db253747140ddf25084ecddc2 (diff)
downloadpatches-e82e55e58c67b0215e768c4612ca542bc670f633.tar
patches-e82e55e58c67b0215e768c4612ca542bc670f633.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'tests/lint.scm')
-rw-r--r--tests/lint.scm34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/lint.scm b/tests/lint.scm
index 3f149562d4..df82593a9e 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -512,6 +512,40 @@ requests."
(check-source pkg))))
"not reachable: 404")))
+(test-assert "cve"
+ (mock ((guix scripts lint) package-vulnerabilities (const '()))
+ (string-null?
+ (with-warnings (check-vulnerabilities (dummy-package "x"))))))
+
+(test-assert "cve: one vulnerability"
+ (mock ((guix scripts lint) package-vulnerabilities
+ (lambda (package)
+ (list (make-struct (@@ (guix cve) <vulnerability>) 0
+ "CVE-2015-1234"
+ (list (cons (package-name package)
+ (package-version package)))))))
+ (string-contains
+ (with-warnings
+ (check-vulnerabilities (dummy-package "pi" (version "3.14"))))
+ "vulnerable to CVE-2015-1234")))
+
+(test-assert "cve: one patched vulnerability"
+ (mock ((guix scripts lint) package-vulnerabilities
+ (lambda (package)
+ (list (make-struct (@@ (guix cve) <vulnerability>) 0
+ "CVE-2015-1234"
+ (list (cons (package-name package)
+ (package-version package)))))))
+ (string-null?
+ (with-warnings
+ (check-vulnerabilities
+ (dummy-package "pi"
+ (version "3.14")
+ (source
+ (dummy-origin
+ (patches
+ (list "/a/b/pi-CVE-2015-1234.patch"))))))))))
+
(test-assert "formatting: lonely parentheses"
(string-contains
(with-warnings