Unit Tests

- All unit tests most now clean up a residual undo.data file, so the
  number of tests increased, but with no benefit.
This commit is contained in:
Paul Beckingham 2009-06-28 17:07:25 -04:00
parent 5d8c28f72f
commit dc2bac1b5e
66 changed files with 261 additions and 78 deletions

View file

@ -30,9 +30,9 @@
#include <map>
#include <vector>
#include <string>
#include <Location.h>
#include <Filter.h>
#include <Task.h>
#include "Location.h"
#include "Filter.h"
#include "Task.h"
// Length of longest line.
#define T_LINE_MAX 32768

View file

@ -538,33 +538,23 @@ void Task::validate () const
if (has ("until"))
{
Date until (::atoi (get ("until").c_str ()));
if (due >= until)
if (due > until)
throw std::string ("An 'until' date must be after a 'due' date."); // TODO i18n
}
Date entry (::atoi (get ("entry").c_str ()));
if (entry >= due)
throw std::string ("An 'entry' date must be before a 'due' date."); // TODO i18n
if (has ("until"))
{
Date until (::atoi (get ("until").c_str ()));
if (entry >= until)
throw std::string ("An 'until' date must be after an 'entry' date."); // TODO i18n
}
if (has ("start"))
{
Date start (::atoi (get ("start").c_str ()));
if (entry >= start)
if (entry > start)
throw std::string ("A 'start' date must be after an 'entry' date."); // TODO i18n
}
if (has ("end"))
{
Date end (::atoi (get ("end").c_str ()));
if (entry >= end)
if (entry > end)
throw std::string ("An 'end' date must be after an 'entry' date."); // TODO i18n
}
}
@ -574,7 +564,7 @@ void Task::validate () const
{
Duration d;
if (! d.valid (get ("recur")))
throw std::string ("An 'end' date must be after an 'entry' date."); // TODO i18n
throw std::string ("A recurrence value must be valid."); // TODO i18n
}
}

View file

@ -24,6 +24,8 @@
// USA
//
////////////////////////////////////////////////////////////////////////////////
#ifndef INCLUDED_MAIN
#define INCLUDED_MAIN
#define FEATURE_TDB_OPT 1 // TDB Optimization reduces file I/O.
#define FEATURE_NEW_ID 1 // Echoes back new id.
@ -154,4 +156,5 @@ template <class T> void listDiff (
}
}
#endif
////////////////////////////////////////////////////////////////////////////////

View file

@ -1617,9 +1617,11 @@ std::string handleReportStats ()
if (!stat (file.c_str (), &s))
dataSize += s.st_size;
#ifdef FEADTURE_UNDO
file = location + "/undo.data";
if (!stat (file.c_str (), &s))
dataSize += s.st_size;
#endif
// TODO Include transaction log?

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 22;
use Test::More tests => 23;
# Create the rc file.
if (open my $fh, '>', 'abbrev.rc')
@ -92,6 +92,9 @@ like ($output, qr/ABSOLUTELY NO WARRANTY/, 'v');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'abbrev.rc';
ok (!-r 'abbrev.rc', 'Removed abbrev.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 14;
use Test::More tests => 15;
# Create the rc file.
if (open my $fh, '>', 'add.rc')
@ -70,6 +70,9 @@ like ($output, qr/Status\s+Pending\n/, 'add Pending');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'add.rc';
ok (!-r 'add.rc', 'Removed add.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 8;
use Test::More tests => 9;
# Create the rc file.
if (open my $fh, '>', 'annotate.rc')
@ -67,6 +67,9 @@ like ($output, qr/2 tasks/, 'count');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'annotate.rc';
ok (!-r 'annotate.rc', 'Removed annotate.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 4;
use Test::More tests => 5;
# Create the rc file.
if (open my $fh, '>', 'append.rc')
@ -48,6 +48,9 @@ like ($output, qr/Description\s+foo\sbar\n/, 'append worked');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'append.rc';
ok (!-r 'append.rc', 'Removed append.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 8;
use Test::More tests => 9;
# Create the rc file.
if (open my $fh, '>', 'args.rc')
@ -64,6 +64,9 @@ like ($output, qr/Description\s+project:p\spri:H\s\+tag\sfoo\n/ms, 'task 1 -- pr
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'args.rc';
ok (!-r 'args.rc', 'Removed args.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 4;
use Test::More tests => 5;
# Create the rc file.
if (open my $fh, '>', 'bench.rc')
@ -96,6 +96,9 @@ ok (!-r 'pending.data', 'Removed pending.data');
unlink 'completed.data';
ok (!-r 'completed.data', 'Removed completed.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'bench.rc';
ok (!-r 'bench.rc', 'Removed bench.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 4;
use Test::More tests => 5;
# Create the rc file.
if (open my $fh, '>', 'bug_annotate.rc')
@ -47,6 +47,9 @@ like ($output, qr/Cannot apply a blank annotation./, 'failed on blank annotation
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'bug_annotate.rc';
ok (!-r 'bug_annotate.rc', 'Removed bug_annotate.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 13;
use Test::More tests => 14;
# Create the rc file.
if (open my $fh, '>', 'annual.rc')
@ -72,6 +72,9 @@ like ($output, qr/11\s+1\/1\/2009\s+-\s+foo/, 'synthetic 10 no creep');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'annual.rc';
ok (!-r 'annual.rc', 'Removed annual.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 6;
use Test::More tests => 7;
# Create the rc file.
if (open my $fh, '>', 'bug_concat.rc')
@ -71,6 +71,9 @@ like ($output, qr/Description\s+aaa bbb:ccc ddd\n/, 'properly concatenated');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'bug_concat.rc';
ok (!-r 'bug_concat.rc', 'Removed bug_concat.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 5;
use Test::More tests => 6;
# Create the rc file.
if (open my $fh, '>', 'hang.rc')
@ -76,6 +76,9 @@ ok (!-r 'shadow.txt', 'Removed shadow.txt');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'hang.rc';
ok (!-r 'hang.rc', 'Removed hang.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 41;
use Test::More tests => 42;
# Create the rc file.
if (open my $fh, '>', 'period.rc')
@ -157,6 +157,9 @@ like ($output, qr/\b2y\b/, 'verify 2y');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'period.rc';
ok (!-r 'period.rc', 'Removed period.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 5;
use Test::More tests => 6;
# Create the rc file.
if (open my $fh, '>', 'bug_sort.rc')
@ -54,6 +54,9 @@ like ($output, qr/three.*one.*two/msi, 'list did not hang after pri:H on 1');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'bug_sort.rc';
ok (!-r 'bug_sort.rc', 'Removed bug_sort.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 6;
use Test::More tests => 7;
# Create the rc file.
if (open my $fh, '>', 'summary.rc')
@ -60,6 +60,9 @@ ok (!-r 'pending.data', 'Removed pending.data');
unlink 'completed.data';
ok (!-r 'completed.data', 'Removed completed.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'summary.rc';
ok (!-r 'summary.rc', 'Removed summary.rc');

View file

@ -30,7 +30,7 @@
use strict;
use warnings;
use Test::More tests => 35;
use Test::More tests => 36;
# Create the rc file.
if (open my $fh, '>', 'cal.rc')
@ -111,6 +111,9 @@ unlike ($output, qr/May 2010/, 'May 2010 is not displayed');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'cal.rc';
ok (!-r 'cal.rc', 'Removed cal.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 5;
use Test::More tests => 6;
# Create the rc file.
if (open my $fh, '>', 'color.rc')
@ -53,6 +53,9 @@ like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.active');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'color.rc';
ok (!-r 'color.rc', 'Removed color.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 6;
use Test::More tests => 7;
# Create the rc file.
if (open my $fh, '>', 'color.rc')
@ -51,6 +51,9 @@ unlike ($output, qr/\033\[0m/, 'color.disable - no color reset');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'color.rc';
ok (!-r 'color.rc', 'Removed color.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 5;
use Test::More tests => 6;
# Create the rc file.
if (open my $fh, '>', 'color.rc')
@ -52,6 +52,9 @@ like ($output, qr/ \033\[31m .* red .* \033\[0m/x, 'color.due');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'color.rc';
ok (!-r 'color.rc', 'Removed color.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 6;
use Test::More tests => 7;
# Create the rc file.
if (open my $fh, '>', 'color.rc')
@ -55,6 +55,9 @@ like ($output, qr/ \033\[32m .* green .* \033\[0m /x, 'color.keywo
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'color.rc';
ok (!-r 'color.rc', 'Removed color.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 5;
use Test::More tests => 6;
# Create the rc file.
if (open my $fh, '>', 'color.rc')
@ -52,6 +52,9 @@ like ($output, qr/ \033\[31m .* red .* \033\[0m/x, 'color.overdue');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'color.rc';
ok (!-r 'color.rc', 'Removed color.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 7;
use Test::More tests => 8;
# Create the rc file.
if (open my $fh, '>', 'color.rc')
@ -59,6 +59,9 @@ like ($output, qr/ \033\[33m .* yellow .* \033\[0m /x, 'color.pri.none');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'color.rc';
ok (!-r 'color.rc', 'Removed color.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 5;
use Test::More tests => 6;
# Create the rc file.
if (open my $fh, '>', 'color.rc')
@ -52,6 +52,9 @@ like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.project.re
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'color.rc';
ok (!-r 'color.rc', 'Removed color.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 5;
use Test::More tests => 6;
# Create the rc file.
if (open my $fh, '>', 'color.rc')
@ -52,6 +52,9 @@ like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.recur
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'color.rc';
ok (!-r 'color.rc', 'Removed color.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 6;
use Test::More tests => 7;
# Create the rc file.
if (open my $fh, '>', 'color.rc')
@ -55,6 +55,9 @@ like ($output, qr/ \033\[32m .* green .* \033\[0m /x, 'color.tag.green'
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'color.rc';
ok (!-r 'color.rc', 'Removed color.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 5;
use Test::More tests => 6;
# Create the rc file.
if (open my $fh, '>', 'color.rc')
@ -52,6 +52,9 @@ like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.tagged');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'color.rc';
ok (!-r 'color.rc', 'Removed color.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 6;
use Test::More tests => 7;
# Create the rc file.
if (open my $fh, '>', 'completed.rc')
@ -57,6 +57,9 @@ ok (!-r 'pending.data', 'Removed pending.data');
unlink 'completed.data';
ok (!-r 'completed.data', 'Removed completed.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'completed.rc';
ok (!-r 'completed.rc', 'Removed completed.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 5;
use Test::More tests => 6;
# Create the rc file.
if (open my $fh, '>', 'obsolete.rc')
@ -50,6 +50,9 @@ like ($output, qr/ foo\n/, 'unsupported configuration variable');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'obsolete.rc';
ok (!-r 'obsolete.rc', 'Removed obsolete.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 26;
use Test::More tests => 27;
# Create the rc file.
if (open my $fh, '>', 'confirm.rc')
@ -99,6 +99,9 @@ like ($output, qr/(Permanently delete task 7 'foo'\? \(y\/n\)) \1 \1/, 'confirma
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'response.txt';
ok (!-r 'response.txt', 'Removed response.txt');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 4;
use Test::More tests => 5;
# Create the rc file.
if (open my $fh, '>', 'custom.rc')
@ -50,6 +50,9 @@ like ($output, qr/Unrecognized column name: foo\n/, 'custom report spotted inval
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'custom.rc';
ok (!-r 'custom.rc', 'Removed custom.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 6;
use Test::More tests => 7;
# Create the rc file.
if (open my $fh, '>', 'custom.rc')
@ -54,6 +54,9 @@ unlike ($output, qr/2\s+R/, 'No recurrence indicator t2');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'custom.rc';
ok (!-r 'custom.rc', 'Removed custom.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 6;
use Test::More tests => 7;
# Create the rc file.
if (open my $fh, '>', 'custom.rc')
@ -56,6 +56,9 @@ unlike ($output, qr/two/, 'custom filter excluded');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'custom.rc';
ok (!-r 'custom.rc', 'Removed custom.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 6;
use Test::More tests => 7;
# Create the rc file.
if (open my $fh, '>', 'custom.rc')
@ -54,6 +54,9 @@ unlike ($output, qr/2\s+\+/, 'No tag indicator t2');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'custom.rc';
ok (!-r 'custom.rc', 'Removed custom.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 8;
use Test::More tests => 9;
# Create the rc file.
if (open my $fh, '>', 'date1.rc')
@ -62,6 +62,9 @@ like ($output, qr/\b12\/1\/09\b/, 'date format m/d/y parsed');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'date1.rc';
ok (!-r 'date1.rc', 'Removed date1.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 16;
use Test::More tests => 17;
# Create the rc file.
if (open my $fh, '>', 'default.rc')
@ -76,6 +76,9 @@ like ($output, qr/1 PROJECT L .+ priority specified/, 'default command worked');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'default.rc';
ok (!-r 'default.rc', 'Removed default.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 16;
use Test::More tests => 18;
# Create the rc file.
if (open my $fh, '>', 'undelete.rc')
@ -71,6 +71,10 @@ ok (-r 'completed.data', 'Need to remove completed.data');
unlink 'completed.data';
ok (!-r 'completed.data', 'Removed completed.data');
ok (-r 'undo.data', 'Need to remove undo.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'undelete.rc';
ok (!-r 'undelete.rc', 'Removed undelete.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 5;
use Test::More tests => 6;
# Create the rc file.
if (open my $fh, '>', 'due.rc')
@ -60,6 +60,9 @@ like ($output, qr/\s+$almost\s+/, 'two not marked due');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'due.rc';
ok (!-r 'due.rc', 'Removed due.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 11;
use Test::More tests => 12;
# Create the rc file.
if (open my $fh, '>', 'dup.rc')
@ -59,6 +59,9 @@ like ($output, qr/Tags\s+tag/, 'duplicate added tag');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'dup.rc';
ok (!-r 'dup.rc', 'Removed dup.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 11;
use Test::More tests => 12;
# Create the rc file.
if (open my $fh, '>', 'enp.rc')
@ -57,6 +57,9 @@ like ($output, qr/Tags\s+tag/, 'en passant 2 description change');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'enp.rc';
ok (!-r 'enp.rc', 'Removed enp.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 7;
use Test::More tests => 8;
# Create the rc file.
if (open my $fh, '>', 'export.rc')
@ -70,6 +70,9 @@ ok (!-r 'export.txt', 'Removed export.txt');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'export.rc';
ok (!-r 'export.rc', 'Removed export.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 129;
use Test::More tests => 130;
# Create the rc file.
if (open my $fh, '>', 'filter.rc')
@ -213,6 +213,9 @@ unlike ($output, qr/seven/, 'n7');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'filter.rc';
ok (!-r 'filter.rc', 'Removed filter.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 8;
use Test::More tests => 9;
# Create the rc file.
if (open my $fh, '>', 'import.rc')
@ -63,6 +63,9 @@ ok (!-r 'import.txt', 'Removed import.txt');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'import.rc';
ok (!-r 'import.rc', 'Removed import.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 8;
use Test::More tests => 9;
# Create the rc file.
if (open my $fh, '>', 'import.rc')
@ -63,6 +63,9 @@ ok (!-r 'import.txt', 'Removed import.txt');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'import.rc';
ok (!-r 'import.rc', 'Removed import.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 8;
use Test::More tests => 9;
# Create the rc file.
if (open my $fh, '>', 'import.rc')
@ -63,6 +63,9 @@ ok (!-r 'import.txt', 'Removed import.txt');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'import.rc';
ok (!-r 'import.rc', 'Removed import.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 8;
use Test::More tests => 9;
# Create the rc file.
if (open my $fh, '>', 'import.rc')
@ -62,6 +62,9 @@ ok (!-r 'import.txt', 'Removed import.txt');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'import.rc';
ok (!-r 'import.rc', 'Removed import.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 8;
use Test::More tests => 9;
# Create the rc file.
if (open my $fh, '>', 'import.rc')
@ -69,6 +69,9 @@ ok (!-r 'import.txt', 'Removed import.txt');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'import.rc';
ok (!-r 'import.rc', 'Removed import.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 10;
use Test::More tests => 11;
# Create the rc file.
if (open my $fh, '>', 'import.rc')
@ -69,6 +69,9 @@ ok (!-r 'pending.data', 'Removed pending.data');
unlink 'completed.data';
ok (!-r 'completed.data', 'Removed completed.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'import.rc';
ok (!-r 'import.rc', 'Removed import.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 9;
use Test::More tests => 10;
# Create the rc file.
if (open my $fh, '>', 'import.rc')
@ -64,6 +64,9 @@ ok (!-r 'import.txt', 'Removed import.txt');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'import.rc';
ok (!-r 'import.rc', 'Removed import.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 8;
use Test::More tests => 9;
# Create the rc file.
if (open my $fh, '>', 'custom.rc')
@ -59,6 +59,9 @@ unlike ($output, qr/two/, 'custom filter excluded');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'custom.rc';
ok (!-r 'custom.rc', 'Removed custom.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 9;
use Test::More tests => 10;
# Create the rc file.
if (open my $fh, '>', 'nag.rc')
@ -58,6 +58,9 @@ unlike (qx{../task rc:nag.rc do 1}, qr/NAG/, 'do due:yesterday -> no nag');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'nag.rc';
ok (!-r 'nag.rc', 'Removed nag.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 5;
use Test::More tests => 6;
# Create the rc file.
if (open my $fh, '>', 'next.rc')
@ -54,6 +54,9 @@ like ($output, qr/\s3\sB\s+H\s+-\sBH\n/, 'BH shown');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'next.rc';
ok (!-r 'next.rc', 'Removed next.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 55;
use Test::More tests => 56;
# Create the rc file.
if (open my $fh, '>', 'oldest.rc')
@ -121,6 +121,9 @@ like ($output, qr/eleven/, 'newest: eleven');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'oldest.rc';
ok (!-r 'oldest.rc', 'Removed oldest.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 6;
use Test::More tests => 7;
# Create the rc file.
if (open my $fh, '>', 'due.rc')
@ -53,6 +53,9 @@ unlike ($output, qr/three/, 'overdue: task 3 does not show up');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'due.rc';
ok (!-r 'due.rc', 'Removed due.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 5;
use Test::More tests => 6;
# Create the rc file.
if (open my $fh, '>', 'recur.rc')
@ -57,6 +57,9 @@ like ($output, qr/second .* third .* first/msx, 'weekly 3d daily');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'recur.rc';
ok (!-r 'recur.rc', 'Removed recur.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 7;
use Test::More tests => 8;
# Create the rc file.
if (open my $fh, '>', 'recur.rc')
@ -57,6 +57,9 @@ ok (!-r 'pending.data', 'Removed pending.data');
unlink 'completed.data';
ok (!-r 'completed.data', 'Removed completed.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'recur.rc';
ok (!-r 'recur.rc', 'Removed recur.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 27;
use Test::More tests => 28;
# Create the rc file.
if (open my $fh, '>', 'seq.rc')
@ -118,6 +118,9 @@ like ($output, qr/\d+\/\d+\/\d+ note/, 'sequence annotate 2');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'seq.rc';
ok (!-r 'seq.rc', 'Removed seq.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 21;
use Test::More tests => 22;
# Create the rc file.
if (open my $fh, '>', 'shadow.rc')
@ -75,6 +75,9 @@ ok (!-r 'pending.data', 'Removed pending.data');
unlink 'completed.data';
ok (!-r 'completed.data', 'Removed completed.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'shadow.rc';
ok (!-r 'shadow.rc', 'Removed shadow.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 12;
use Test::More tests => 14;
# Create the rc file.
if (open my $fh, '>', 'start.rc')
@ -66,6 +66,10 @@ ok (-r 'pending.data', 'Need to remove pending.data');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
ok (-r 'undo.data', 'Need to remove undo.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'start.rc';
ok (!-r 'start.rc', 'Removed start.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 11;
use Test::More tests => 12;
# Create the rc file.
if (open my $fh, '>', 'sp.rc')
@ -66,6 +66,9 @@ like ($output, qr/No matches./, 'abc,ab,a,b | abcd -> nul');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'sp.rc';
ok (!-r 'sp.rc', 'Removed sp.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 9;
use Test::More tests => 10;
# Create the rc file.
if (open my $fh, '>', 'subst.rc')
@ -72,6 +72,9 @@ like ($output, qr/aaa ccc/, 'word deletion in description');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'subst.rc';
ok (!-r 'subst.rc', 'Removed subst.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 9;
use Test::More tests => 10;
# Create the rc file.
if (open my $fh, '>', 'tag.rc')
@ -66,6 +66,9 @@ unlike ($output, qr/^Tags/m, '-missing NOP');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'tag.rc';
ok (!-r 'tag.rc', 'Removed tag.rc');

View file

@ -53,6 +53,7 @@ int main (int argc, char** argv)
// Remove any residual test file.
unlink ("./pending.data");
unlink ("./completed.data");
unlink ("./undo.data");
// Try reading an empty database.
Filter filter;
@ -153,6 +154,7 @@ int main (int argc, char** argv)
unlink ("./pending.data");
unlink ("./completed.data");
unlink ("./undo.data");
return 0;
}

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 15;
use Test::More tests => 17;
# Create the rc file.
if (open my $fh, '>', 'undo.rc')
@ -68,6 +68,10 @@ ok (-r 'completed.data', 'Need to remove completed.data');
unlink 'completed.data';
ok (!-r 'completed.data', 'Removed completed.data');
ok (-r 'undo.data', 'Need to remove undo.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'undo.rc';
ok (!-r 'undo.rc', 'Removed undo.rc');

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 6;
use Test::More tests => 7;
# Create the rc file.
if (open my $fh, '>', 'utf8.rc')
@ -73,6 +73,9 @@ like ($output, qr/utf8 in tag/, 'utf8 in tag works');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'utf8.rc';
ok (!-r 'utf8.rc', 'Removed utf8.rc');