[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#56759] [PATCH 19/20] gnu: anystyle: Add tests for dictionary adapte
From: |
Philip McGrath |
Subject: |
[bug#56759] [PATCH 19/20] gnu: anystyle: Add tests for dictionary adapters. |
Date: |
Mon, 25 Jul 2022 08:16:34 -0400 |
* gnu/packages/ruby.scm (anystyle)[arguments]: Instead of deleting the
'check' phase, replace it with a few tests. Add SRFI 1 to '#:modules'.
---
gnu/packages/ruby.scm | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 608b1ebe89..8991eb0927 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -13611,6 +13611,7 @@ (define-public anystyle
#:modules
`((guix build ruby-build-system)
(ice-9 popen)
+ (srfi srfi-1)
(guix build utils))
#:phases
#~(modify-phases %standard-phases
@@ -13619,7 +13620,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?
--
2.32.0
- [bug#56759] [PATCH 10/20] gnu: Add ruby-unicode-scripts., (continued)
- [bug#56759] [PATCH 10/20] gnu: Add ruby-unicode-scripts., Philip McGrath, 2022/07/25
- [bug#56759] [PATCH 12/20] gnu: Add ruby-edtf., Philip McGrath, 2022/07/25
- [bug#56759] [PATCH 13/20] gnu: Add ruby-gli., Philip McGrath, 2022/07/25
- [bug#56759] [PATCH 15/20] gnu: Add ruby-anystyle., Philip McGrath, 2022/07/25
- [bug#56759] [PATCH 17/20] gnu: ruby-anystyle-data: Don't write to installed gem., Philip McGrath, 2022/07/25
- [bug#56759] [PATCH 11/20] gnu: Add ruby-citeproc., Philip McGrath, 2022/07/25
- [bug#56759] [PATCH 16/20] gnu: Add anystyle., Philip McGrath, 2022/07/25
- [bug#56759] [PATCH 20/20] gnu: anystyle: Use GDBM by default., Philip McGrath, 2022/07/25
- [bug#56759] [PATCH 14/20] gnu: Add ruby-anystyle-data., Philip McGrath, 2022/07/25
- [bug#56759] [PATCH 18/20] gnu: ruby-anystyle: Initialize dictionary files., Philip McGrath, 2022/07/25
- [bug#56759] [PATCH 19/20] gnu: anystyle: Add tests for dictionary adapters.,
Philip McGrath <=
- [bug#56759] [PATCH v2 05/20] gnu: Add ruby-latex-decode., Philip McGrath, 2022/07/25