mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Unit tests
- The dependencies.t unit test script failed to unlink completed.data, which polluted the subsequent test script. - Simplified some Perl in start.t. - Allowed for line wrapping in start.t.
This commit is contained in:
parent
e090f556da
commit
db27328558
3 changed files with 12 additions and 10 deletions
|
@ -190,6 +190,9 @@ like ($output, qr/\s1\s+One\s*\n\s2\s+Four\s*\n\s3\s+2\s+Five/, 'dependencies -
|
||||||
unlink 'pending.data';
|
unlink 'pending.data';
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
ok (!-r 'pending.data', 'Removed pending.data');
|
||||||
|
|
||||||
|
unlink 'completed.data';
|
||||||
|
ok (!-r 'completed.data', 'Removed completed.data');
|
||||||
|
|
||||||
unlink 'undo.data';
|
unlink 'undo.data';
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
ok (!-r 'undo.data', 'Removed undo.data');
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,6 @@ if (open my $fh, '<', './export.txt')
|
||||||
@lines = <$fh>;
|
@lines = <$fh>;
|
||||||
close $fh;
|
close $fh;
|
||||||
}
|
}
|
||||||
|
|
||||||
like ($lines[0], qr/^%YAML 1.1$/, 'export.yaml line 0');
|
like ($lines[0], qr/^%YAML 1.1$/, 'export.yaml line 0');
|
||||||
like ($lines[1], qr/^---$/, 'export.yaml line 1');
|
like ($lines[1], qr/^---$/, 'export.yaml line 1');
|
||||||
like ($lines[2], qr/^ task:$/, 'export.yaml line 2');
|
like ($lines[2], qr/^ task:$/, 'export.yaml line 2');
|
||||||
|
|
|
@ -68,8 +68,8 @@ unlike ($output, qr/two/, 'two deleted');
|
||||||
# Create the rc file.
|
# Create the rc file.
|
||||||
if (open my $fh, '>', 'start2.rc')
|
if (open my $fh, '>', 'start2.rc')
|
||||||
{
|
{
|
||||||
print $fh "data.location=.\n";
|
print $fh "data.location=.\n",
|
||||||
print $fh "journal.time=on\n";
|
"journal.time=on\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'start2.rc', 'Created start2.rc');
|
ok (-r 'start2.rc', 'Created start2.rc');
|
||||||
}
|
}
|
||||||
|
@ -85,21 +85,21 @@ like ($output, qr/Stopped task/, 'one stopped and annotated');
|
||||||
# Create the rc file.
|
# Create the rc file.
|
||||||
if (open my $fh, '>', 'start3.rc')
|
if (open my $fh, '>', 'start3.rc')
|
||||||
{
|
{
|
||||||
print $fh "data.location=.\n";
|
print $fh "data.location=.\n",
|
||||||
print $fh "journal.time=on\n";
|
"journal.time=on\n",
|
||||||
print $fh "journal.time.start.annotation=Nu kör vi\n";
|
"journal.time.start.annotation=Nu kör vi\n",
|
||||||
print $fh "journal.time.stop.annotation=Nu stannar vi\n";
|
"journal.time.stop.annotation=Nu stannar vi\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'start3.rc', 'Created start3.rc');
|
ok (-r 'start3.rc', 'Created start3.rc');
|
||||||
}
|
}
|
||||||
|
|
||||||
qx{../task rc:start3.rc start 1};
|
qx{../task rc:start3.rc start 1};
|
||||||
$output = qx{../task rc:start3.rc list};
|
$output = qx{../task rc:start3.rc list};
|
||||||
like ($output, qr/Nu kör vi/, 'one start and annotated with custom description');
|
like ($output, qr/Nu.+kör.+vi/ms, 'one start and annotated with custom description');
|
||||||
|
|
||||||
qx{../task rc:start3.rc stop 1};
|
qx{../task rc:start3.rc stop 1};
|
||||||
$output = qx{../task rc:start3.rc list};
|
$output = qx{../task rc:start3.rc list};
|
||||||
like ($output, qr/Nu stannar vi/, 'one stopped and annotated with custom description');
|
like ($output, qr/Nu.+stannar.+vi/ms, 'one stopped and annotated with custom description');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
ok (-r 'pending.data', 'Need to remove pending.data');
|
ok (-r 'pending.data', 'Need to remove pending.data');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue