1# Before `make install' is performed this script should be runnable with 2# `make test'. After `make install' it should work as 3# `perl -I/usr/local/bin t/File-Rename-script.t' 4 5######################### 6 7# change 'tests => 1' to 'tests => last_test_to_print'; 8 9use Test::More tests => 2; 10push @INC, qw(blib/script) if -d 'blib'; 11unshift @INC, 't' if -d 't'; 12require 'testlib.pl'; 13 14my $script = script_name(); 15my $require_ok = eval { require($script) }; 16ok( $require_ok, 'require script - '. $script); 17die $@ unless $require_ok; 18 19######################### 20 21# Insert your test code below, the Test::More module is use()ed here so read 22# its man page ( perldoc Test::More ) for help writing this test script. 23 24my $dir = tempdir(); 25 26create(qw(bing.txt bong.txt)); 27 28# test 2 29 30main_argv('-E', 's/i/a/', '-E', 's/g/j/', 31 glob File::Spec->catfile($dir,'b*') ); 32is_deeply( [ sort(listdir($dir)) ], 33 [qw(banj.txt bonj.txt)], 'rename - files' ); 34 35File::Path::rmtree($dir); 36