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)
47d8a77a67013c48166561134d92b5224264'>services: Add Shepherd 'configuration' action to various services....Ludovic Courtès 2022-11-17tests: root-unmount: Wait for the first QEMU process to finish....Ludovic Courtès 2022-10-07marionette: Make marionette-screen-text private....Maxim Cournoyer 2022-08-28build: marionette: Add support for Tesseract OCR....Maxim Cournoyer 2022-07-01image: Add default value for partition initializer....Ludovic Courtès 2022-07-01services: root-file-system: Cleanly unmount upon shutdown....Ludovic Courtès 2022-03-19tests: install: Adjust the timeouts on two failing tests....Maxim Cournoyer 2021-11-11gnu: glibc: Look for the current timezone in /etc/localtime....Ludovic Courtès 2021-09-27tests: base: Fix the screendump test....Mathieu Othacehe 2021-09-26tests: Reduce boilerplate for users of 'system-test-runner'....Ludovic Courtès 2021-09-25tests: Adjust to SRFI-64 as found in Guile 3.0.7....Ludovic Courtès 2021-04-13tests: halt: Fix it....Mathieu Othacehe 2020-10-26tests: Fix nss-mdns test....Mathieu Othacehe 2020-09-10tests: install: Fix gui-installed-desktop-os-encrypted test....Mathieu Othacehe 2020-04-07services: guix: Add 'set-http-proxy' action....Ludovic Courtès 2020-04-06services: syslog: Create log files as non-world-readable....Ludovic Courtès 2020-03-05tests: 'run-basic-test' can enter a root password....Ludovic Courtès 2019-06-24tests: Import (guix build utils) in the marionette....Ludovic Courtès 2019-05-15tests: 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