fileset: array replace
[perl/file-rewrite.git] / t / 10-fileset.t
index dc800efa2a424d06c1605730c998e9771cfabfd0..db1575e9e51daf277ed0404fe7c16ac32a730ae0 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 13;
+use Test::More tests => 16;
 use Test::NoWarnings;
 
 use autodie;
@@ -57,5 +57,9 @@ testfileset('replace string', "1$/2$/3$/",  [4, 1],             2, "2$/3$/4$/");
 testfileset('replace all',    $BASICBODY,   ['', qr/^re/],      3, "noremove$/.$/$/");
 testfileset('keep first',     "foo$/bar$/foo$/", ['foo'],       1, "foo$/bar$/");
 
-is(remove_tree($target), 11, 'no unexpected files');
+testfileset('add new array',  ".$/",        [['foo','.'], ''],  2, ".$/foo$/.$/");
+testfileset('replace by array', "$/foo$/.$/", [['foo',''], ''], 3, "foo$/.$/foo$/$/");
+testfileset('partial add',    "foo$/$/",   [['foo','.'], 'foo'], 1, "foo$/$/.$/");
+
+is(remove_tree($target), 14, 'no unexpected files');