;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013 Cyril Roelandt <tipecaml@gmail.com>
-;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2014, 2015, 2016 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
;;;
#:use-module (web server)
#:use-module (web server http)
#:use-module (web response)
+ #:use-module (ice-9 match)
#:use-module (ice-9 threads)
#:use-module (srfi srfi-9 gnu)
#:use-module (srfi srfi-64))
"E.g. Foo, i.e. Bar resp. Baz (a.k.a. DVD)."))))
(check-description-style pkg)))))
+(test-assert "description: may not contain trademark signs"
+ (and (->bool
+ (string-contains (with-warnings
+ (let ((pkg (dummy-package "x"
+ (description "Does The Right Thing™"))))
+ (check-description-style pkg)))
+ "should not contain trademark sign"))
+ (->bool
+ (string-contains (with-warnings
+ (let ((pkg (dummy-package "x"
+ (description "Works with Format®"))))
+ (check-description-style pkg)))
+ "should not contain trademark sign"))))
+
(test-assert "synopsis: not a string"
(->bool
(string-contains (with-warnings
(patches
(list "/a/b/pi-CVE-2015-1234.patch"))))))))))
+(test-assert "cve: vulnerability fixed in replacement version"
+ (mock ((guix scripts lint) package-vulnerabilities
+ (lambda (package)
+ (match (package-version package)
+ ("0"
+ (list (make-struct (@@ (guix cve) <vulnerability>) 0
+ "CVE-2015-1234"
+ (list (cons (package-name package)
+ (package-version package))))))
+ ("1"
+ '()))))
+ (and (not (string-null?
+ (with-warnings
+ (check-vulnerabilities
+ (dummy-package "foo" (version "0"))))))
+ (string-null?
+ (with-warnings
+ (check-vulnerabilities
+ (dummy-package
+ "foo" (version "0")
+ (replacement (dummy-package "foo" (version "1"))))))))))
+
(test-assert "cve: patched vulnerability in replacement"
(mock ((guix scripts lint) package-vulnerabilities
(lambda (package)