mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unit Tests
- Corrected one time stamp, but not all. - Removed useless setup/teardown tests.
This commit is contained in:
parent
afd948167f
commit
2da3258dd0
1 changed files with 5 additions and 12 deletions
17
test/uuid.t
17
test/uuid.t
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 26;
|
use Test::More tests => 24;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
|
@ -43,7 +43,6 @@ if (open my $fh, '>', 'uuid.rc')
|
||||||
"report.unittest.filter=status:pending\n",
|
"report.unittest.filter=status:pending\n",
|
||||||
"report.unittest.sort=id\n";
|
"report.unittest.sort=id\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'uuid.rc', 'Created uuid.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (open my $fh, '>', 'pending.data')
|
if (open my $fh, '>', 'pending.data')
|
||||||
|
@ -99,27 +98,21 @@ like ($output, qr/UUNNDDOO/, 'task UUNNDDOO modified status to pending');
|
||||||
$output = qx{../src/task rc:uuid.rc completed 2>&1};
|
$output = qx{../src/task rc:uuid.rc completed 2>&1};
|
||||||
unlike ($output, qr/UUNNDDOO/, 'task does not list UUNNDDOO after modification');
|
unlike ($output, qr/UUNNDDOO/, 'task does not list UUNNDDOO after modification');
|
||||||
|
|
||||||
qx{../src/task rc:uuid.rc d71d3566-7a6b-4c32-8f0b-6de75bb9397b modify start:1293796800 2>&1};
|
qx{../src/task rc:uuid.rc d71d3566-7a6b-4c32-8f0b-6de75bb9397b modify start:12/31/2010 2>&1};
|
||||||
$output = qx{../src/task rc:uuid.rc unittest 2>&1};
|
$output = qx{../src/task rc:uuid.rc unittest 2>&1};
|
||||||
like ($output, qr/12\/31\/2010/, 'modified start date of task ssttaarrtt');
|
like ($output, qr/12\/31\/2010/, 'modified start date of task ssttaarrtt');
|
||||||
|
|
||||||
qx{../src/task rc:uuid.rc 727baa6c-65b8-485e-a810-e133e3cd83dc modify end:1293796800 2>&1};
|
qx{../src/task rc:uuid.rc 727baa6c-65b8-485e-a810-e133e3cd83dc modify end:12/31/2010 2>&1};
|
||||||
$output = qx{../src/task rc:uuid.rc completed 2>&1};
|
$output = qx{../src/task rc:uuid.rc completed 2>&1};
|
||||||
like ($output, qr/12\/31\/2010/, 'modified end date of task eenndd');
|
like ($output, qr/12\/31\/2010/, 'modified end date of task eenndd');
|
||||||
|
|
||||||
qx{../src/task rc:uuid.rc aa4abef1-1dc5-4a43-b6a0-7872df3094bb modify entry:1293710400 2>&1};
|
qx{../src/task rc:uuid.rc aa4abef1-1dc5-4a43-b6a0-7872df3094bb modify entry:12/30/2010 2>&1};
|
||||||
qx{../src/task rc:uuid.rc aa4abef1-1dc5-4a43-b6a0-7872df3094bb modify start:1293883200 2>&1};
|
qx{../src/task rc:uuid.rc aa4abef1-1dc5-4a43-b6a0-7872df3094bb modify start:1/1/2011 2>&1};
|
||||||
$output = qx{../src/task rc:uuid.rc unittest 2>&1};
|
$output = qx{../src/task rc:uuid.rc unittest 2>&1};
|
||||||
like ($output, qr/12\/30\/2010/, 'modified entry date of task three');
|
like ($output, qr/12\/30\/2010/, 'modified entry date of task three');
|
||||||
like ($output, qr/1\/1\/2011/, 'added start date of task three with modify');
|
like ($output, qr/1\/1\/2011/, 'added start date of task three with modify');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data uuid.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data uuid.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'uuid.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue