aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2015, 2020 Ludovic Courtès <ludo@gnu.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-base32)
  #:use-module (gcrypt hash)
  #:use-module (guix base32)
  #:use-module (guix utils)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-34)
  #:use-module (srfi srfi-64)
  #:use-module (ice-9 match)
  #:use-module (rnrs bytevectors)
  #:use-module (rnrs io ports))

;; Test the (guix base32) module.

(test-begin "base32")

(test-assert "bytevector->base32-string"
  (fold (lambda (bv expected result)
          (and result
               (string=? (bytevector->base32-string bv)
                         expected)))
        #t

        ;; Examples from RFC 4648.
        (map string->utf8 '("" "f" "fo" "foo" "foob" "fooba" "foobar"))
        '(""
          "my"
          "mzxq"
          "mzxw6"
          "mzxw6yq"
          "mzxw6ytb"
          "mzxw6ytboi")))

(test-assert "base32-string->bytevector"
  (every (lambda (bv)
           (equal? (base32-string->bytevector
                    (bytevector->base32-string bv))
                   bv))
         ;; Examples from RFC 4648.
         (map string->utf8 '("" "f" "fo" "foo" "foob" "fooba" "foobar"))))

(test-assert "nix-base32-string->bytevector"
  (every (lambda (bv)
           (equal? (nix-base32-string->bytevector
                    (bytevector->nix-base32-string bv))
                   bv))
         ;; Examples from RFC 4648.
         (map string->utf8 '("" "f" "fo" "foo" "foob" "fooba" "foobar"))))

(test-equal "&invalid-base32-character"
  #\e
  (guard (c ((invalid-base32-character? c)
             (invalid-base32-character-value c)))
    (nix-base32-string->bytevector
     (string-append (make-string 51 #\a) "e"))))

(test-end)
ck.scm, gnu/packages/package-management.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/rdf.scm, gnu/packages/statistics.scm, gnu/packages/tls.scm, gnu/packages/tryton.scm, gnu/packages/version-control.scm: Adjust accordingly. Ricardo Wurmus 2017-11-13gnu: Move web packages from python to python-web....This is in part to address <https://bugs.gnu.org/27284>. * gnu/packages/python.scm (python-httplib2, python2-httplib2) (python-sockjs-tornado, python2-sockjs-tornado) (python-flask-babel, python2-flask-babel) (python-html5lib, python2-html5lib) (python-html5lib-0.9, python2-html5lib-0.9) (python-html5-parser, python2-html5-parser) (python-webencodings, python2-webencodings) (python-openid, python2-openid, python-cssutils, python2-cssutils) (python-cssselect, python2-cssutils) (python-openid-cla, python2-openid-cla) (python-openid-teams, python2-openid-teams) (python-tornado, python2-tornado) (python-tornado-http-auth, python-terminado, python2-terminado) (python-webob, python2-webob, python-zope-event, python2-zope-event) (python-zope-interface, python2-zope-interface) (python-zope-exceptions, python2-zope-exceptions) (python-zope-testing, python2-zope-testing) (python-zope-testrunner, python2-zope-testrunner) (python-zope-i18nmessageid, python2-zope-i18nmessageid) (python-zope-schema, python2-zope-schema) (python-zope-configuration, python2-zope-configuration) (python-zope-proxy, python2-zope-proxy) (python-zope-location, python2-zope-location) (python-zope-security, python2-zope-security) (python-zope-component, python2-zope-component) (python-ndg-httpsclient, python2-ndg-httpsclient) (python-websocket-client, python2-websocket-client) (python-requests-toolbelt, python2-requests-toolbelt) (python-rauth, python2-rauth, python-urllib3, python2-urllib3) (awscli, python-wsgiproxy2, python2-wsgiproxy2) (python-pastedeploy, python2-pastedeploy) (python-webtest, python2-webtest, python-flask, python2-flask) (python-flast-wtf, python2-flask-wtf) (python-flask-multistatic, python2-flask-multistatic) (python-cookies, python2-cookies) (python-responses, python2-responses) (python-geventhttpclient, python2-geventhttpclient) (python-requests-oauthlib, python2-requests-oauthlib) (python-url, python2-url, python-cachecontrol, python2-cachecontrol) (python-betamax, python2-betamax) (python-betamax-matchers, python2-betamax-matchers) (python-s3transfer, python2-s3transfer) (python-flask-restful, python-flask-basicauth) (python-flask-sqlalchemy, python-flask-restplus) (python-flask-restful-swagger, python-htmlmin, python2-htmlmin) (python-flask-htmlmin, python2-flask-htmlmin) (python-flask-login, python2-flask-login) (python-oauth2client, python-flask-oidc) (python-webassets, python-cssmin, python2-cssmin) (python-elasticsearch, python2-elasticsearch) (python-flask-script, python2-flask-script) (python-flask-migrate, python2-flask-migrate) (python-genshi, python2-genshi) (python-flask-principal, python2-flask-principal) (python-flask-httpauth, python2-flask-httpauth) (python-uritemplate, python2-uritemplate): Move to... * gnu/packages/python-web.scm: ... here. New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * gnu/packages/admin.scm, gnu/packages/backup.scm, gnu/packages/dav.scm, gnu/packages/django.scm, gnu/packages/docker.scm, gnu/packages/ebook.scm, gnu/packages/logging.scm, gnu/packages/mail.scm, gnu/packages/music.scm, gnu/packages/openstack.scm, gnu/packages/package-management.scm, gnu/packages/rdf.scm, gnu/packages/tls.scm, gnu/packages/tor.scm, gnu/packages/tryton.scm, gnu/packages/version-control.scm, gnu/packages/web-browsers.scm, gnu/packages/web.scm: Adjust accordingly. Ludovic Courtès 2017-11-05gnu: calibre: Install mimetypes....* gnu/packages/ebook.scm (calibre)[arguments]: Install mimetypes xml file. Signed-off-by: Marius Bakke <mbakke@fastmail.com> Brendan Tildesley 2017-11-05gnu: calibre: Add optipng as an input....* gnu/packages/ebook.scm (calibre)[inputs]: Add optipng. Signed-off-by: Marius Bakke <mbakke@fastmail.com> Brendan Tildesley 2017-11-05gnu: calibre: Add python2-dukpy as an input....* gnu/packages/ebook.scm (calibre)[inputs]: Add python2-dukpy. dukpy was unbundled from Calibre, so we need to to use the Guix version. Signed-off-by: Marius Bakke <mbakke@fastmail.com> Brendan Tildesley 2017-11-05gnu: calibre: Update to 3.11.1....* gnu/packages/ebook.scm (calibre): Update to 3.11.1. Signed-off-by: Marius Bakke <mbakke@fastmail.com> Brendan Tildesley 2017-09-06gnu: Update calibre to 3.6.0....* gnu/local.mk: Remove calibre-drop-unrar.patch * gnu/packages/ebook.scm (calibre): Update to 3.6.0. Add python-html5-parser input. * gnu/packages/patches/calibre-drop-unrar.patch: Remove file. Roel Janssen 2017-08-17gnu: Add fbreader....* gnu/packages/ebook.scm (fbreader): New variable. Danny Milosavljevic 2017-08-17gnu: Add liblinebreak....* gnu/packages/ebook.scm (liblinebreak): New variable. Danny Milosavljevic 2017-08-02gnu: calibre: Add python2-msgpack as an input....* gnu/packages/ebook.scm (calibre)[inputs]: Add python2-msgpack. Manolis Ragkousis 2017-06-22gnu: Update calibre to 3.0.0....* gnu/local.mk: Remove patch. * gnu/packages/ebook.scm (calibre): Update to 3.0.0. * gnu/packages/patches/calibre-dont-load-remote-icons.patch: Remove file. Roel Janssen 2017-05-19gnu: calibre: Don't create uninstaller....* gnu/packages/ebook.scm (calibre)[arguments]<#:phases>. Add 'patch-source' phase. Co-authored-by: Marius Bakke <mbakke@fastmail.com> Brendan Tildesley 2017-05-19gnu: calibre: Add exhaustive license list....* gnu/packages/ebook.scm (calibre): Add exhaustive license list. (chmlib)[license]: Use license: prefix. Co-authored-by: Marius Bakke <mbakke@fastmail.com> Brendan Tildesley 2017-05-19gnu: calibre: Add missing dependencies....* gnu/packages/ebook.scm (calibre)[inputs]: Add poppler, python2-dnspython, and python2-pygments. [arguments]: Remove old TODO comments. libwmf and psutil are no longer used. Signed-off-by: Marius Bakke <mbakke@fastmail.com> Brendan Tildesley 2017-05-19gnu: calibre: Unbundle chardet....* gnu/packages/ebook.scm (calibre)[source]: Delete bundled chardet. [inputs]: Add python2-chardet. Signed-off-by: Marius Bakke <mbakke@fastmail.com> Brendan Tildesley 2017-05-19gnu: calibre: Unbundle liberation fonts....*gnu/packages/ebook.scm (calibre)[source]: Delete liberation .ttf files. [native-inputs]: Add font-liberation. [arguments]: Calibre still references the bundled fonts, so we install the packaged fonts to the directory the bundled fonts would have been. Signed-off-by: Marius Bakke <mbakke@fastmail.com> Brendan Tildesley 2017-05-19gnu: calibre: Unbundle python2-markdown....* gnu/packages/ebook.scm (calibre)[snippet]: Replace python references to bundled markdown with packaged. Remove markdown from source. [inputs]: Add python2-markdown as a dependency. Signed-off-by: Marius Bakke <mbakke@fastmail.com> Brendan Tildesley 2017-05-19gnu: calibre: Import unbundle feedparser patch from debian....* gnu/packages/ebook.scm (calibre)[source]: Reference new patch file. [inputs]: Add python2-feedparser as an input. * gnu/packages/patches/calibre-use-packaged-feedparser.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Signed-off-by: Marius Bakke <mbakke@fastmail.com> Brendan Tildesley 2017-05-19gnu: calibre: Import dont-load-icons patch from debian....* gnu/packages/patches/calibre-dont-load-remote-icons.patch: New file. * gnu/packages/ebooks.scm (calibre)[source]: Add reference to patch file. * gnu/local.mk (dist_path_DATA): Add it. Signed-off-by: Marius Bakke <mbakke@fastmail.com> Brendan Tildesley 2017-05-19gnu: calibre: Update to 2.85.1....* gnu/packages/ebooks.scm (calibre): Update to 2.85.1. * gnu/packages/patches/calibre-drop-unrar.patch: Delete incompatible patch file. Recreate debian patch file from the latest calibre git revision. Signed-off-by: Marius Bakke <mbakke@fastmail.com> Brendan Tildesley 2017-01-04gnu: calibre: Update to 2.76.0....* gnu/packages/ebook.scm (calibre): Update to 2.76.0. Signed-off-by: Leo Famulari <leo@famulari.name> Alex Griffin 2016-12-12gnu: calibre: Update to 2.74.0....* gnu/packages/ebook.scm (calibre): Update to 2.74.0. Efraim Flashner 2016-12-12gnu: calibre: Update qt dependancies....* gnu/packages/ebook.scm (calibre)[native-inputs]: Remove qt, add qtbase. [inputs]: Remove qt, replace python2-pyqt@5.5 with python2-pyqt. Efraim Flashner 2016-12-02gnu: calibre: Do not use python setuptools for building....* gnu/packages/ebook.scm (calibre)[arguments]: Set #:use-setuptools? to false. Hartmut Goebel 2016-07-27gnu: calibre: Update to 2.63.0....* gnu/packages/ebook.scm (calibre): Update to 2.63.0. [inputs]: Remove unnecessary imagemagick dependency. [phases]: Use modify-phases. * gnu/packages/patches/calibre-drop-unrar.patch: Update for new version. Signed-off-by: Roel Janssen <roel@gnu.org> Alex Griffin 2016-07-26gnu: calibre: Build with non-modular Qt....* gnu/packages/ebook.scm (calibre)[native-inputs]: Replace QTBASE by QT. [inputs]: Replace QTBASE by QT and PYTHON2-PYQT by PYTHON2-PYQT-5.5. This essentially reverts commit 76806c54ed72f8f04079bbb187b186b833c103e1. Reported by Roel Janssen <roel@gnu.org>. Andreas Enge 2016-07-19gnu: calibre: Update to 2.62.0....* gnu/packages/ebook.scm (calibre): Update to 2.62.0. Efraim Flashner 2016-06-16gnu: calibre: Build with qtbase....* gnu/packages/ebook.scm (calibre)[inputs]: Remove qt, add qtbase. [native-inputs]: Remove qt, add qtbase. Efraim Flashner 2016-06-06gnu: calibre: Update to 2.58.0....* gnu/packages/ebook.scm (calibre): Update to 2.58.0. Efraim Flashner