use strict;
use warnings;
-use Test::More tests => 16;
+use Test::More tests => 20;
use Test::NoWarnings;
use autodie;
testfileset('add new array', ".$/", [['foo','.'], ''], 2, ".$/foo$/.$/");
testfileset('replace by array', "$/foo$/.$/", [['foo',''], ''], 3, "foo$/.$/foo$/$/");
-testfileset('partial add', "foo$/$/", [['foo','.'], 'foo'], 1, "foo$/$/.$/");
+testfileset('partial add', "foo$/$/", [['foo','.'], 'foo'], 1, "foo$/$/.$/");
-is(remove_tree($target), 14, 'no unexpected files');
+my $SAMPLE2 = "$/foo$/and$/bar$/.$/";
+testfileset('keep pair', $SAMPLE2, [['foo','bar']], 0, "$/foo$/and$/bar$/.$/");
+testfileset('keep order', $SAMPLE2, [['bar','foo']], 2, "$/and$/bar$/.$/foo$/");
+testfileset('replace pair', $SAMPLE2, [['fooo','barr'], ['bar','foo']], 4, "$/and$/.$/fooo$/barr$/");
+testfileset('mixed arrays', $SAMPLE2, [['bar','foo','.'],['ignore',qr/a/]], 3, "$/foo$/bar$/.$/foo$/.$/");
+
+is(remove_tree($target), 18, 'no unexpected files');