mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-24 08:56:43 +02:00
Unit Tests
- Updated a test to use a command of length >= rc.abbreviation.minimum. - Removed useless setup/teardown tests.
This commit is contained in:
parent
622532c38e
commit
72ceee198a
1 changed files with 2 additions and 9 deletions
11
test/undo.t
11
test/undo.t
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 20;
|
use Test::More tests => 18;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
|
@ -39,7 +39,6 @@ if (open my $fh, '>', 'undo.rc')
|
||||||
print $fh "data.location=.\n",
|
print $fh "data.location=.\n",
|
||||||
"confirmation=no\n";
|
"confirmation=no\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'undo.rc', 'Created undo.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test the add/done/undo commands.
|
# Test the add/done/undo commands.
|
||||||
|
@ -55,7 +54,7 @@ $output = qx{../src/task rc:undo.rc undo 2>&1; ../src/task rc:undo.rc info 1 2>&
|
||||||
ok (-r 'completed.data', 'completed.data created');
|
ok (-r 'completed.data', 'completed.data created');
|
||||||
like ($output, qr/Status\s+Pending\n/, 'Pending');
|
like ($output, qr/Status\s+Pending\n/, 'Pending');
|
||||||
|
|
||||||
$output = qx{../src/task rc:undo.rc 1 do 2>&1; ../src/task rc:undo.rc list 2>&1 >/dev/null};
|
$output = qx{../src/task rc:undo.rc 1 done 2>&1; ../src/task rc:undo.rc list 2>&1 >/dev/null};
|
||||||
like ($output, qr/No matches/, 'No matches');
|
like ($output, qr/No matches/, 'No matches');
|
||||||
|
|
||||||
# Bug 1060: Test that if undo is given an argument it catches and reports the correct error.
|
# Bug 1060: Test that if undo is given an argument it catches and reports the correct error.
|
||||||
|
@ -96,10 +95,4 @@ else
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data undo.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data undo.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'undo.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue