mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 04:13:07 +02:00
Unit Tests
- Upgraded to use the new template.
This commit is contained in:
parent
5c194f4847
commit
1237a4af10
1 changed files with 11 additions and 7 deletions
|
@ -33,24 +33,28 @@ use Test::More tests => 2;
|
|||
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";
|
||||
close $fh;
|
||||
}
|
||||
|
||||
# Bug 884: Extra space in path name.
|
||||
qx{../src/task rc:bug.rc add /one/two/three/ 2>&1};
|
||||
qx{../src/task rc:bug.rc add \\'/four/five/six/\\' 2>&1};
|
||||
my $output = qx{../src/task rc:bug.rc ls 2>&1};
|
||||
qx{../src/task rc:$rc add /one/two/three/ 2>&1};
|
||||
qx{../src/task rc:$rc add \\'/four/five/six/\\' 2>&1};
|
||||
my $output = qx{../src/task rc:$rc ls 2>&1};
|
||||
|
||||
#like ($output, qr/\/one\/two\/three\//, "/one/two/three/ --> preserved");
|
||||
pass ("/one/two/three/ --> preserved -- TEST SKIPPED --");
|
||||
pass ("/$ut: one/two/three/ --> preserved -- TEST SKIPPED --");
|
||||
|
||||
like ($output, qr/\/four\/five\/six\//, "/four/five/six/ --> preserved");
|
||||
like ($output, qr/\/four\/five\/six\//, "$ut: /four/five/six/ --> preserved");
|
||||
|
||||
# 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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue