mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 04:13:07 +02:00
Unit Tests
- Filters must precede write-commands on the command line.
This commit is contained in:
parent
4a99723129
commit
01d3da90ae
4 changed files with 19 additions and 17 deletions
|
@ -33,7 +33,8 @@ use Test::More tests => 24;
|
||||||
# Create the rc file.
|
# Create the rc file.
|
||||||
if (open my $fh, '>', 'abbrev.rc')
|
if (open my $fh, '>', 'abbrev.rc')
|
||||||
{
|
{
|
||||||
print $fh "data.location=.\n";
|
print $fh "data.location=.\n",
|
||||||
|
"abbreviation.minimum=1\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'abbrev.rc', 'Created abbrev.rc');
|
ok (-r 'abbrev.rc', 'Created abbrev.rc');
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,20 +50,21 @@ qx{../src/task rc:annotate.rc add one};
|
||||||
qx{../src/task rc:annotate.rc add two};
|
qx{../src/task rc:annotate.rc add two};
|
||||||
qx{../src/task rc:annotate.rc add three};
|
qx{../src/task rc:annotate.rc add three};
|
||||||
qx{../src/task rc:annotate.rc add four};
|
qx{../src/task rc:annotate.rc add four};
|
||||||
qx{../src/task rc:annotate.rc annotate 1 foo1};
|
qx{../src/task rc:annotate.rc 1 annotate foo1};
|
||||||
diag ("5 second delay");
|
diag ("5 second delay");
|
||||||
sleep 1;
|
sleep 1;
|
||||||
qx{../src/task rc:annotate.rc annotate 1 foo2};
|
qx{../src/task rc:annotate.rc 1 annotate foo2};
|
||||||
sleep 1;
|
sleep 1;
|
||||||
qx{../src/task rc:annotate.rc annotate 1 foo3};
|
qx{../src/task rc:annotate.rc 1 annotate foo3};
|
||||||
sleep 1;
|
sleep 1;
|
||||||
qx{../src/task rc:annotate.rc annotate 2 bar1};
|
qx{../src/task rc:annotate.rc 2 annotate bar1};
|
||||||
sleep 1;
|
sleep 1;
|
||||||
qx{../src/task rc:annotate.rc annotate 2 bar2};
|
qx{../src/task rc:annotate.rc 2 annotate bar2};
|
||||||
sleep 1;
|
sleep 1;
|
||||||
qx{../src/task rc:annotate.rc annotate 3 baz1};
|
qx{../src/task rc:annotate.rc 3 annotate baz1};
|
||||||
|
|
||||||
my $output = qx{../src/task rc:annotate.rc rrr};
|
my $output = qx{../src/task rc:annotate.rc rrr};
|
||||||
|
diag ($output);
|
||||||
|
|
||||||
# ID Description
|
# ID Description
|
||||||
# -- -------------------------------
|
# -- -------------------------------
|
||||||
|
|
|
@ -46,20 +46,20 @@ if (open my $fh, '>', 'denotate.rc')
|
||||||
|
|
||||||
# Add four tasks, annotate one three times, one twice, one just once and one none.
|
# Add four tasks, annotate one three times, one twice, one just once and one none.
|
||||||
qx{../src/task rc:denotate.rc add one};
|
qx{../src/task rc:denotate.rc add one};
|
||||||
qx{../src/task rc:denotate.rc annotate 1 Ernie};
|
qx{../src/task rc:denotate.rc 1 annotate Ernie};
|
||||||
diag ("6 second delay");
|
diag ("6 second delay");
|
||||||
sleep 1;
|
sleep 1;
|
||||||
qx{../src/task rc:denotate.rc annotate 1 Bert};
|
qx{../src/task rc:denotate.rc 1 annotate Bert};
|
||||||
sleep 1;
|
sleep 1;
|
||||||
qx{../src/task rc:denotate.rc annotate 1 Bibo};
|
qx{../src/task rc:denotate.rc 1 annotate Bibo};
|
||||||
sleep 1;
|
sleep 1;
|
||||||
qx{../src/task rc:denotate.rc annotate 1 Kermit the frog};
|
qx{../src/task rc:denotate.rc 1 annotate Kermit the frog};
|
||||||
sleep 1;
|
sleep 1;
|
||||||
qx{../src/task rc:denotate.rc annotate 1 Kermit the frog};
|
qx{../src/task rc:denotate.rc 1 annotate Kermit the frog};
|
||||||
sleep 1;
|
sleep 1;
|
||||||
qx{../src/task rc:denotate.rc annotate 1 Kermit};
|
qx{../src/task rc:denotate.rc 1 annotate Kermit};
|
||||||
sleep 1;
|
sleep 1;
|
||||||
qx{../src/task rc:denotate.rc annotate 1 Kermit and Miss Piggy};
|
qx{../src/task rc:denotate.rc 1 annotate Kermit and Miss Piggy};
|
||||||
|
|
||||||
my $output = qx{../src/task rc:denotate.rc rrr};
|
my $output = qx{../src/task rc:denotate.rc rrr};
|
||||||
|
|
||||||
|
|
|
@ -111,11 +111,11 @@ $output = qx{../src/task rc:seq.rc info 4};
|
||||||
like ($output, qr/Priority\s+H/, 'sequence duplicate 2');
|
like ($output, qr/Priority\s+H/, 'sequence duplicate 2');
|
||||||
|
|
||||||
# Test sequences in annotate
|
# Test sequences in annotate
|
||||||
qx{../src/task rc:seq.rc annotate 1,2 note};
|
qx{../src/task rc:seq.rc 1,2 annotate note};
|
||||||
$output = qx{../src/task rc:seq.rc info 1};
|
$output = qx{../src/task rc:seq.rc info 1};
|
||||||
like ($output, qr/\d+\/\d+\/\d+ note/, 'sequence annotate 1');
|
like ($output, qr/\d+\/\d+\/\d+ note/, 'sequence 1 annotate');
|
||||||
$output = qx{../src/task rc:seq.rc info 2};
|
$output = qx{../src/task rc:seq.rc info 2};
|
||||||
like ($output, qr/\d+\/\d+\/\d+ note/, 'sequence annotate 2');
|
like ($output, qr/\d+\/\d+\/\d+ note/, 'sequence 2 annotate');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink 'pending.data';
|
unlink 'pending.data';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue