aboutsummaryrefslogtreecommitdiff
path: root/tests/glob.scm
blob: 2a5a40c3c6b38a3c46f0f2d9f8d5779b7170d28b (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (test-glob)
  #:use-module (guix glob)
  #:use-module (srfi srfi-64))


(test-begin "glob")

(define-syntax test-string->sglob
  (syntax-rules (=>)
    ((_ pattern => result rest ...)
     (begin
       (test-equal (format #f "string->sglob, ~s" pattern)
         result
         (string->sglob pattern))
       (test-string->sglob rest ...)))
    ((_)
     #t)))

(define-syntax test-glob-match
  (syntax-rules (matches and not)
    ((_ (pattern-string matches strings ... (and not others ...)) rest ...)
     (begin
       (test-assert (format #f "glob-match? ~s" pattern-string)
         (let ((pattern (string->compiled-sglob pattern-string)))
           (and (glob-match? pattern strings) ...
                (not (glob-match? pattern others)) ...)))
       (test-glob-match rest ...)))
    ((_)
     #t)))

(test-string->sglob
 "foo" => "foo"
 "?foo*" => '(? "foo" *)
 "foo[1-5]" => '("foo" (range #\1 #\5))
 "foo[abc]bar" => '("foo" (set #\a #\b #\c) "bar")
 "foo[a[b]c]bar" => '("foo" (set #\a #\[ #\b #\] #\c) "bar")
 "[123]x" => '((set #\1 #\2 #\3) "x")
 "[a-z]" => '((range #\a #\z))
 "**/*.scm" => '(**/ * ".scm"))

(test-glob-match
 ("foo" matches "foo" (and not "foobar" "barfoo"))
 ("foo*" matches "foo" "foobar" (and not "xfoo"))
 ("foo??bar" matches "fooxxbar" "fooZZbar"
  (and not "foobar" "fooxxxbar" "fooxxbarzz"))
 ("foo?" matches "foox" (and not "fooxx"))
 ("ab[0-9]c" matches "ab0c" "ab7c" "ab9c"
  (and not "ab-c" "ab00c" "ab3"))
 ("ab[cdefg]" matches "abc" "abd" "abg"
  (and not "abh" "abcd" "ab["))
 ("foo/**/*.scm" matches "foo/bar/baz.scm" "foo/bar.scm" "foo/bar/baz/zab.scm"
  (and not "foo/bar/baz.java" "foo/bar.smc")))

(test-end "glob")
an title='2021-03-21 10:12:52 +0100'>2021-03-21gnu: python-pikepdf: Update to 2.9.1....* gnu/packages/python-xyz.scm (python-pikepdf): Update to 2.9.1. Nicolas Goaziou 2021-03-17gnu: python-pygments: Update to 2.7.4 [fixes CVE-2021-27291]....* gnu/packages/python-xyz.scm (python-pygments/fixed): New variable. (python-pygments)[replacement]: Graft. Léo Le Bouter 2021-03-17gnu: Use PACKAGE/INHERIT in more places....* gnu/packages/algebra.scm (fftwf, fftw-openmpi), gnu/packages/audio.scm (ztoolkit-rsvg), gnu/packages/bioinformatics.scm (python2-dendropy), gnu/packages/boost.scm (boost-with-python2), gnu/packages/check.scm (python2-mock, python2-pytest-mock), gnu/packages/cups.scm (hplip-minimal), gnu/packages/freedesktop.scm (libinput-minimal), gnu/packages/gettext.scm (gnu-gettext), gnu/packages/glib.scm (python2-pygobject), gnu/packages/gnome.scm (gdl-minimal, libsoup-minimal, python2-pyatspi), gnu/packages/groff.scm (groff-minimal), gnu/packages/jami.scm (ffmpeg-jami), gnu/packages/libcanberra.scm (libcanberra/gtk+-2), gnu/packages/lirc.scm (python2-lirc), gnu/packages/llvm.scm (clang-runtime-3.5), gnu/packages/mpi.scm (java-openmpi, openmpi-thread-multiple), gnu/packages/node.scm (libnode), gnu/packages/onc-rpc.scm (libtirpc/hurd), gnu/packages/python-compression.scm (bitshuffle-for-snappy), gnu/packages/python-crypto.scm (python2-pycrypto, python2-cryptography) (python2-cryptography, python2-m2crypto), gnu/packages/python-web.scm (python2-html2text, python2-tornado) (python2-terminado, python2-ndg-httpsclient, python2-websocket-client) (python2-rauth, python2-url, python2-s3transfer), gnu/packages/python-xyz.scm (python2-psutil, python2-serpent) (python2-humanfriendly, python2-empy, python2-parse-type, python2-polib) (python2-jsonschema, python2-pystache, python2-cython, python2-numpydoc) (python2-ipyparallel, python2-traitlets, python2-dbus) (python2-beautifulsoup4, python2-pep517, python2-flake8, python2-llfuse) (python2-tlsh, python-file, python2-notebook, python-jupyter-console-minimal) (python2-contextlib2, python2-promise, python2-anyjson, python2-amqp) (python2-kombu, python2-billiard, python2-celery, python2-whoosh) (python2-jellyfish, python-rope, ptpython-2, python2-binaryornot) (python2-setproctitle, python2-argcomplete, python2-xopen, python2-isort) (python2-radon, python2-rfc6555, python2-activepapers, python2-send2trash) (python2-cloudpickle, python2-reparser), gnu/packages/python.scm (python2-called-python), gnu/packages/qt.scm (python2-sip, python-pyqt-without-qtwebkit, python2-pyqt) (python-qscintilla, python-pyqt+qscintilla), gnu/packages/scanner.scm (sane-backends), gnu/packages/sdl.scm (guile3.0-sdl2), gnu/packages/selinux.scm (checkpolicy, libselinux, libsemanage, secilc) (python-sepolgen, policycoreutils), gnu/packages/serialization.scm (lua5.1-libmpack, lua5.2-libmpack), gnu/packages/simulation.scm (fenics), gnu/packages/statistics.scm (python2-statsmodels), gnu/packages/texinfo.scm (info-reader), gnu/packages/wxwidgets.scm (wxwidgets-gtk2, wxwidgets-gtk2-3.1), gnu/packages/xml.scm (xmlsec-nss), gnu/packages/xorg.scm (uim-gtk, uim-qt), guix/build-system/python.scm (package-with-explicit-python) (strip-python2-variant): Use PACKAGE/INHERIT. Mark H Weaver 2021-03-16gnu: snakemake: Add missing inputs....* gnu/packages/python-xyz.scm (snakemake)[propagated-inputs]: Add python-nbformat, python-pulp, and python-toposort. Ricardo Wurmus 2021-03-16gnu: Add python-toposort....* gnu/packages/python-xyz.scm (python-toposort): New variable. Ricardo Wurmus 2021-03-16gnu: Add python-pulp....* gnu/packages/python-xyz.scm (python-pulp): New variable. Ricardo Wurmus 2021-03-16gnu: Add python-amply....* gnu/packages/python-xyz.scm (python-amply): New variable. Ricardo Wurmus 2021-03-16gnu: python-pikepdf: Update to 2.9.0....* gnu/packages/python-xyz.scm (python-pikepdf): Update to 2.9.0. Nicolas Goaziou 2021-03-16gnu: glances: Update to 3.1.6....* gnu/packages/python-xyz.scm (glances): Update to 3.1.6. Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Stefan Reichör 2021-03-15gnu: poetry: Update to 1.1.5....* gnu/packages/python-xyz.scm (poetry): Update to 1.1.5. Signed-off-by: Christopher Baines <mail@cbaines.net> Tanguy Le Carrour 2021-03-15gnu: Add python-lmfit....* gnu/packages/python-xyz.scm (python-lmfit): New variable. Ricardo Wurmus 2021-03-15gnu: Add python-asteval....* gnu/packages/python-xyz.scm (python-asteval): New variable. Ricardo Wurmus 2021-03-15gnu: Add python-uncertainties....* gnu/packages/python-xyz.scm (python-uncertainties): New variable. Ricardo Wurmus 2021-03-14gnu: python-eventlet: Add missing dependencies....* gnu/packages/python-xyz.scm (python-eventlet)[propagated-inputs]: Add python-dnspython and python-monotonic. Eric Bavier 2021-03-14gnu: Add python-bidict....* gnu/packages/python-xyz.scm (python-bidict): New variable. Eric Bavier 2021-03-14gnu: Add python-sortedcollections....* gnu/packages/python-xyz.scm (python-sortedcollections): New variable. Eric Bavier 2021-03-13gnu: Add python-pooch....* gnu/packages/python-xyz.scm (python-pooch): New variable. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Vinicius Monego 2021-03-13gnu: Add python-click-default-group....* /gnu/packages/python-xyz.scm (python-click-default-group): New variable. Co-authored-by: Raghav Gururajan <rg@raghavgururajan.name> Co-authored-by: jgart <jgart@dismail.de> Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> LibreMiami 2021-03-12gnu: snakemake: Update to 5.32.2....* gnu/packages/python-xyz.scm (snakemake): Update to 5.32.2. [arguments]: Adjust patch in call-wrapper-not-wrapped-snakemake. Ricardo Wurmus 2021-03-10gnu: python-pikepdf: Update to 2.8.0.post2....* gnu/packages/python-xyz.scm (python-pikepdf): Update to 2.8.0.post2. Nicolas Goaziou 2021-03-10gnu: python-aiofiles: Update to 0.6.0....* gnu/packages/python-xyz.scm (python-aiofiles): Update to 0.6.0. Lars-Dominik Braun 2021-03-10gnu: python-ujson: Update to 4.0.2....* gnu/packages/python-xyz.scm (python-ujson): Update to 4.0.2. Lars-Dominik Braun 2021-03-10gnu: python-shouldbe: Remove....Unmaintained upstream and its only dependent (python-gssapi) dropped it. * gnu/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch: Remove. * gnu/local.mk: Drop patch file. * gnu/packages/python-xyz.scm (python-shouldbe): Remove. Lars-Dominik Braun 2021-03-10gnu: python-gssapi: Update to 1.6.12....* gnu/packages/python-xyz.scm (python-gssapi) [version]: Update to 1.6.12. [arguments]: Tests have been fixed upstream, remove. [native-inputs]: python-shouldbea is not required any more, remove. Lars-Dominik Braun 2021-03-09gnu: python-logwrap: Update to 8.2.0.post0....* gnu/packages/python-xyz.scm (python-logwrap): Update to 8.2.0.post0. [arguments]: Disable tests. Replace 'check phase. [propagated-inputs]: Remove python-six, python-typing. [native-inputs]: Remove unzip, python-pytest-cov, python-pytest-runner. Add python-setuptools-scm, python-toml, python-wheel. [home-page]: Update to new upstream URI. Efraim Flashner 2021-03-07gnu: python-pikepdf: Update to 2.8.0.post1....* gnu/packages/python-xyz.scm (python-pikepdf): Update to 2.8.0.post1. Nicolas Goaziou 2021-03-06Merge branch 'master' into core-updatesChristopher Baines 2021-03-06gnu: Add python-listparser....* gnu/packages/python-xyz.scm (python-listparser): New variable. Léo Le Bouter 2021-03-06gnu: Add python-readability....* gnu/packages/python-xyz.scm (python-readability): New variable. Léo Le Bouter