From 064044d289446d58590ebe10117859c2fbb9c6e8 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 24 Aug 2014 17:04:49 -0400 Subject: [PATCH] Unit Tests - Upgraded to use the new template. --- test/bug.1043.t | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/test/bug.1043.t b/test/bug.1043.t index 68c36e5df..2e77d7768 100755 --- a/test/bug.1043.t +++ b/test/bug.1043.t @@ -33,8 +33,12 @@ use Test::More tests => 5; delete $ENV{'TASKDATA'}; delete $ENV{'TASKRC'}; +use File::Basename; +my $ut = basename ($0); +my $rc = $ut . '.rc'; + # Create the rc file. -if (open my $fh, '>', 'bug.rc') +if (open my $fh, '>', $rc) { print $fh "data.location=.\n"; print $fh "alias.samplealias=long\n"; @@ -43,17 +47,17 @@ if (open my $fh, '>', 'bug.rc') } # Bug - aliases should be listed by '_aliases' and not by '_commands' or '_zshcommands' -my $output = qx{../src/task rc:bug.rc _aliases 2>&1}; -like ($output, qr/samplealias/, 'aliases are listed in _aliases'); +my $output = qx{../src/task rc:$rc _aliases 2>&1}; +like ($output, qr/samplealias/, "$ut: aliases are listed in _aliases"); -$output = qx{../src/task rc:bug.rc _commands 2>&1}; -like ($output, qr/^information$/m, 'info is listed in _commands'); -unlike ($output, qr/samplealias/, 'aliases are not listed in _commands'); +$output = qx{../src/task rc:$rc _commands 2>&1}; +like ($output, qr/^information$/m, "$ut: info is listed in _commands"); +unlike ($output, qr/samplealias/, "$ut: aliases are not listed in _commands"); -$output = qx{../src/task rc:bug.rc _zshcommands 2>&1}; -like ($output, qr/^information:/m, 'info is listed in _zshcommands'); -unlike ($output, qr/samplealias/, 'aliases are not listed in _zshcommands'); +$output = qx{../src/task rc:$rc _zshcommands 2>&1}; +like ($output, qr/^information:/m, "$ut: info is listed in _zshcommands"); +unlike ($output, qr/samplealias/, "$ut: aliases are not listed in _zshcommands"); # Cleanup. -unlink qw(pending.data completed.data undo.data backlog.data bug.rc); +unlink qw(pending.data completed.data undo.data backlog.data), $rc; exit 0;