summaryrefslogtreecommitdiff
path: root/tests/packages.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-09-07 21:19:11 +0200
committerLudovic Courtès <ludo@gnu.org>2021-09-13 12:31:10 +0200
commit8531997d2a1e10d574a6e9ab70bc86ade6af4733 (patch)
tree5c1cdaff85b4cba539fe84ba5c3c87fb9217408e /tests/packages.scm
parent10c981b1355df694b277a812cd8beb7cd60d1ea6 (diff)
packages: Add 'package-definition-location'.
Suggested by Maxime Devos <maximedevos@telenet.be>. * guix/packages.scm (current-definition-location): New syntax parameter. (define-public*): New macro. (<package>)[definition-location]: New field. (package-definition-location): New procedure. * tests/packages.scm ("package-definition-location"): New test.
Diffstat (limited to 'tests/packages.scm')
-rw-r--r--tests/packages.scm11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/packages.scm b/tests/packages.scm
index 2a290bc3539..3756877270e 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -236,6 +236,17 @@
236 (eq? item new))) 236 (eq? item new)))
237 (null? (manifest-transaction-remove tx))))))) 237 (null? (manifest-transaction-remove tx)))))))
238 238
239(test-assert "package-definition-location"
240 (let ((location (package-location hello))
241 (definition (package-definition-location hello)))
242 ;; Check for the usual layout of (define-public hello (package ...)).
243 (and (string=? (location-file location)
244 (location-file definition))
245 (= 0 (location-column definition))
246 (= 2 (location-column location))
247 (= (location-line definition)
248 (- (location-line location) 1)))))
249
239(test-assert "package-field-location" 250(test-assert "package-field-location"
240 (let () 251 (let ()
241 (define (goto port line column) 252 (define (goto port line column)