summaryrefslogtreecommitdiff
path: root/tests/records.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2021-05-09 21:29:46 +0200
committerMarius Bakke <marius@gnu.org>2021-05-09 21:29:46 +0200
commitf03426420497cd9839f5fb3cb547dbecd8d6053b (patch)
tree220cdbab5b58b27c63d2df3ee711ad4bfdda074b /tests/records.scm
parent3cf1afb7e7249992b2db2f4f00899fd22237e89a (diff)
parent069399ee9dbf75b7c89583f03346a63b2cfe4ac6 (diff)
downloadguix-patches-f03426420497cd9839f5fb3cb547dbecd8d6053b.tar
guix-patches-f03426420497cd9839f5fb3cb547dbecd8d6053b.tar.gz
Merge branch 'master' into core-updates
Conflicts: gnu/local.mk gnu/packages/bioinformatics.scm gnu/packages/django.scm gnu/packages/gtk.scm gnu/packages/llvm.scm gnu/packages/python-web.scm gnu/packages/python.scm gnu/packages/tex.scm guix/build-system/asdf.scm guix/build/emacs-build-system.scm guix/profiles.scm
Diffstat (limited to 'tests/records.scm')
-rw-r--r--tests/records.scm18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/records.scm b/tests/records.scm
index 2c55a61720..706bb3dbfd 100644
--- a/tests/records.scm
+++ b/tests/records.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -29,6 +29,16 @@
(module-use! module (resolve-interface '(guix records)))
module))
+(define (location-alist loc)
+ ;; Return a location alist. In Guile < 3.0.6, LOC is always an alist, but
+ ;; starting with 3.0.6, LOC is a vector (at least when it comes from
+ ;; 'syntax-error' exceptions), hence this conversion.
+ (match loc
+ (#(file line column)
+ `((line . ,line) (column . ,column)
+ (filename . ,file)))
+ (_ loc)))
+
(test-begin "records")
@@ -298,7 +308,7 @@
(pk 'expected-loc
`((line . ,(- (assq-ref loc 'line) 1))
,@(alist-delete 'line loc)))
- (pk 'actual-loc location)))))))
+ (pk 'actual-loc (location-alist location))))))))
(test-assert "define-record-type* & wrong field specifier, identifier"
(let ((exp '(begin
@@ -325,7 +335,7 @@
(pk 'expected-loc
`((line . ,(- (assq-ref loc 'line) 2))
,@(alist-delete 'line loc)))
- (pk 'actual-loc location)))))))
+ (pk 'actual-loc (location-alist location))))))))
(test-assert "define-record-type* & missing initializers"
(catch 'syntax-error
@@ -396,7 +406,7 @@
(pk 'expected-loc
`((line . ,(- (assq-ref loc 'line) 1))
,@(alist-delete 'line loc)))
- (pk 'actual-loc location)))))))
+ (pk 'actual-loc (location-alist location))))))))
(test-assert "ABI checks"
(let ((module (test-module)))