mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
tests: Avoid now-deprecated 'make-struct'.
* tests/cve.scm (vulnerability): Use 'make-struct/no-tail' instead of 'make-struct', which is deprecated. * tests/lint.scm ("cve: one vulnerability") ("cve: one patched vulnerability") ("cve: known safe from vulnerability") ("cve: vulnerability fixed in replacement version") ("cve: patched vulnerability in replacement"): Likewise.
This commit is contained in:
parent
d04285647d
commit
79c03e55e2
2 changed files with 21 additions and 21 deletions
|
@ -25,7 +25,7 @@ (define %sample
|
|||
(search-path %load-path "tests/cve-sample.xml"))
|
||||
|
||||
(define (vulnerability id packages)
|
||||
(make-struct (@@ (guix cve) <vulnerability>) 0 id packages))
|
||||
(make-struct/no-tail (@@ (guix cve) <vulnerability>) id packages))
|
||||
|
||||
(define %expected-vulnerabilities
|
||||
;; What we should get when reading %SAMPLE.
|
||||
|
|
|
@ -758,10 +758,10 @@ (define (warning-contains? str warnings)
|
|||
"probably vulnerable to CVE-2015-1234"
|
||||
(mock ((guix lint) package-vulnerabilities
|
||||
(lambda (package)
|
||||
(list (make-struct (@@ (guix cve) <vulnerability>) 0
|
||||
"CVE-2015-1234"
|
||||
(list (cons (package-name package)
|
||||
(package-version package)))))))
|
||||
(list (make-struct/no-tail (@@ (guix cve) <vulnerability>)
|
||||
"CVE-2015-1234"
|
||||
(list (cons (package-name package)
|
||||
(package-version package)))))))
|
||||
(single-lint-warning-message
|
||||
(check-vulnerabilities (dummy-package "pi" (version "3.14"))))))
|
||||
|
||||
|
@ -769,10 +769,10 @@ (define (warning-contains? str warnings)
|
|||
'()
|
||||
(mock ((guix lint) package-vulnerabilities
|
||||
(lambda (package)
|
||||
(list (make-struct (@@ (guix cve) <vulnerability>) 0
|
||||
"CVE-2015-1234"
|
||||
(list (cons (package-name package)
|
||||
(package-version package)))))))
|
||||
(list (make-struct/no-tail (@@ (guix cve) <vulnerability>)
|
||||
"CVE-2015-1234"
|
||||
(list (cons (package-name package)
|
||||
(package-version package)))))))
|
||||
(check-vulnerabilities
|
||||
(dummy-package "pi"
|
||||
(version "3.14")
|
||||
|
@ -785,10 +785,10 @@ (define (warning-contains? str warnings)
|
|||
'()
|
||||
(mock ((guix lint) package-vulnerabilities
|
||||
(lambda (package)
|
||||
(list (make-struct (@@ (guix cve) <vulnerability>) 0
|
||||
"CVE-2015-1234"
|
||||
(list (cons (package-name package)
|
||||
(package-version package)))))))
|
||||
(list (make-struct/no-tail (@@ (guix cve) <vulnerability>)
|
||||
"CVE-2015-1234"
|
||||
(list (cons (package-name package)
|
||||
(package-version package)))))))
|
||||
(check-vulnerabilities
|
||||
(dummy-package "pi"
|
||||
(version "3.14")
|
||||
|
@ -800,10 +800,10 @@ (define (warning-contains? str warnings)
|
|||
(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))))))
|
||||
(list (make-struct/no-tail (@@ (guix cve) <vulnerability>)
|
||||
"CVE-2015-1234"
|
||||
(list (cons (package-name package)
|
||||
(package-version package))))))
|
||||
("1"
|
||||
'()))))
|
||||
(check-vulnerabilities
|
||||
|
@ -815,10 +815,10 @@ (define (warning-contains? str warnings)
|
|||
'()
|
||||
(mock ((guix lint) package-vulnerabilities
|
||||
(lambda (package)
|
||||
(list (make-struct (@@ (guix cve) <vulnerability>) 0
|
||||
"CVE-2015-1234"
|
||||
(list (cons (package-name package)
|
||||
(package-version package)))))))
|
||||
(list (make-struct/no-tail (@@ (guix cve) <vulnerability>)
|
||||
"CVE-2015-1234"
|
||||
(list (cons (package-name package)
|
||||
(package-version package)))))))
|
||||
(check-vulnerabilities
|
||||
(dummy-package
|
||||
"pi" (version "3.14") (source (dummy-origin))
|
||||
|
|
Loading…
Reference in a new issue