1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
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/>.
20 (define-module (test-ui)
21 #:use-module (guix ui)
22 #:use-module (srfi srfi-1)
23 #:use-module (srfi srfi-64))
25 ;; Test the (guix ui) module.
28 "GNU Guile is an implementation of the Scheme programming language, with
29 support for many SRFIs, packaged for use in a wide variety of environments.
30 In addition to implementing the R5RS Scheme standard and a large subset of
31 R6RS, Guile includes a module system, full access to POSIX system calls,
32 networking support, multiple threads, dynamic linking, a foreign function call
33 interface, and powerful string processing.")
38 (test-assert "fill-paragraph"
39 (every (lambda (column)
40 (every (lambda (width)
42 (<= (string-length line) width))
43 (string-split (fill-paragraph %paragraph
46 '(15 30 35 40 45 50 60 70 80 90 100)))
49 (test-assert "fill-paragraph, consecutive newlines"
50 (every (lambda (width)
52 (string-prefix? "When STR" line))
54 (fill-paragraph (procedure-documentation fill-paragraph)
57 '(15 20 25 30 40 50 60)))
59 (test-equal "fill-paragraph, large unbreakable word"
60 '("Here is a" "very-very-long-word"
63 (fill-paragraph "Here is a very-very-long-word and that's it."
70 (exit (= (test-runner-fail-count (test-runner-current)) 0))