1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (test-bournish)
21 #:use-module (guix build bournish)
22 #:use-module (system base compile)
23 #:use-module (system base language)
24 #:use-module (srfi srfi-64))
27 (test-begin "bournish")
29 (test-equal "single statement"
31 (read-and-compile (open-input-string "cd /foo")
32 #:from %bournish-language #:to 'scheme))
34 (test-equal "multiple statements"
38 ((@@ (guix build bournish) ls-command-implementation)))
39 (read-and-compile (open-input-string "cd /foo\npwd\nls")
40 #:from %bournish-language #:to 'scheme))
43 '(for-each delete-file (list "foo" "bar"))
44 (read-and-compile (open-input-string "rm foo bar\n")
45 #:from %bournish-language #:to 'scheme))
48 '(for-each (@ (guix build utils) delete-file-recursively)
50 (read-and-compile (open-input-string "rm -r /foo /bar\n")
51 #:from %bournish-language #:to 'scheme))