Added unit tests for bug fix #333
This commit is contained in:
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 12;
|
use Test::More tests => 15;
|
||||||
|
|
||||||
# Create the rc file.
|
# Create the rc file.
|
||||||
if (open my $fh, '>', 'dup.rc')
|
if (open my $fh, '>', 'dup.rc')
|
||||||
@@ -55,6 +55,12 @@ like ($output, qr/Description\s+FOO/, 'duplicate modified description');
|
|||||||
like ($output, qr/Priority\s+H/, 'duplicate added priority');
|
like ($output, qr/Priority\s+H/, 'duplicate added priority');
|
||||||
like ($output, qr/Tags\s+tag/, 'duplicate added tag');
|
like ($output, qr/Tags\s+tag/, 'duplicate added tag');
|
||||||
|
|
||||||
|
# Test the output of the duplicate command - returning id of duplicated task
|
||||||
|
$output = qx{../task rc:dup.rc duplicate 1};
|
||||||
|
like ($output, qr/Duplicated\s+1\s+'foo'/, 'duplicate output task id and description');
|
||||||
|
like ($output, qr/Duplicated\s+1\s+task/, 'duplicate output number of tasks duplicated');
|
||||||
|
like ($output, qr/Created\s+task\s+4/, 'duplicate output of new task id');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink 'pending.data';
|
unlink 'pending.data';
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
ok (!-r 'pending.data', 'Removed pending.data');
|
||||||
|
|||||||
Reference in New Issue
Block a user