mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unit Tests
- Enhanced the bug #956 tests to cover both supported methods of eliminating extraneous output from commands (redirect stderr, and verbose=nothing).
This commit is contained in:
parent
9d1ae99656
commit
c2ccd1b3ee
1 changed files with 18 additions and 7 deletions
|
@ -28,7 +28,7 @@
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 5;
|
||||
use Test::More tests => 8;
|
||||
|
||||
# Create the rc file.
|
||||
if (open my $fh, '>', 'bug.rc')
|
||||
|
@ -43,14 +43,25 @@ if (open my $fh, '>', 'bug.rc')
|
|||
|
||||
qx{../src/task rc:bug.rc add test 2>&1};
|
||||
|
||||
my $output = qx{TASKRC=bug.rc ../src/task rc:bug.rc ids 2>&1};
|
||||
unlike ($output, qr/TASKRC/ms, 'The header does not appear with "ids"');
|
||||
# Solution 1: rc.verbose=nothing
|
||||
my $output = qx{TASKRC=bug.rc ../src/task rc:bug.rc rc.verbose=nothing ids 2>&1};
|
||||
unlike ($output, qr/TASKRC/ms, 'The header does not appear with "ids" (rc.verbose=nothing)');
|
||||
|
||||
$output = qx{TASKRC=bug.rc ../src/task uuids 2>&1};
|
||||
unlike ($output, qr/TASKRC/ms, 'The header does not appear with "uuids"');
|
||||
$output = qx{TASKRC=bug.rc ../src/task rc.verbose=nothing uuids 2>&1};
|
||||
unlike ($output, qr/TASKRC/ms, 'The header does not appear with "uuids" (rc.verbose=nothing)');
|
||||
|
||||
$output = qx{TASKRC=bug.rc ../src/task _ids 2>&1};
|
||||
unlike ($output, qr/TASKRC/ms, 'The header does not appear with "_ids"');
|
||||
$output = qx{TASKRC=bug.rc ../src/task rc.verbose=nothing uuids 2>&1};
|
||||
unlike ($output, qr/TASKRC/ms, 'The header does not appear with "uuids" (rc.verbose=nothing)');
|
||||
|
||||
# Solution 2: task ... 2>/dev/null
|
||||
$output = qx{TASKRC=bug.rc ../src/task rc:bug.rc ids 2>/dev/null};
|
||||
unlike ($output, qr/TASKRC/ms, 'The header does not appear with "ids" (2>/dev/null)');
|
||||
|
||||
$output = qx{TASKRC=bug.rc ../src/task _ids 2>/dev/null};
|
||||
unlike ($output, qr/TASKRC/ms, 'The header does not appear with "_ids" (2>/dev/null)');
|
||||
|
||||
$output = qx{TASKRC=bug.rc ../src/task _ids 2>/dev/null};
|
||||
unlike ($output, qr/TASKRC/ms, 'The header does not appear with "_ids" (2>/dev/null)');
|
||||
|
||||
### Cleanup.
|
||||
unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue