commit 8858d25ce886b86d80b133c74e62cc3ac2f732d5
parent 9f76e39ed86b0aaa0994e19748c56180963003fb
Author: Andreas Guldstrand <andreas.guldstrand@gmail.com>
Date: Tue, 3 May 2016 00:07:50 +0200
16-clean.t: test sboclean -w with $TMP set
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/t/16-clean.t b/t/16-clean.t
@@ -11,7 +11,7 @@ use Test::Sbotools qw/ make_slackbuilds_txt set_distclean set_noclean set_lo sbo
use SBO::Lib;
use File::Temp 'tempdir';
-plan tests => 14;
+plan tests => 15;
my $sboname = "nonexistentslackbuild";
my $perf = "/usr/sbo/distfiles/perf.dummy";
@@ -77,9 +77,10 @@ sboclean { exit => 1, expected => "You must specify at least one of -d or -w.\n"
set_sbo_home(tempdir(CLEANUP => 1));
sboclean '-d', { exit => 0, expected => "Nothing to do.\n" };
-# 13-14: sboclean -w -i with TMP set
+# 13-15: sboclean -w [-i] with TMP set
{
local $ENV{TMP} = tempdir(CLEANUP => 1);
sboclean qw/ -w -i /, { input => "n", expected => qr!\QRemove $ENV{TMP}/\E.*\Q? [n]\E! };
sboclean qw/ -w -i /, { input => "y\ny", expected => qr!\QRemove $ENV{TMP}/\E.*\Q? [n]\E! };
+ sboclean '-w', { input => "y", expected => qr/This will remove the entire contents of \Q$ENV{TMP}\E/ };
}