tests: Adjust `package-field-location' test for Guile <= 2.0.6.

* tests/packages.scm ("package-field-location"): Check the result of
  `read-at' against both VALUE and (FIELD VALUE).
  Reported by Matthew Lien - 練喆明" <bluet@bluet.org>.
master
Ludovic Courtès 2013-07-08 22:53:31 +02:00
parent caddc24fa4
commit ee48b283fa
1 changed files with 8 additions and 4 deletions

View File

@ -70,10 +70,14 @@
(goto port line column)
(read port))))))
(and (equal? (read-at (package-field-location %bootstrap-guile 'name))
(package-name %bootstrap-guile))
(equal? (read-at (package-field-location %bootstrap-guile 'version))
(package-version %bootstrap-guile))
;; Until Guile 2.0.6 included, source properties were added only to pairs.
;; Thus, check against both VALUE and (FIELD VALUE).
(and (member (read-at (package-field-location %bootstrap-guile 'name))
(let ((name (package-name %bootstrap-guile)))
(list name `(name ,name))))
(member (read-at (package-field-location %bootstrap-guile 'version))
(let ((version (package-version %bootstrap-guile)))
(list version `(version ,version))))
(not (package-field-location %bootstrap-guile 'does-not-exist)))))
(test-assert "package-transitive-inputs"