aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 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-sets)
  #:use-module (guix sets)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-26)
  #:use-module (srfi srfi-64))


(test-begin "sets")

(test-assert "set-contains?"
  (let* ((lst (iota 123))
         (set (list->set lst)))
    (and (every (cut set-contains? set <>)
                lst)
         (not (set-contains? set -1)))))

(test-assert "set->list"
  (let* ((lst (iota 123))
         (set (list->set lst)))
    (lset= = lst (set->list set))))

(test-assert "set-union"
  (let* ((a  (list 'a))
         (b  (list 'b))
         (s1 (setq a))
         (s2 (setq b))
         (s3 (set-union s1 s2)))
    (and (set-contains? s3 a)
         (set-contains? s3 b))))

(test-end)
it/gnu/tests/base.scm?id=33572a36624aa1c5cca409cfee36eb67982f4891'>tests: Skip unreliable "herd invalidate nscd" test....Ludovic Courtès 2019-05-15tests: 'getlogin' test creates its file atomically....Ludovic Courtès 2019-05-09services: Log-in services now require "pam_loginuid"....Ludovic Courtès 2019-03-08activation: Shared system home directories are now 555 and root-owned....Ludovic Courtès 2019-03-04tests: Use non-deprecated (guix store) API....Ludovic Courtès 2019-01-16services: avahi: Deprecate the 'avahi-service' procedure....Ludovic Courtès 2019-01-11services: Deprecate a few more service procedures....Ludovic Courtès 2018-12-18file-systems: Spawn a REPL only when interaction is possible....Ludovic Courtès 2018-11-18activation: Aways pass '-d HOME' to 'useradd'....Ludovic Courtès 2018-11-13services: nscd: Add 'invalidate' and 'statistics' actions....Ludovic Courtès 2018-10-18services: dhcp-client: Deprecate 'dhcp-client-service' procedure....Ludovic Courtès 2018-09-08tests: base: Add Guile-Gcrypt & co. to the search path....Ludovic Courtès 2018-07-13services: mcron: Add 'schedule' action....Ludovic Courtès 2018-07-03tests: basic: Wait for /var/run/shepherd/socket to be ready....Ludovic Courtès 2018-06-20services: boot: Take gexps instead of monadic gexps....Ludovic Courtès 2018-06-20services: cleanup: Expect file names to be UTF-8-encoded....Ludovic Courtès 2018-06-13tests: Honor the return value of 'start-service'....Clément Lassieur 2018-04-19gnu: mcron: Update to 1.1.1....Ludovic Courtès 2018-03-19gnu: mcron: Update to 1.1 and deprecate "mcron2"....Ludovic Courtès 2018-02-19tests: Remove outdated comment....Ludovic Courtès 2017-09-26tests: mcron: Adjust use of 'wait-for-file'....Ludovic Courtès 2017-09-08marionette: 'wait-for-file' can be passed a read procedure....Ludovic Courtès 2017-08-28services: user-processes: Reap child processes....Ludovic Courtès 2017-07-20tests: Use 'virtual-machine' records instead of monadic procedures....Ludovic Courtès 2017-06-12marionette: Factorize 'wait-for-file'....Ludovic Courtès 2017-05-30activation: Change permissions on /root to #o700....Ludovic Courtès 2017-05-18services: user-homes: Do not create home directories marked as no-create....Ludovic Courtès