summaryrefslogtreecommitdiff
path: root/tests/build-utils.scm
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@zancanaro.id.au>2023-05-20 23:05:06 +1000
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-10-09 23:39:36 -0400
commited1b2d0a86a0a62d8d843f06669a5f072482c37e (patch)
treeeb6679abccccf4dd7fa19936aaa514f3c6e37635 /tests/build-utils.scm
parentefd63df2d56e06a125ec158a72ff75677d1cdfb3 (diff)
build: utils: Raise error in modify-phases upon missing key.
* guix/build/utils.scm (alist-cons-before) (alist-cons-after): Error with a match failure if the reference is not found, instead of appending to the alist. * tests/build-utils.scm: Update tests to match the new behavior. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Change-Id: I3044b101bd06231d5cd55a544ac1009e6ce6f9a0
Diffstat (limited to 'tests/build-utils.scm')
-rw-r--r--tests/build-utils.scm12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/build-utils.scm b/tests/build-utils.scm
index 7f4f12ccc7..3babf5d544 100644
--- a/tests/build-utils.scm
+++ b/tests/build-utils.scm
@@ -41,17 +41,17 @@
'((a . 1) (x . 42) (b . 2) (c . 3))
(alist-cons-before 'b 'x 42 '((a . 1) (b . 2) (c . 3))))
-(test-equal "alist-cons-before, reference not found"
- '((a . 1) (b . 2) (c . 3) (x . 42))
- (alist-cons-before 'z 'x 42 '((a . 1) (b . 2) (c . 3))))
+(test-assert "alist-cons-before, reference not found"
+ (not (false-if-exception
+ (alist-cons-before 'z 'x 42 '((a . 1) (b . 2) (c . 3))))))
(test-equal "alist-cons-after"
'((a . 1) (b . 2) (x . 42) (c . 3))
(alist-cons-after 'b 'x 42 '((a . 1) (b . 2) (c . 3))))
-(test-equal "alist-cons-after, reference not found"
- '((a . 1) (b . 2) (c . 3) (x . 42))
- (alist-cons-after 'z 'x 42 '((a . 1) (b . 2) (c . 3))))
+(test-assert "alist-cons-after, reference not found"
+ (not (false-if-exception
+ (alist-cons-after 'z 'x 42 '((a . 1) (b . 2) (c . 3))))))
(test-equal "alist-replace"
'((a . 1) (b . 77) (c . 3))