mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-19 14:07:01 +01:00
gnu: anystyle: Add tests for dictionary adapters.
* gnu/packages/ruby.scm (anystyle)[arguments]: Instead of deleting the 'check' phase, replace it with a few tests. Add SRFI 1 to '#:modules'. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
14a50b62d4
commit
9c124671ce
1 changed files with 25 additions and 1 deletions
|
@ -13613,6 +13613,7 @@ (define-public anystyle
|
|||
#:modules
|
||||
`((guix build ruby-build-system)
|
||||
(ice-9 popen)
|
||||
(srfi srfi-1)
|
||||
(guix build utils))
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
|
@ -13621,7 +13622,30 @@ (define-public anystyle
|
|||
(substitute* "anystyle-cli.gemspec"
|
||||
(("'bibtex-ruby', '[^']*'")
|
||||
"'bibtex-ruby'"))))
|
||||
(delete 'check) ;; there are no upstream tests
|
||||
(replace 'check
|
||||
(lambda* (#:key tests? #:allow-other-keys)
|
||||
;; There are no tests, but let's use this opportunity to do a
|
||||
;; basic test of our own that things run ok. It works especially
|
||||
;; well to test this here since we know the 'ruby-anystile'
|
||||
;; package is in its final, immutable installed form.
|
||||
(when tests?
|
||||
(let ((common
|
||||
`("require 'anystyle'"
|
||||
,(string-append
|
||||
"pp AnyStyle.parse 'Derrida, J. (1967). L’écriture"
|
||||
" et la différence (1 éd.). Paris: Éditions du"
|
||||
" Seuil.'"))))
|
||||
(for-each
|
||||
(lambda (lines)
|
||||
(apply invoke "ruby"
|
||||
(fold-right (lambda (line lst)
|
||||
(cons* "-e" line lst))
|
||||
'()
|
||||
lines)))
|
||||
`(,common
|
||||
("require 'anystyle/dictionary'"
|
||||
"AnyStyle::Dictionary.defaults[:adapter] = :gdbm"
|
||||
,@common)))))))
|
||||
(add-after 'wrap 'check-cli
|
||||
(lambda* (#:key tests? outputs #:allow-other-keys)
|
||||
(when tests?
|
||||
|
|
Loading…
Reference in a new issue