From 0db2ff65e7101951fedf4357aa37aaf92f7df431 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 25 Jan 2017 20:52:27 +0100 Subject: bournish: Extend 'rm' command. * guix/build/bournish.scm (rm-command): New procedure. (%commands): Use it. * tests/bournish.scm: Add tests for "rm" and "rm -r". --- tests/bournish.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/bournish.scm') diff --git a/tests/bournish.scm b/tests/bournish.scm index 0f529ce42f..3b40ce2643 100644 --- a/tests/bournish.scm +++ b/tests/bournish.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Ludovic Courtès +;;; Copyright © 2017 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -38,5 +39,16 @@ (read-and-compile (open-input-string "cd /foo\npwd\nls") #:from %bournish-language #:to 'scheme)) +(test-equal "rm" + '(for-each delete-file (list "foo" "bar")) + (read-and-compile (open-input-string "rm foo bar\n") + #:from %bournish-language #:to 'scheme)) + +(test-equal "rm -r" + '(for-each (@ (guix build utils) delete-file-recursively) + (list "/foo" "/bar")) + (read-and-compile (open-input-string "rm -r /foo /bar\n") + #:from %bournish-language #:to 'scheme)) + (test-end "bournish") -- cgit v1.2.3