[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/03: tests: Avoid now-deprecated 'make-struct'.
From: |
guix-commits |
Subject: |
02/03: tests: Avoid now-deprecated 'make-struct'. |
Date: |
Sun, 20 Oct 2019 17:27:03 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 79c03e55e26d88c8d327daced02367abe7f17f91
Author: Ludovic Courtès <address@hidden>
Date: Sun Oct 20 22:03:12 2019 +0200
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.
---
tests/cve.scm | 2 +-
tests/lint.scm | 40 ++++++++++++++++++++--------------------
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/tests/cve.scm b/tests/cve.scm
index 3fbb22d..e95b21c 100644
--- a/tests/cve.scm
+++ b/tests/cve.scm
@@ -25,7 +25,7 @@
(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.
diff --git a/tests/lint.scm b/tests/lint.scm
index 1b92f02..3a9b539 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -758,10 +758,10 @@
"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 @@
'()
(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 @@
'()
(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 @@
(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 @@
'()
(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))