1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (test-texlive)
20 #:use-module (gnu packages tex)
21 #:use-module (guix import texlive)
22 #:use-module (guix tests)
23 #:use-module (guix build utils)
24 #:use-module (srfi srfi-1)
25 #:use-module (srfi srfi-64)
26 #:use-module (srfi srfi-26)
27 #:use-module (ice-9 match))
29 (test-begin "texlive")
35 <caption>Foomatic frobnication in LuaLaTeX</caption>
36 <authorref id=\"rekado\"/>
37 <license type=\"lppl1.3\"/>
38 <version number=\"2.6a\"/>
41 Foo is a package for LuaLaTeX. It provides an interface to frobnicate gimbals
42 in a foomatic way with the LuaTeX engine.
45 The package requires the bar and golly
46 bundles for extremely special specialties.
49 <ctan path=\"/macros/latex/contrib/foo\" file=\"true\"/>
50 <texlive location=\"foo\"/>
51 <keyval key=\"topic\" value=\"tests\"/>
56 '(*TOP* (entry (@ (id "foo"))
58 (caption "Foomatic frobnication in LuaLaTeX")
59 (authorref (@ (id "rekado")))
60 (license (@ (type "lppl1.3")))
61 (version (@ (number "2.6a")))
63 (p "\n Foo is a package for LuaLaTeX. It provides an interface to frobnicate gimbals\n in a foomatic way with the LuaTeX engine.\n ")
64 (p "\n The package requires the bar and golly\n bundles for extremely special specialties.\n "))
65 (ctan (@ (path "/macros/latex/contrib/foo") (file "true")))
66 (texlive (@ (location "foo")))
67 (keyval (@ (value "tests") (key "topic")))
70 (test-equal "fetch-sxml: returns SXML for valid XML"
72 (mock ((guix http-client) http-fetch
75 ((@@ (guix import texlive) fetch-sxml) "foo")))
78 (test-assert "sxml->package"
79 ;; Replace network resources with sample data.
80 (mock ((guix build svn) svn-fetch
81 (lambda* (url revision directory
82 #:key (svn-command "svn")
86 (with-output-to-file (string-append directory "/foo")
88 (display "source")))))
89 (let ((result ((@@ (guix import texlive) sxml->package) sxml)))
92 ('name "texlive-latex-foo")
96 ('uri ('texlive-ref "latex" "foo"))
100 ('build-system 'texlive-build-system)
101 ('arguments ('quote (#:tex-directory "latex/foo")))
102 ('home-page "http://www.ctan.org/pkg/foo")
103 ('synopsis "Foomatic frobnication in LuaLaTeX")
105 "Foo is a package for LuaLaTeX. It provides an interface to \
106 frobnicate gimbals in a foomatic way with the LuaTeX engine. The package \
107 requires the bar and golly bundles for extremely special specialties.")
108 ('license 'lppl1.3+))
112 (format #t "~s\n" result)
113 (pk 'fail result #f)))))))