- adapted makefile and unit tests to new place of test dir
This commit is contained in:
Federico Hernandez 2010-12-28 21:38:03 +01:00
parent 17ef077e27
commit 5d775fdc3e
176 changed files with 1288 additions and 1287 deletions

1
test/.gitignore vendored
View file

@ -1,3 +1,4 @@
*.o
*.log
att.t
autocomplete.t

View file

@ -2,21 +2,21 @@ PROJECT = t.t tdb.t date.t duration.t t.benchmark.t text.t autocomplete.t \
config.t seq.t att.t stringtable.t record.t nibbler.t subst.t filt.t \
cmd.t util.t color.t list.t path.t file.t directory.t grid.t rx.t \
taskmod.t sensor.t rectangle.t tree.t tree2.t lisp.t uri.t
CFLAGS = -I. -I.. -I../.. -Wall -pedantic -ggdb3 -fno-rtti
CFLAGS = -I. -I.. -I../src -Wall -pedantic -ggdb3 -fno-rtti
LFLAGS = -L/usr/local/lib -lpthread -llua
OBJECTS = ../t-TDB.o ../t-Task.o ../t-text.o ../t-Date.o ../t-Table.o \
../t-Duration.o ../t-util.o ../t-Config.o ../t-Sequence.o ../t-Att.o \
../t-Cmd.o ../t-Record.o ../t-StringTable.o ../t-Subst.o \
../t-Nibbler.o ../t-Location.o ../t-Filter.o ../t-Context.o \
../t-Keymap.o ../t-command.o ../t-interactive.o ../t-report.o \
../t-Grid.o ../t-Color.o ../t-rules.o ../t-recur.o ../t-custom.o \
../t-export.o ../t-import.o ../t-edit.o ../t-Timer.o \
../t-Permission.o ../t-Path.o ../t-File.o ../t-Directory.o \
../t-Hooks.o ../t-API.o ../t-rx.o ../t-Taskmod.o ../t-dependency.o \
../t-Transport.o ../t-TransportSSH.o ../t-Sensor.o ../t-Thread.o \
../t-Lisp.o ../t-Rectangle.o ../t-Tree.o ../t-TransportRSYNC.o \
../t-TransportCurl.o ../t-Uri.o ../t-diag.o ../t-burndown.o \
../t-history.o
OBJECTS = ../src/t-TDB.o ../src/t-Task.o ../src/t-text.o ../src/t-Date.o ../src/t-Table.o \
../src/t-Duration.o ../src/t-util.o ../src/t-Config.o ../src/t-Sequence.o ../src/t-Att.o \
../src/t-Cmd.o ../src/t-Record.o ../src/t-StringTable.o ../src/t-Subst.o \
../src/t-Nibbler.o ../src/t-Location.o ../src/t-Filter.o ../src/t-Context.o \
../src/t-Keymap.o ../src/t-command.o ../src/t-interactive.o ../src/t-report.o \
../src/t-Grid.o ../src/t-Color.o ../src/t-rules.o ../src/t-recur.o ../src/t-custom.o \
../src/t-export.o ../src/t-import.o ../src/t-edit.o ../src/t-Timer.o \
../src/t-Permission.o ../src/t-Path.o ../src/t-File.o ../src/t-Directory.o \
../src/t-Hooks.o ../src/t-API.o ../src/t-rx.o ../src/t-Taskmod.o ../src/t-dependency.o \
../src/t-Transport.o ../src/t-TransportSSH.o ../src/t-Sensor.o ../src/t-Thread.o \
../src/t-Lisp.o ../src/t-Rectangle.o ../src/t-Tree.o ../src/t-TransportRSYNC.o \
../src/t-TransportCurl.o ../src/t-Uri.o ../src/t-diag.o ../src/t-burndown.o \
../src/t-history.o
all: $(PROJECT)

View file

@ -39,53 +39,53 @@ if (open my $fh, '>', 'abbrev.rc')
}
# Test the priority attribute abbrevations.
qx{../task rc:abbrev.rc add priority:H with};
qx{../task rc:abbrev.rc add without};
qx{../src/task rc:abbrev.rc add priority:H with};
qx{../src/task rc:abbrev.rc add without};
my $output = qx{../task rc:abbrev.rc list priority:H};
my $output = qx{../src/task rc:abbrev.rc list priority:H};
like ($output, qr/\bwith\b/, 'priority:H with');
unlike ($output, qr/\bwithout\b/, 'priority:H without');
$output = qx{../task rc:abbrev.rc list priorit:H};
$output = qx{../src/task rc:abbrev.rc list priorit:H};
like ($output, qr/\bwith\b/, 'priorit:H with');
unlike ($output, qr/\bwithout\b/, 'priorit:H without');
$output = qx{../task rc:abbrev.rc list priori:H};
$output = qx{../src/task rc:abbrev.rc list priori:H};
like ($output, qr/\bwith\b/, 'priori:H with');
unlike ($output, qr/\bwithout\b/, 'priori:H without');
$output = qx{../task rc:abbrev.rc list prior:H};
$output = qx{../src/task rc:abbrev.rc list prior:H};
like ($output, qr/\bwith\b/, 'prior:H with');
unlike ($output, qr/\bwithout\b/, 'prior:H without');
$output = qx{../task rc:abbrev.rc list prio:H};
$output = qx{../src/task rc:abbrev.rc list prio:H};
like ($output, qr/\bwith\b/, 'prio:H with');
unlike ($output, qr/\bwithout\b/, 'prio:H without');
$output = qx{../task rc:abbrev.rc list pri:H};
$output = qx{../src/task rc:abbrev.rc list pri:H};
like ($output, qr/\bwith\b/, 'pri:H with');
unlike ($output, qr/\bwithout\b/, 'pri:H without');
# Test the version command abbreviations.
$output = qx{../task rc:abbrev.rc version};
$output = qx{../src/task rc:abbrev.rc version};
like ($output, qr/GNU\s+General\s+Public\s+License/, 'version');
$output = qx{../task rc:abbrev.rc versio};
$output = qx{../src/task rc:abbrev.rc versio};
like ($output, qr/GNU\s+General\s+Public\s+License/, 'versio');
$output = qx{../task rc:abbrev.rc versi};
$output = qx{../src/task rc:abbrev.rc versi};
like ($output, qr/GNU\s+General\s+Public\s+License/, 'versi');
$output = qx{../task rc:abbrev.rc vers};
$output = qx{../src/task rc:abbrev.rc vers};
like ($output, qr/GNU\s+General\s+Public\s+License/, 'vers');
$output = qx{../task rc:abbrev.rc ver};
$output = qx{../src/task rc:abbrev.rc ver};
like ($output, qr/GNU\s+General\s+Public\s+License/, 'ver');
$output = qx{../task rc:abbrev.rc ve};
$output = qx{../src/task rc:abbrev.rc ve};
like ($output, qr/GNU\s+General\s+Public\s+License/, 've');
$output = qx{../task rc:abbrev.rc v};
$output = qx{../src/task rc:abbrev.rc v};
like ($output, qr/GNU\s+General\s+Public\s+License/, 'v');
# Cleanup.

View file

@ -40,17 +40,17 @@ if (open my $fh, '>', 'add.rc')
}
# Test the add command.
qx{../task rc:add.rc add This is a test};
my $output = qx{../task rc:add.rc info 1};
qx{../src/task rc:add.rc add This is a test};
my $output = qx{../src/task rc:add.rc info 1};
like ($output, qr/ID\s+1\n/, 'add ID');
like ($output, qr/Description\s+This is a test\n/, 'add ID');
like ($output, qr/Status\s+Pending\n/, 'add Pending');
like ($output, qr/UUID\s+[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}\n/, 'add UUID');
# Test the /// modifier.
qx{../task rc:add.rc 1 /test/TEST/};
qx{../task rc:add.rc 1 "/is //"};
$output = qx{../task rc:add.rc info 1};
qx{../src/task rc:add.rc 1 /test/TEST/};
qx{../src/task rc:add.rc 1 "/is //"};
$output = qx{../src/task rc:add.rc info 1};
like ($output, qr/ID\s+1\n/, 'add ID');
like ($output, qr/Status\s+Pending\n/, 'add Pending');
like ($output, qr/Description\s+This a TEST\n/, 'add ID');

View file

@ -41,15 +41,15 @@ if (open my $fh, '>', 'alias.rc')
}
# Add a task with certain project, then access that task via aliases.
qx{../task rc:alias.rc add project:ALIAS foo};
qx{../src/task rc:alias.rc add project:ALIAS foo};
my $output = qx{../task rc:alias.rc _projects};
my $output = qx{../src/task rc:alias.rc _projects};
like ($output, qr/ALIAS/, 'task _projects -> ALIAS');
$output = qx{../task rc:alias.rc foo};
$output = qx{../src/task rc:alias.rc foo};
like ($output, qr/ALIAS/, 'task foo -> _projects -> ALIAS');
$output = qx{../task rc:alias.rc bar};
$output = qx{../src/task rc:alias.rc bar};
like ($output, qr/ALIAS/, 'task bar -> foo -> _projects -> ALIAS');
# Cleanup.

View file

@ -45,24 +45,24 @@ if (open my $fh, '>', 'annotate.rc')
}
# Add four tasks, annotate one three times, one twice, one just once and one none.
qx{../task rc:annotate.rc add one};
qx{../task rc:annotate.rc add two};
qx{../task rc:annotate.rc add three};
qx{../task rc:annotate.rc add four};
qx{../task rc:annotate.rc annotate 1 foo1};
qx{../src/task rc:annotate.rc add one};
qx{../src/task rc:annotate.rc add two};
qx{../src/task rc:annotate.rc add three};
qx{../src/task rc:annotate.rc add four};
qx{../src/task rc:annotate.rc annotate 1 foo1};
diag ("5 second delay");
sleep 1;
qx{../task rc:annotate.rc annotate 1 foo2};
qx{../src/task rc:annotate.rc annotate 1 foo2};
sleep 1;
qx{../task rc:annotate.rc annotate 1 foo3};
qx{../src/task rc:annotate.rc annotate 1 foo3};
sleep 1;
qx{../task rc:annotate.rc annotate 2 bar1};
qx{../src/task rc:annotate.rc annotate 2 bar1};
sleep 1;
qx{../task rc:annotate.rc annotate 2 bar2};
qx{../src/task rc:annotate.rc annotate 2 bar2};
sleep 1;
qx{../task rc:annotate.rc annotate 3 baz1};
qx{../src/task rc:annotate.rc annotate 3 baz1};
my $output = qx{../task rc:annotate.rc rrr};
my $output = qx{../src/task rc:annotate.rc rrr};
# ID Description
# -- -------------------------------
@ -91,7 +91,7 @@ like ($output, qr/bar1.+\d{1,2}\/\d{1,2}\/\d{4} bar2/ms, 'full - second annotati
like ($output, qr/three.+\d{1,2}\/\d{1,2}\/\d{4} baz1/ms,'full - first annotation task 3');
like ($output, qr/4 tasks/, 'count');
$output = qx{../task rc:annotate.rc rc.annotations:sparse rrr};
$output = qx{../src/task rc:annotate.rc rc.annotations:sparse rrr};
like ($output, qr/1 \+one/, 'task 1');
like ($output, qr/2 \+two/, 'task 2');
like ($output, qr/3 three/, 'task 3');
@ -104,7 +104,7 @@ like ($output, qr/two.+\d{1,2}\/\d{1,2}\/\d{4} bar2/ms, 'sparse - second ann
like ($output, qr/three.+\d{1,2}\/\d{1,2}\/\d{4} baz1/ms, 'sparse - third annotation task 3');
like ($output, qr/4 tasks/, 'count');
$output = qx{../task rc:annotate.rc rc.annotations:none rrr};
$output = qx{../src/task rc:annotate.rc rc.annotations:none rrr};
like ($output, qr/1 \+one/, 'task 1');
like ($output, qr/2 \+two/, 'task 2');
like ($output, qr/3 \+three/, 'task 3');
@ -131,7 +131,7 @@ if (open my $fh, '>', 'annotate2.rc')
ok (-r 'annotate2.rc', 'Created annotate2.rc');
}
$output = qx{../task rc:annotate2.rc rrr};
$output = qx{../src/task rc:annotate2.rc rrr};
like ($output, qr/1 one/, 'task 1');
like ($output, qr/2 two/, 'task 2');
like ($output, qr/3 three/, 'task 3');

View file

@ -39,9 +39,9 @@ if (open my $fh, '>', 'append.rc')
}
# Add a task, then append more decsription.
qx{../task rc:append.rc add foo};
qx{../task rc:append.rc 1 append bar};
my $output = qx{../task rc:append.rc info 1};
qx{../src/task rc:append.rc add foo};
qx{../src/task rc:append.rc 1 append bar};
my $output = qx{../src/task rc:append.rc info 1};
like ($output, qr/Description\s+foo\sbar\n/, 'append worked');
# Cleanup.

View file

@ -40,24 +40,24 @@ if (open my $fh, '>', 'args.rc')
}
# Test the -- argument.
qx{../task rc:args.rc add project:p pri:H +tag foo};
my $output = qx{../task rc:args.rc info 1};
qx{../src/task rc:args.rc add project:p pri:H +tag foo};
my $output = qx{../src/task rc:args.rc info 1};
like ($output, qr/Description\s+foo\n/ms, 'task add project:p pri:H +tag foo');
qx{../task rc:args.rc 1 project:p pri:H +tag -- foo};
$output = qx{../task rc:args.rc info 1};
qx{../src/task rc:args.rc 1 project:p pri:H +tag -- foo};
$output = qx{../src/task rc:args.rc info 1};
like ($output, qr/Description\s+foo\n/ms, 'task 1 project:p pri:H +tag -- foo');
qx{../task rc:args.rc 1 project:p pri:H -- +tag foo};
$output = qx{../task rc:args.rc info 1};
qx{../src/task rc:args.rc 1 project:p pri:H -- +tag foo};
$output = qx{../src/task rc:args.rc info 1};
like ($output, qr/Description\s+\+tag\sfoo\n/ms, 'task 1 project:p pri:H -- +tag foo');
qx{../task rc:args.rc 1 project:p -- pri:H +tag foo};
$output = qx{../task rc:args.rc info 1};
qx{../src/task rc:args.rc 1 project:p -- pri:H +tag foo};
$output = qx{../src/task rc:args.rc info 1};
like ($output, qr/Description\s+pri:H\s\+tag\sfoo\n/ms, 'task 1 project:p -- pri:H +tag foo');
qx{../task rc:args.rc 1 -- project:p pri:H +tag foo};
$output = qx{../task rc:args.rc info 1};
qx{../src/task rc:args.rc 1 -- project:p pri:H +tag foo};
$output = qx{../src/task rc:args.rc info 1};
like ($output, qr/Description\s+project:p\spri:H\s\+tag\sfoo\n/ms, 'task 1 -- project:p pri:H +tag foo');
# Cleanup.

View file

@ -39,8 +39,8 @@ if (open my $fh, '>', 'backslash.rc')
}
# Add a description with a backslash.
qx{../task rc:backslash.rc add foo\\\\bar};
my $output = qx{../task rc:backslash.rc ls};
qx{../src/task rc:backslash.rc add foo\\\\bar};
my $output = qx{../src/task rc:backslash.rc ls};
like ($output, qr/foo\\bar/, 'Backslash preserved, no parsing issues');
# Cleanup.

View file

@ -43,17 +43,17 @@ if (open my $fh, '>', 'basic.rc')
my $version = slurp ('../../configure.ac');
# Test the usage command.
my $output = qx{../task rc:basic.rc};
my $output = qx{../src/task rc:basic.rc};
like ($output, qr/You must specify a command, or a task ID to modify/m, 'missing command and ID');
# Test the version command.
$output = qx{../task rc:basic.rc version};
$output = qx{../src/task rc:basic.rc version};
like ($output, qr/task $version/, 'version - task version number');
like ($output, qr/GNU\s+General\s+Public\s+License/, 'version - license');
like ($output, qr/http:\/\/taskwarrior\.org/, 'version - url');
# Test the _version command.
$output = qx{../task rc:basic.rc _version};
$output = qx{../src/task rc:basic.rc _version};
like ($output, qr/$version/, '_version - task version number');
# Cleanup.

View file

@ -58,14 +58,14 @@ for my $i (1 .. 1000)
my $priority = $priorities[rand % 3];
my $tag = $tags[rand % 8];
qx{../task rc:bench.rc add project:$project priority:$priority +$tag $i $description};
qx{../src/task rc:bench.rc add project:$project priority:$priority +$tag $i $description};
}
diag ("1000 tasks added in " . (time () - $cursor) . " seconds");
$cursor = time ();
qx{../task rc:bench.rc /with/WITH/} for 1 .. 200;
qx{../task rc:bench.rc done $_} for 201 .. 400;
qx{../task rc:bench.rc start $_} for 401 .. 600;
qx{../src/task rc:bench.rc /with/WITH/} for 1 .. 200;
qx{../src/task rc:bench.rc done $_} for 201 .. 400;
qx{../src/task rc:bench.rc start $_} for 401 .. 600;
diag ("600 tasks altered in " . (time () - $cursor) . " seconds");
$cursor = time ();
@ -73,15 +73,15 @@ $cursor = time ();
for (1 .. 100)
{
diag (grep {/^Timer /} qx{../task rc:bench.rc ls});
diag (grep {/^Timer /} qx{../task rc:bench.rc list});
diag (grep {/^Timer /} qx{../task rc:bench.rc list priority:H});
diag (grep {/^Timer /} qx{../task rc:bench.rc list +tag});
diag (grep {/^Timer /} qx{../task rc:bench.rc list project_A});
diag (grep {/^Timer /} qx{../task rc:bench.rc long});
diag (grep {/^Timer /} qx{../task rc:bench.rc completed});
diag (grep {/^Timer /} qx{../task rc:bench.rc history});
diag (grep {/^Timer /} qx{../task rc:bench.rc ghistory});
diag (grep {/^Timer /} qx{../src/task rc:bench.rc ls});
diag (grep {/^Timer /} qx{../src/task rc:bench.rc list});
diag (grep {/^Timer /} qx{../src/task rc:bench.rc list priority:H});
diag (grep {/^Timer /} qx{../src/task rc:bench.rc list +tag});
diag (grep {/^Timer /} qx{../src/task rc:bench.rc list project_A});
diag (grep {/^Timer /} qx{../src/task rc:bench.rc long});
diag (grep {/^Timer /} qx{../src/task rc:bench.rc completed});
diag (grep {/^Timer /} qx{../src/task rc:bench.rc history});
diag (grep {/^Timer /} qx{../src/task rc:bench.rc ghistory});
}
# Stop the clock.

View file

@ -51,22 +51,22 @@ my $output;
# Add 1 task.
add (1);
$output = qx{../task rc:bench2.rc list};
$output = qx{../src/task rc:bench2.rc list};
report ('run-1', $output);
# Add 9 more tasks.
add (9);
$output = qx{../task rc:bench2.rc list};
$output = qx{../src/task rc:bench2.rc list};
report ('run-10', $output);
# Add 90 more tasks.
add (90);
$output = qx{../task rc:bench2.rc list};
$output = qx{../src/task rc:bench2.rc list};
report ('run-100', $output);
# Add 900 more tasks.
add (900);
$output = qx{../task rc:bench2.rc list};
$output = qx{../src/task rc:bench2.rc list};
report ('run-1000', $output);
# Cleanup.
@ -95,7 +95,7 @@ sub add
my $priority = $priorities[rand % 3];
my $tag = $tags[rand % 8];
qx{../task rc:bench2.rc add project:$project priority:$priority +$tag $i $description};
qx{../src/task rc:bench2.rc add project:$project priority:$priority +$tag $i $description};
}
}
@ -111,7 +111,7 @@ sub report
}
# Generate output for benchmark2 chart.
chomp (my $version = qx{../task _version});
chomp (my $version = qx{../src/task _version});
my $out = sprintf "%s %s %f,%f,%f,%f,%f,%f,%f",
$label,
$version,

View file

@ -40,13 +40,13 @@ if (open my $fh, '>', 'bug.rc')
}
# Setup: Add three unique tasks with different project names.
qx{../task rc:bug.rc add project:one foo};
qx{../task rc:bug.rc add project:two bar};
qx{../task rc:bug.rc add project:three baz};
qx{../src/task rc:bug.rc add project:one foo};
qx{../src/task rc:bug.rc add project:two bar};
qx{../src/task rc:bug.rc add project:three baz};
# Result: Run list but exclude two of the three projects names using
# project.hasnt:<name>
my $output = qx{../task rc:bug.rc list project.isnt:one project.isnt:two};
my $output = qx{../src/task rc:bug.rc list project.isnt:one project.isnt:two};
unlike ($output, qr/one.*foo/ms, 'project.isnt:one project.isnt:two - no foo');
unlike ($output, qr/two.*bar/ms, 'project.isnt:one project.isnt:two - no bar');
like ($output, qr/three.*baz/ms, 'project.isnt:one project.isnt:two - yes baz');

View file

@ -40,13 +40,13 @@ if (open my $fh, '>', 'bug.rc')
}
# Setup: Add a recurring task then remove the due date.
qx{../task rc:bug.rc add foo recur:yearly due:eoy};
qx{../task rc:bug.rc li};
qx{../task rc:bug.rc 2 due:};
qx{../src/task rc:bug.rc add foo recur:yearly due:eoy};
qx{../src/task rc:bug.rc li};
qx{../src/task rc:bug.rc 2 due:};
# Result: Somehow the due date is incremented and wraps around to 12/31/1969,
# then keeps going back to today.
my $output = qx{../task rc:bug.rc li};
my $output = qx{../src/task rc:bug.rc li};
unlike ($output, qr/1969/ms, 'Should not display 12/31/1969');
# Cleanup.

View file

@ -40,28 +40,28 @@ if (open my $fh, '>', 'bug.rc')
}
# Setup: Add a recurring task, generate an instance, then add a project.
qx{../task rc:bug.rc add foo due:tomorrow recur:daily};
qx{../task rc:bug.rc ls};
qx{../src/task rc:bug.rc add foo due:tomorrow recur:daily};
qx{../src/task rc:bug.rc ls};
# Result: trying to add the project generates an error about removing
# recurrence from a task.
my $output = qx{../task rc:bug.rc 1 project:bar};
my $output = qx{../src/task rc:bug.rc 1 project:bar};
unlike ($output, qr/You cannot remove the recurrence from a recurring task./ms, 'No recurrence removal error');
# Now try to generate the error above via regular means - ie, is it actually
# doing what it should?
$output = qx{../task rc:bug.rc 1 recur:};
$output = qx{../src/task rc:bug.rc 1 recur:};
like ($output, qr/You cannot remove the recurrence from a recurring task./ms, 'Recurrence removal error');
# Prevent removal of the due date from a recurring task.
$output = qx{../task rc:bug.rc 1 due:};
$output = qx{../src/task rc:bug.rc 1 due:};
like ($output, qr/You cannot remove the due date from a recurring task./ms, 'Cannot remove due date from a recurring task');
# Allow removal of the due date from a non-recurring task.
qx{../task rc:bug.rc add nonrecurring};
$output = qx{../task rc:bug.rc ls};
qx{../src/task rc:bug.rc add nonrecurring};
$output = qx{../src/task rc:bug.rc ls};
my ($id) = $output =~ /(\d+)\s+nonrecurring/;
$output = qx{../task rc:bug.rc $id due:};
$output = qx{../src/task rc:bug.rc $id due:};
unlike ($output, qr/You cannot remove the due date from a recurring task./ms, 'Can remove due date from a non-recurring task');
# Cleanup.

View file

@ -41,8 +41,8 @@ if (open my $fh, '>', 'bug.rc')
}
# Setup: Add a recurring task, generate an instance, then add a project.
qx{../task rc:bug.rc add foo due:today recur:daily until:eom};
my $output = qx{../task rc:bug.rc info 1};
qx{../src/task rc:bug.rc add foo due:today recur:daily until:eom};
my $output = qx{../src/task rc:bug.rc info 1};
# Result: Make sure the 'until' date is rendered as a date, not an epoch.
unlike ($output, qr/Recur until\s+\d{10}/, 'until is not shown as an epoch');

View file

@ -41,19 +41,19 @@ if (open my $fh, '>', 'bug.rc')
# Bug #414: Tags filtering not working with unicode characters
# Add a task with a UTF-8 tag.
qx{../task rc:bug.rc add one +osobní};
my $output = qx{../task rc:bug.rc ls +osobní};
qx{../src/task rc:bug.rc add one +osobní};
my $output = qx{../src/task rc:bug.rc ls +osobní};
like ($output, qr/one/, 'found UTF8 tag osobní');
$output = qx{../task rc:bug.rc ls -osobní};
$output = qx{../src/task rc:bug.rc ls -osobní};
unlike ($output, qr/one/, 'not found UTF8 tag osobní');
# And a different one
qx{../task rc:bug.rc add two +föo};
$output = qx{../task rc:bug.rc ls +föo};
qx{../src/task rc:bug.rc add two +föo};
$output = qx{../src/task rc:bug.rc ls +föo};
like ($output, qr/two/, 'found UTF8 tag föo');
$output = qx{../task rc:bug.rc ls -föo};
$output = qx{../src/task rc:bug.rc ls -föo};
unlike ($output, qr/two/, 'not found UTF8 tag föo');
# Cleanup.

View file

@ -40,14 +40,14 @@ if (open my $fh, '>', 'bug.rc')
}
# Bug #417: Sorting by countdown_compact not working
qx{../task rc:bug.rc add due:yesterday before};
qx{../task rc:bug.rc add due:today now};
qx{../task rc:bug.rc add due:tomorrow after};
qx{../src/task rc:bug.rc add due:yesterday before};
qx{../src/task rc:bug.rc add due:today now};
qx{../src/task rc:bug.rc add due:tomorrow after};
my $output = qx{../task rc:bug.rc rc.report.long.sort:countdown+ long};
my $output = qx{../src/task rc:bug.rc rc.report.long.sort:countdown+ long};
like ($output, qr/before.+now.+after/ms, 'rc.report.long.sort:countdown+ works');
$output = qx{../task rc:bug.rc rc.report.long.sort:countdown- long};
$output = qx{../src/task rc:bug.rc rc.report.long.sort:countdown- long};
like ($output, qr/after.+now.+before/ms, 'rc.report.long.sort:countdown- works');
# Cleanup.

View file

@ -47,17 +47,17 @@ if (open my $fh, '>', 'bug.rc')
# Bug #418: due.before:eow not working
# - with dateformat is MD
qx{../task rc:bug.rc add one due:6/28/2010};
qx{../task rc:bug.rc add two due:6/29/2010};
qx{../task rc:bug.rc add three due:6/30/2010};
qx{../task rc:bug.rc add four due:7/1/2010};
qx{../task rc:bug.rc add five due:7/2/2010};
qx{../task rc:bug.rc add six due:7/3/2010};
qx{../task rc:bug.rc add seven due:7/4/2010};
qx{../task rc:bug.rc add eight due:7/5/2010};
qx{../task rc:bug.rc add nine due:7/6/2010};
qx{../src/task rc:bug.rc add one due:6/28/2010};
qx{../src/task rc:bug.rc add two due:6/29/2010};
qx{../src/task rc:bug.rc add three due:6/30/2010};
qx{../src/task rc:bug.rc add four due:7/1/2010};
qx{../src/task rc:bug.rc add five due:7/2/2010};
qx{../src/task rc:bug.rc add six due:7/3/2010};
qx{../src/task rc:bug.rc add seven due:7/4/2010};
qx{../src/task rc:bug.rc add eight due:7/5/2010};
qx{../src/task rc:bug.rc add nine due:7/6/2010};
my $output = qx{../task rc:bug.rc foo};
my $output = qx{../src/task rc:bug.rc foo};
like ($output, qr/one/ms, 'task 1 listed');
like ($output, qr/two/ms, 'task 2 listed');
like ($output, qr/three/ms, 'task 3 listed');
@ -68,7 +68,7 @@ like ($output, qr/seven/ms, 'task 7 listed');
like ($output, qr/eight/ms, 'task 8 listed');
like ($output, qr/nine/ms, 'task 9 listed');
$output = qx{../task rc:bug.rc foo due.before:7/2/2010};
$output = qx{../src/task rc:bug.rc foo due.before:7/2/2010};
like ($output, qr/one/ms, 'task 1 listed');
like ($output, qr/two/ms, 'task 2 listed');
like ($output, qr/three/ms, 'task 3 listed');

View file

@ -44,10 +44,10 @@ if (open my $fh, '>', '425.rc')
# Create a task and attempt to revise the description to include the word 'in'
# (this breaks in 1.9.3 and earlier)
qx{../task rc:425.rc add Foo};
qx{../task rc:425.rc 1 Bar in Bar};
qx{../src/task rc:425.rc add Foo};
qx{../src/task rc:425.rc 1 Bar in Bar};
my $output = qx{../task rc:425.rc 1 ls};
my $output = qx{../src/task rc:425.rc 1 ls};
like ($output, qr/1\s+Bar in Bar/m, 'parser - interpret \'in\' in description');

View file

@ -41,8 +41,8 @@ if (open my $fh, '>', 'bug.rc')
# Bug #434: Task shouldn't prevent users from marking as done tasks with status:waiting
# Add a task that is waiting
qx{../task rc:bug.rc add One wait:tomorrow};
my $output = qx{../task rc:bug.rc do 1};
qx{../src/task rc:bug.rc add One wait:tomorrow};
my $output = qx{../src/task rc:bug.rc do 1};
like ($output, qr/Marked 1 task as done\./, 'Waiting task marked completed');
# Cleanup.

View file

@ -45,39 +45,39 @@ if (open my $fh, '>', 'bug.rc')
# time is included.
# Ensure the two tasks have a 1 second delta in entry.
qx{../task rc:bug.rc add older};
qx{../src/task rc:bug.rc add older};
diag ("1 second delay");
sleep 1;
qx{../task rc:bug.rc add newer};
qx{../src/task rc:bug.rc add newer};
my $output = qx{../task rc:bug.rc rc.report.foo.sort:entry+ foo};
my $output = qx{../src/task rc:bug.rc rc.report.foo.sort:entry+ foo};
like ($output, qr/older.+newer/ms, 'sort:entry+ -> older newer');
$output = qx{../task rc:bug.rc rc.report.foo.sort:entry- foo};
$output = qx{../src/task rc:bug.rc rc.report.foo.sort:entry- foo};
like ($output, qr/newer.+older/ms, 'sort:entry- -> newer older');
# Ensure the two tasks have a 1 second delta in start.
qx{../task rc:bug.rc start 1};
qx{../src/task rc:bug.rc start 1};
diag ("1 second delay");
sleep 1;
qx{../task rc:bug.rc start 2};
qx{../src/task rc:bug.rc start 2};
$output = qx{../task rc:bug.rc rc.report.foo.sort:start+ foo};
$output = qx{../src/task rc:bug.rc rc.report.foo.sort:start+ foo};
like ($output, qr/older.+newer/ms, 'sort:start+ -> older newer');
$output = qx{../task rc:bug.rc rc.report.foo.sort:start- foo};
$output = qx{../src/task rc:bug.rc rc.report.foo.sort:start- foo};
like ($output, qr/newer.+older/ms, 'sort:start- -> newer older');
# Ensure the two tasks have a 1 second delta in end.
qx{../task rc:bug.rc done 1};
qx{../src/task rc:bug.rc done 1};
diag ("1 second delay");
sleep 1;
qx{../task rc:bug.rc done 2};
qx{../src/task rc:bug.rc done 2};
$output = qx{../task rc:bug.rc rc.report.foo.sort:end+ foo};
$output = qx{../src/task rc:bug.rc rc.report.foo.sort:end+ foo};
like ($output, qr/older.+newer/ms, 'sort:end+ -> older newer');
$output = qx{../task rc:bug.rc rc.report.foo.sort:end- foo};
$output = qx{../src/task rc:bug.rc rc.report.foo.sort:end- foo};
like ($output, qr/newer.+older/ms, 'sort:end- -> newer older');
# Cleanup.

View file

@ -43,14 +43,14 @@ if (open my $fh, '>', '440.rc')
# Create a task and attempt simultaneous subst and appends, both permutations
qx{../task rc:440.rc add Foo};
qx{../task rc:440.rc add Foo};
qx{../src/task rc:440.rc add Foo};
qx{../src/task rc:440.rc add Foo};
qx{../task rc:440.rc 1 /Foo/Bar/ append Appendtext};
qx{../task rc:440.rc 2 append Appendtext /Foo/Bar/};
qx{../src/task rc:440.rc 1 /Foo/Bar/ append Appendtext};
qx{../src/task rc:440.rc 2 append Appendtext /Foo/Bar/};
my $output1 = qx{../task rc:440.rc 1 ls};
my $output2 = qx{../task rc:440.rc 2 ls};
my $output1 = qx{../src/task rc:440.rc 1 ls};
my $output2 = qx{../src/task rc:440.rc 2 ls};
unlike ($output1, qr/Foo/, 'simultaneous subst and append - subst');
like ($output1, qr/\w+ Appendtext/, 'simultaneous subst and append - append');

View file

@ -41,9 +41,9 @@ if (open my $fh, '>', '441.rc')
}
# Bug #441: A colon messes up text replacement with ///
qx{../task rc:441.rc add one two three};
qx{../task rc:441.rc 1 /two/two:/};
my $output = qx{../task rc:441.rc ls};
qx{../src/task rc:441.rc add one two three};
qx{../src/task rc:441.rc 1 /two/two:/};
my $output = qx{../src/task rc:441.rc ls};
like ($output, qr/one two: three/ms, 'Substitution with colon worked');
# Cleanup.

View file

@ -41,10 +41,10 @@ if (open my $fh, '>', '455.rc')
# Bug #455 - Text alignment in reports is broken when text contains utf8 characters
qx{../task rc:455.rc add abc pro:Bar\x{263A}};
qx{../task rc:455.rc add def pro:Foo!};
qx{../src/task rc:455.rc add abc pro:Bar\x{263A}};
qx{../src/task rc:455.rc add def pro:Foo!};
my $output = qx{../task rc:455.rc ls};
my $output = qx{../src/task rc:455.rc ls};
like ($output, qr/\s{7}abc/ms, 'bug 455 - correct spacing in utf8 task');
like ($output, qr/\s{7}def/ms, 'bug 455 - correct spacing in non utf8 task');

View file

@ -43,7 +43,7 @@ if (open my $fh, '>', '466.rc')
}
# Bug #466 - wrong error message when sort key missing +/-
my $output = qx{../task rc:466.rc foo};
my $output = qx{../src/task rc:466.rc foo};
like ($output, qr/Sort column 'id' does not have a \+\/- ascending\/descending indicator\./,
'Error on missing sort direction');

View file

@ -40,82 +40,82 @@ if (open my $fh, '>', 'bug.rc')
}
# Bug #480 - putting a '@' character in tags breaks filters.
qx{../task rc:bug.rc add one +ordinary};
qx{../task rc:bug.rc add two +\@strange};
qx{../src/task rc:bug.rc add one +ordinary};
qx{../src/task rc:bug.rc add two +\@strange};
my $output = qx{../task rc:bug.rc long +ordinary};
my $output = qx{../src/task rc:bug.rc long +ordinary};
like ($output, qr/one/, '+ordinary explicitly included');
unlike ($output, qr/two/, '@strange implicitly excluded');
$output = qx{../task rc:bug.rc long -ordinary};
$output = qx{../src/task rc:bug.rc long -ordinary};
unlike ($output, qr/one/, '-ordinary explicitly excluded');
like ($output, qr/two/, '@strange implicitly included');
$output = qx{../task rc:bug.rc long +\@strange};
$output = qx{../src/task rc:bug.rc long +\@strange};
unlike ($output, qr/one/, '-ordinary implicitly excluded');
like ($output, qr/two/, '@strange explicitly included');
$output = qx{../task rc:bug.rc long -\@strange};
$output = qx{../src/task rc:bug.rc long -\@strange};
like ($output, qr/one/, '+ordinary implicitly included');
unlike ($output, qr/two/, '@strange explicitly excluded');
# Bug #XXX - '-t1 -t2' doesn't seem to work, when @ characters are involved.
unlink 'pending.data';
qx{../task rc:bug.rc add one +t1};
qx{../task rc:bug.rc add two +t2};
qx{../task rc:bug.rc add three +t3};
qx{../src/task rc:bug.rc add one +t1};
qx{../src/task rc:bug.rc add two +t2};
qx{../src/task rc:bug.rc add three +t3};
$output = qx{../task rc:bug.rc list -t1};
$output = qx{../src/task rc:bug.rc list -t1};
unlike ($output, qr/one/, 'Single: no t1');
like ($output, qr/two/, 'Single: yes t2');
like ($output, qr/three/, 'Single: yes t3');
$output = qx{../task rc:bug.rc list -t1 -t2};
$output = qx{../src/task rc:bug.rc list -t1 -t2};
unlike ($output, qr/one/, 'Double: no t1');
unlike ($output, qr/two/, 'Double: no t2');
like ($output, qr/three/, 'Double: yes t3');
$output = qx{../task rc:bug.rc list -t1 -t2 -t3};
$output = qx{../src/task rc:bug.rc list -t1 -t2 -t3};
unlike ($output, qr/one/, 'Triple: no t1');
unlike ($output, qr/two/, 'Triple: no t2');
unlike ($output, qr/three/, 'Triple: no t3');
# Once again, with @ characters.
qx{../task rc:bug.rc 1 +\@1};
qx{../task rc:bug.rc 2 +\@2};
qx{../task rc:bug.rc 3 +\@3};
qx{../src/task rc:bug.rc 1 +\@1};
qx{../src/task rc:bug.rc 2 +\@2};
qx{../src/task rc:bug.rc 3 +\@3};
$output = qx{../task rc:bug.rc list -\@1};
$output = qx{../src/task rc:bug.rc list -\@1};
unlike ($output, qr/one/, 'Single: no @1');
like ($output, qr/two/, 'Single: yes @2');
like ($output, qr/three/, 'Single: yes @3');
$output = qx{../task rc:bug.rc list -\@1 -\@2};
$output = qx{../src/task rc:bug.rc list -\@1 -\@2};
unlike ($output, qr/one/, 'Double: no @1');
unlike ($output, qr/two/, 'Double: no @2');
like ($output, qr/three/, 'Double: yes @3');
$output = qx{../task rc:bug.rc list -\@1 -\@2 -\@3};
$output = qx{../src/task rc:bug.rc list -\@1 -\@2 -\@3};
unlike ($output, qr/one/, 'Triple: no @1');
unlike ($output, qr/two/, 'Triple: no @2');
unlike ($output, qr/three/, 'Triple: no @3');
# Once again, with @ characters and punctuation.
qx{../task rc:bug.rc 1 +\@foo.1};
qx{../task rc:bug.rc 2 +\@foo.2};
qx{../task rc:bug.rc 3 +\@foo.3};
qx{../src/task rc:bug.rc 1 +\@foo.1};
qx{../src/task rc:bug.rc 2 +\@foo.2};
qx{../src/task rc:bug.rc 3 +\@foo.3};
$output = qx{../task rc:bug.rc list -\@foo.1};
$output = qx{../src/task rc:bug.rc list -\@foo.1};
unlike ($output, qr/one/, 'Single: no @foo.1');
like ($output, qr/two/, 'Single: yes @foo.2');
like ($output, qr/three/, 'Single: yes @foo.3');
$output = qx{../task rc:bug.rc list -\@foo.1 -\@foo.2};
$output = qx{../src/task rc:bug.rc list -\@foo.1 -\@foo.2};
unlike ($output, qr/one/, 'Double: no @foo.1');
unlike ($output, qr/two/, 'Double: no @foo.2');
like ($output, qr/three/, 'Double: yes @foo.3');
$output = qx{../task rc:bug.rc list -\@foo.1 -\@foo.2 -\@foo.3};
$output = qx{../src/task rc:bug.rc list -\@foo.1 -\@foo.2 -\@foo.3};
unlike ($output, qr/one/, 'Triple: no @foo.1');
unlike ($output, qr/two/, 'Triple: no @foo.2');
unlike ($output, qr/three/, 'Triple: no @foo.3');

View file

@ -40,13 +40,13 @@ if (open my $fh, '>', 'bug.rc')
}
# Bug #485 - 'task list recur:month' doesn't list monthly tasks
qx{../task rc:bug.rc add one due:tomorrow recur:monthly};
qx{../task rc:bug.rc add two due:tomorrow recur:month};
my $output = qx{../task rc:bug.rc list recur:monthly};
qx{../src/task rc:bug.rc add one due:tomorrow recur:monthly};
qx{../src/task rc:bug.rc add two due:tomorrow recur:month};
my $output = qx{../src/task rc:bug.rc list recur:monthly};
like ($output, qr/one/, 'monthly -> monthly');
like ($output, qr/two/, 'month -> monthly');
$output = qx{../task rc:bug.rc list recur:month};
$output = qx{../src/task rc:bug.rc list recur:month};
like ($output, qr/one/, 'monthly -> month');
like ($output, qr/two/, 'month -> month');

View file

@ -40,9 +40,9 @@ if (open my $fh, '>', 'bug.rc')
}
# Bug #489 - tags.none: is not filtering tagless tasks
qx{../task rc:bug.rc add with +tag};
qx{../task rc:bug.rc add without};
my $output = qx{../task rc:bug.rc list tags.none:};
qx{../src/task rc:bug.rc add with +tag};
qx{../src/task rc:bug.rc add without};
my $output = qx{../src/task rc:bug.rc list tags.none:};
unlike ($output, qr/with /, 'tags.none: skips tagged');
like ($output, qr/without/, 'tags.none: finds tagless');

View file

@ -40,9 +40,9 @@ if (open my $fh, '>', 'bug.rc')
}
# Bug #495 - double hyphen mishandled for annotations.
qx{../task rc:bug.rc add foo};
qx{../task rc:bug.rc 1 annotate "This -- is -- a -- test"};
my $output = qx{../task rc:bug.rc list};
qx{../src/task rc:bug.rc add foo};
qx{../src/task rc:bug.rc 1 annotate "This -- is -- a -- test"};
my $output = qx{../src/task rc:bug.rc list};
like ($output, qr/This -- is -- a -- test/, 'Double hyphens preserved.');
# Cleanup.

View file

@ -40,7 +40,7 @@ if (open my $fh, '>', 'bug.rc')
}
# Bug #555 - log with a project segfaults.
my $output = qx{../task rc:bug.rc log description project:p};
my $output = qx{../src/task rc:bug.rc log description project:p};
unlike ($output, qr/Segmentation fault/, 'no segfault from log with project');
# Cleanup.

View file

@ -61,15 +61,15 @@ if (open my $fh, '>', 'remote.rc')
}
# add a remote task
qx{../task rc:remote.rc add remote task};
qx{../src/task rc:remote.rc add remote task};
# add a local task
qx(../task rc:local.rc add local task);
qx(../src/task rc:local.rc add local task);
# merge and autopush
qx{../task rc:local.rc merge};
qx{../src/task rc:local.rc merge};
my $output = qx{../task rc:remote.rc ls};
my $output = qx{../src/task rc:remote.rc ls};
like ($output, qr/local task/, "autopush failed");
# Cleanup.

View file

@ -39,12 +39,12 @@ if (open my $fh, '>', 'bug_annotate.rc')
}
# Attempt a blank annotation.
qx{../task rc:bug_annotate.rc add foo};
my $output = qx{../task rc:bug_annotate.rc 1 annotate};
qx{../src/task rc:bug_annotate.rc add foo};
my $output = qx{../src/task rc:bug_annotate.rc 1 annotate};
like ($output, qr/Cannot apply a blank annotation./, 'failed on blank annotation');
# Attempt an annotation without ID
$output = qx{../task rc:bug_annotate.rc annotate bar};
$output = qx{../src/task rc:bug_annotate.rc annotate bar};
like ($output, qr/ID needed to apply an annotation./, 'failed on annotation without ID');
# Cleanup.

View file

@ -55,8 +55,8 @@ if (open my $fh, '>', 'annual.rc')
# 10 12/29/2008 - foo
# 11 12/29/2009 - foo
qx{../task rc:annual.rc add foo due:1/1/2000 recur:annual until:1/1/2009};
my $output = qx{../task rc:annual.rc list};
qx{../src/task rc:annual.rc add foo due:1/1/2000 recur:annual until:1/1/2009};
my $output = qx{../src/task rc:annual.rc list};
like ($output, qr/1\s+1\/1\/2000\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 1 no creep');
like ($output, qr/2\s+1\/1\/2001\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 2 no creep');
like ($output, qr/3\s+1\/1\/2002\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 3 no creep');

View file

@ -55,28 +55,28 @@ EOF
}
# Verify data is readable and just as expected.
my $output = qx{../task rc:before.rc 1 info};
my $output = qx{../src/task rc:before.rc 1 info};
like ($output, qr/Start\s+12\/22\/2008/, 'task 1 start date as expected');
$output = qx{../task rc:before.rc 2 info};
$output = qx{../src/task rc:before.rc 2 info};
like ($output, qr/Start\s+4\/17\/2009/, 'task 2 start date as expected');
$output = qx{../task rc:before.rc ls start.before:12/1/2008};
$output = qx{../src/task rc:before.rc ls start.before:12/1/2008};
unlike ($output, qr/foo/, 'no foo before 12/1/2008');
unlike ($output, qr/bar/, 'no bar before 12/1/2008');
$output = qx{../task rc:before.rc ls start.before:1/1/2009};
$output = qx{../src/task rc:before.rc ls start.before:1/1/2009};
like ($output, qr/foo/, 'foo before 1/1/2009');
unlike ($output, qr/bar/, 'no bar before 1/1/2009');
$output = qx{../task rc:before.rc ls start.before:5/1/2009};
$output = qx{../src/task rc:before.rc ls start.before:5/1/2009};
like ($output, qr/foo/, 'foo before 5/1/2009');
like ($output, qr/bar/, 'bar before 5/1/2009');
$output = qx{../task rc:before.rc ls start.after:12/1/2008};
$output = qx{../src/task rc:before.rc ls start.after:12/1/2008};
like ($output, qr/foo/, 'foo after 12/1/2008');
like ($output, qr/bar/, 'bar after 12/1/2008');
$output = qx{../task rc:before.rc ls start.after:1/1/2009};
$output = qx{../src/task rc:before.rc ls start.after:1/1/2009};
unlike ($output, qr/foo/, 'no foo after 1/1/2009');
like ($output, qr/bar/, 'bar after 1/1/2009');
$output = qx{../task rc:before.rc ls start.after:5/1/2009};
$output = qx{../src/task rc:before.rc ls start.after:5/1/2009};
unlike ($output, qr/foo/, 'no foo after 5/1/2009');
unlike ($output, qr/bar/, 'no bar after 5/1/2009');

View file

@ -42,30 +42,30 @@ if (open my $fh, '>', 'bulk.rc')
# Add some tasks with project, prioriy and due date, some with only due date.
# Bulk add a project and priority to the tasks that were without.
qx{../task rc:bulk.rc add t1 pro:p1 pri:H due:monday};
qx{../task rc:bulk.rc add t2 pro:p1 pri:M due:tuesday};
qx{../task rc:bulk.rc add t3 pro:p1 pri:L due:wednesday};
qx{../task rc:bulk.rc add t4 due:thursday};
qx{../task rc:bulk.rc add t5 due:friday};
qx{../task rc:bulk.rc add t6 due:saturday};
qx{../src/task rc:bulk.rc add t1 pro:p1 pri:H due:monday};
qx{../src/task rc:bulk.rc add t2 pro:p1 pri:M due:tuesday};
qx{../src/task rc:bulk.rc add t3 pro:p1 pri:L due:wednesday};
qx{../src/task rc:bulk.rc add t4 due:thursday};
qx{../src/task rc:bulk.rc add t5 due:friday};
qx{../src/task rc:bulk.rc add t6 due:saturday};
my $output = qx{echo "quit"|../task rc:bulk.rc pro:p1 pri:M 4 5 6};
my $output = qx{echo "quit"|../src/task rc:bulk.rc pro:p1 pri:M 4 5 6};
like ($output, qr/Modified 0 tasks/, '"quit" prevents any further modifications');
$output = qx{echo "All"|../task rc:bulk.rc pro:p1 pri:M 4 5 6};
$output = qx{echo "All"|../src/task rc:bulk.rc pro:p1 pri:M 4 5 6};
unlike ($output, qr/Task 4 "t4"\n - No changes were made/, 'Task 4 modified');
unlike ($output, qr/Task 5 "t5"\n - No changes were made/, 'Task 5 modified');
unlike ($output, qr/Task 6 "t6"\n - No changes were made/, 'Task 6 modified');
$output = qx{../task rc:bulk.rc info 4};
$output = qx{../src/task rc:bulk.rc info 4};
like ($output, qr/Project\s+p1/, 'project applied to 4');
like ($output, qr/Priority\s+M/, 'priority applied to 4');
$output = qx{../task rc:bulk.rc info 5};
$output = qx{../src/task rc:bulk.rc info 5};
like ($output, qr/Project\s+p1/, 'project applied to 5');
like ($output, qr/Priority\s+M/, 'priority applied to 5');
$output = qx{../task rc:bulk.rc info 6};
$output = qx{../src/task rc:bulk.rc info 6};
like ($output, qr/Project\s+p1/, 'project applied to 6');
like ($output, qr/Priority\s+M/, 'priority applied to 6');

View file

@ -42,65 +42,65 @@ if (open my $fh, '>', 'cal.rc')
# Bug: The 'cal' command can fail when provided with challenging arguments.
# Should not fail (because they are correct):
my $output = qx{../task rc:cal.rc cal 2>&1};
my $output = qx{../src/task rc:cal.rc cal 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal');
# y due 2010 donkey 8
$output = qx{../task rc:cal.rc cal y 2>&1};
$output = qx{../src/task rc:cal.rc cal y 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y');
$output = qx{../task rc:cal.rc cal 8 2>&1};
$output = qx{../src/task rc:cal.rc cal 8 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal 8');
$output = qx{../task rc:cal.rc cal due 2>&1};
$output = qx{../src/task rc:cal.rc cal due 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal due');
$output = qx{../task rc:cal.rc cal 2010 2>&1};
$output = qx{../src/task rc:cal.rc cal 2010 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal 2010');
$output = qx{../task rc:cal.rc cal donkey 2>&1};
$output = qx{../src/task rc:cal.rc cal donkey 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal donkey');
# y due 2010 donkey 8
$output = qx{../task rc:cal.rc cal y due 2>&1};
$output = qx{../src/task rc:cal.rc cal y due 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y due');
$output = qx{../task rc:cal.rc cal y 8 2>&1};
$output = qx{../src/task rc:cal.rc cal y 8 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y 8');
$output = qx{../task rc:cal.rc cal y 2010 2>&1};
$output = qx{../src/task rc:cal.rc cal y 2010 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y 2010');
$output = qx{../task rc:cal.rc cal y donkey 2>&1};
$output = qx{../src/task rc:cal.rc cal y donkey 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y donkey');
$output = qx{../task rc:cal.rc cal 8 due 2>&1};
$output = qx{../src/task rc:cal.rc cal 8 due 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal 8 due');
$output = qx{../task rc:cal.rc cal 8 2010 2>&1};
$output = qx{../src/task rc:cal.rc cal 8 2010 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal 8 2010');
$output = qx{../task rc:cal.rc cal 8 donkey 2>&1};
$output = qx{../src/task rc:cal.rc cal 8 donkey 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal 8 donkey');
$output = qx{../task rc:cal.rc cal due 2010 2>&1};
$output = qx{../src/task rc:cal.rc cal due 2010 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal due 2010');
$output = qx{../task rc:cal.rc cal due donkey 2>&1};
$output = qx{../src/task rc:cal.rc cal due donkey 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal due donkey');
$output = qx{../task rc:cal.rc cal 2010 donkey 2>&1};
$output = qx{../src/task rc:cal.rc cal 2010 donkey 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal 2010 donkey');
# y 8 due 2010 donkey
$output = qx{../task rc:cal.rc cal y 8 due 2>&1};
$output = qx{../src/task rc:cal.rc cal y 8 due 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y 8 due');
$output = qx{../task rc:cal.rc cal y 8 2010 2>&1};
$output = qx{../src/task rc:cal.rc cal y 8 2010 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y 8 2010');
$output = qx{../task rc:cal.rc cal y 8 donkey 2>&1};
$output = qx{../src/task rc:cal.rc cal y 8 donkey 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y 8 donkey');
$output = qx{../task rc:cal.rc cal y due 2010 2>&1};
$output = qx{../src/task rc:cal.rc cal y due 2010 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y due 2010');
$output = qx{../task rc:cal.rc cal y due donkey 2>&1};
$output = qx{../src/task rc:cal.rc cal y due donkey 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y due donkey');
$output = qx{../task rc:cal.rc cal y 2010 donkey 2>&1};
$output = qx{../src/task rc:cal.rc cal y 2010 donkey 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y 2010 donkey');
$output = qx{../task rc:cal.rc cal 8 due 2010 2>&1};
$output = qx{../src/task rc:cal.rc cal 8 due 2010 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal 8 due 2010');
$output = qx{../task rc:cal.rc cal 8 due donkey 2>&1};
$output = qx{../src/task rc:cal.rc cal 8 due donkey 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal 8 due donkey');
$output = qx{../task rc:cal.rc cal 8 2010 donkey 2>&1};
$output = qx{../src/task rc:cal.rc cal 8 2010 donkey 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal 8 2010 donkey');
$output = qx{../task rc:cal.rc cal due 2010 8 2>&1};
$output = qx{../src/task rc:cal.rc cal due 2010 8 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal due 2010 8');
$output = qx{../task rc:cal.rc cal due 2010 donkey 2>&1};
$output = qx{../src/task rc:cal.rc cal due 2010 donkey 2>&1};
unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal due 2010 donkey');
# Cleanup.

View file

@ -47,12 +47,12 @@ if (open my $fh, '>', 'bug_concat.rc')
#
# Thisisanewdescription
qx{../task rc:bug_concat.rc add This is the original text};
my $output = qx{../task rc:bug_concat.rc info 1};
qx{../src/task rc:bug_concat.rc add This is the original text};
my $output = qx{../src/task rc:bug_concat.rc info 1};
like ($output, qr/Description\s+This is the original text\n/, 'original correct');
qx{../task rc:bug_concat.rc 1 This is the modified text};
$output = qx{../task rc:bug_concat.rc info 1};
qx{../src/task rc:bug_concat.rc 1 This is the modified text};
$output = qx{../src/task rc:bug_concat.rc info 1};
like ($output, qr/Description\s+This is the modified text\n/, 'modified correct');
# When a task is added like this:
@ -63,8 +63,8 @@ like ($output, qr/Description\s+This is the modified text\n/, 'modified correct'
#
# aaabbb:ccc ddd
qx{../task rc:bug_concat.rc add aaa bbb:ccc ddd};
$output = qx{../task rc:bug_concat.rc info 2};
qx{../src/task rc:bug_concat.rc add aaa bbb:ccc ddd};
$output = qx{../src/task rc:bug_concat.rc info 2};
like ($output, qr/Description\s+aaa bbb:ccc ddd\n/, 'properly concatenated');
# Cleanup.

View file

@ -56,9 +56,9 @@ eval
{
$SIG{'ALRM'} = sub {die "alarm\n"};
alarm 10;
my $output = qx{../task rc:hang.rc list;
../task rc:hang.rc add due:today recur:1d infinite loop;
../task rc:hang.rc info 1};
my $output = qx{../src/task rc:hang.rc list;
../src/task rc:hang.rc add due:today recur:1d infinite loop;
../src/task rc:hang.rc info 1};
alarm 0;
like ($output, qr/^Description\s+infinite loop\n/m, 'no hang');

View file

@ -40,39 +40,39 @@ if (open my $fh, '>', 'hasnt.rc')
}
# 1
qx{../task rc:hasnt.rc add foo};
qx{../src/task rc:hasnt.rc add foo};
# 2
qx{../task rc:hasnt.rc add foo};
qx{../task rc:hasnt.rc 2 annotate bar};
qx{../src/task rc:hasnt.rc add foo};
qx{../src/task rc:hasnt.rc 2 annotate bar};
# 3
qx{../task rc:hasnt.rc add foo};
qx{../task rc:hasnt.rc 3 annotate bar};
qx{../src/task rc:hasnt.rc add foo};
qx{../src/task rc:hasnt.rc 3 annotate bar};
diag ("3 second delay");
sleep 1;
qx{../task rc:hasnt.rc 3 annotate baz};
qx{../src/task rc:hasnt.rc 3 annotate baz};
# 4
qx{../task rc:hasnt.rc add bar};
qx{../src/task rc:hasnt.rc add bar};
# 5
qx{../task rc:hasnt.rc add bar};
qx{../task rc:hasnt.rc 5 annotate foo};
qx{../src/task rc:hasnt.rc add bar};
qx{../src/task rc:hasnt.rc 5 annotate foo};
# 6
qx{../task rc:hasnt.rc add bar};
qx{../task rc:hasnt.rc 6 annotate foo};
qx{../src/task rc:hasnt.rc add bar};
qx{../src/task rc:hasnt.rc 6 annotate foo};
sleep 1;
qx{../task rc:hasnt.rc 6 annotate baz};
qx{../src/task rc:hasnt.rc 6 annotate baz};
#7
qx{../task rc:hasnt.rc add one};
qx{../task rc:hasnt.rc 7 annotate two};
qx{../src/task rc:hasnt.rc add one};
qx{../src/task rc:hasnt.rc 7 annotate two};
sleep 1;
qx{../task rc:hasnt.rc 7 annotate three};
qx{../src/task rc:hasnt.rc 7 annotate three};
my $output = qx{../task rc:hasnt.rc ls description.has:foo};
my $output = qx{../src/task rc:hasnt.rc ls description.has:foo};
like ($output, qr/\n 1/, '1 has foo -> yes');
like ($output, qr/\n 2/, '2 has foo -> yes');
like ($output, qr/\n 3/, '3 has foo -> yes');
@ -81,7 +81,7 @@ like ($output, qr/\n 5/, '5 has foo -> yes');
like ($output, qr/\n 6/, '6 has foo -> yes');
unlike ($output, qr/\n 7/, '7 has foo -> no');
$output = qx{../task rc:hasnt.rc ls description.hasnt:foo};
$output = qx{../src/task rc:hasnt.rc ls description.hasnt:foo};
unlike ($output, qr/\n 1/, '1 hasnt foo -> no');
unlike ($output, qr/\n 2/, '2 hasnt foo -> no');
unlike ($output, qr/\n 3/, '3 hasnt foo -> no');

View file

@ -74,65 +74,65 @@ Confirmed:
*y
=cut
my $output = qx{../task rc:period.rc add daily due:tomorrow recur:daily};
my $output = qx{../src/task rc:period.rc add daily due:tomorrow recur:daily};
unlike ($output, qr/was not recognized/, 'recur:daily');
$output = qx{../task rc:period.rc add day due:tomorrow recur:day};
$output = qx{../src/task rc:period.rc add day due:tomorrow recur:day};
unlike ($output, qr/was not recognized/, 'recur:day');
$output = qx{../task rc:period.rc add weekly due:tomorrow recur:weekly};
$output = qx{../src/task rc:period.rc add weekly due:tomorrow recur:weekly};
unlike ($output, qr/was not recognized/, 'recur:weekly');
$output = qx{../task rc:period.rc add sennight due:tomorrow recur:sennight};
$output = qx{../src/task rc:period.rc add sennight due:tomorrow recur:sennight};
unlike ($output, qr/was not recognized/, 'recur:sennight');
$output = qx{../task rc:period.rc add biweekly due:tomorrow recur:biweekly};
$output = qx{../src/task rc:period.rc add biweekly due:tomorrow recur:biweekly};
unlike ($output, qr/was not recognized/, 'recur:biweekly');
$output = qx{../task rc:period.rc add fortnight due:tomorrow recur:fortnight};
$output = qx{../src/task rc:period.rc add fortnight due:tomorrow recur:fortnight};
unlike ($output, qr/was not recognized/, 'recur:fortnight');
$output = qx{../task rc:period.rc add monthly due:tomorrow recur:monthly};
$output = qx{../src/task rc:period.rc add monthly due:tomorrow recur:monthly};
unlike ($output, qr/was not recognized/, 'recur:monthly');
$output = qx{../task rc:period.rc add quarterly due:tomorrow recur:quarterly};
$output = qx{../src/task rc:period.rc add quarterly due:tomorrow recur:quarterly};
unlike ($output, qr/was not recognized/, 'recur:quarterly');
$output = qx{../task rc:period.rc add semiannual due:tomorrow recur:semiannual};
$output = qx{../src/task rc:period.rc add semiannual due:tomorrow recur:semiannual};
unlike ($output, qr/was not recognized/, 'recur:semiannual');
$output = qx{../task rc:period.rc add bimonthly due:tomorrow recur:bimonthly};
$output = qx{../src/task rc:period.rc add bimonthly due:tomorrow recur:bimonthly};
unlike ($output, qr/was not recognized/, 'recur:bimonthly');
$output = qx{../task rc:period.rc add biannual due:tomorrow recur:biannual};
$output = qx{../src/task rc:period.rc add biannual due:tomorrow recur:biannual};
unlike ($output, qr/was not recognized/, 'recur:biannual');
$output = qx{../task rc:period.rc add biyearly due:tomorrow recur:biyearly};
$output = qx{../src/task rc:period.rc add biyearly due:tomorrow recur:biyearly};
unlike ($output, qr/was not recognized/, 'recur:biyearly');
$output = qx{../task rc:period.rc add annual due:tomorrow recur:annual};
$output = qx{../src/task rc:period.rc add annual due:tomorrow recur:annual};
unlike ($output, qr/was not recognized/, 'recur:annual');
$output = qx{../task rc:period.rc add yearly due:tomorrow recur:yearly};
$output = qx{../src/task rc:period.rc add yearly due:tomorrow recur:yearly};
unlike ($output, qr/was not recognized/, 'recur:yearly');
$output = qx{../task rc:period.rc add 2d due:tomorrow recur:2d};
$output = qx{../src/task rc:period.rc add 2d due:tomorrow recur:2d};
unlike ($output, qr/was not recognized/, 'recur:2d');
$output = qx{../task rc:period.rc add 2w due:tomorrow recur:2w};
$output = qx{../src/task rc:period.rc add 2w due:tomorrow recur:2w};
unlike ($output, qr/was not recognized/, 'recur:2w');
$output = qx{../task rc:period.rc add 2m due:tomorrow recur:2mo};
$output = qx{../src/task rc:period.rc add 2m due:tomorrow recur:2mo};
unlike ($output, qr/was not recognized/, 'recur:2m');
$output = qx{../task rc:period.rc add 2q due:tomorrow recur:2q};
$output = qx{../src/task rc:period.rc add 2q due:tomorrow recur:2q};
unlike ($output, qr/was not recognized/, 'recur:2q');
$output = qx{../task rc:period.rc add 2y due:tomorrow recur:2y};
$output = qx{../src/task rc:period.rc add 2y due:tomorrow recur:2y};
unlike ($output, qr/was not recognized/, 'recur:2y');
# Verify that the recurring task instances get created. One of each.
$output = qx{../task rc:period.rc list};
$output = qx{../src/task rc:period.rc list};
like ($output, qr/\bdaily\b/, 'verify daily');
like ($output, qr/\bday\b/, 'verify day');
like ($output, qr/\bweekly\b/, 'verify weekly');

View file

@ -40,10 +40,10 @@ if (open my $fh, '>', 'range.rc')
}
# Add three tasks, and attempt to list the middle one within a range.
qx{../task rc:range.rc add one due:8/1/2009};
qx{../task rc:range.rc add two due:8/3/2009};
qx{../task rc:range.rc add three due:8/5/2009};
my $output = qx{../task rc:range.rc ls due.after:8/2/2009 due.before:8/4/2009};
qx{../src/task rc:range.rc add one due:8/1/2009};
qx{../src/task rc:range.rc add two due:8/3/2009};
qx{../src/task rc:range.rc add three due:8/5/2009};
my $output = qx{../src/task rc:range.rc ls due.after:8/2/2009 due.before:8/4/2009};
unlike ($output, qr/one/, 'Missing prior to range');
like ($output, qr/two/, 'Found within range');
unlike ($output, qr/three/, 'Missing after range');

View file

@ -40,8 +40,8 @@ if (open my $fh, '>', 'recur.rc')
}
# Add a recurring task with no due date, look for expected error.
qx{../task rc:recur.rc add foo recur:daily};
my $output = qx{../task rc:recur.rc info 1};
qx{../src/task rc:recur.rc add foo recur:daily};
my $output = qx{../src/task rc:recur.rc info 1};
unlike ($output, qr/Description\s+foo/, 'task not created - missing due date');
# Cleanup.

View file

@ -38,16 +38,16 @@ if (open my $fh, '>', 'bug_sort.rc')
ok (-r 'bug_sort.rc', 'Created bug_sort.rc');
}
my $setup = "../task rc:bug_sort.rc add one;"
. "../task rc:bug_sort.rc add two;"
. "../task rc:bug_sort.rc add three recur:daily due:eom;";
my $setup = "../src/task rc:bug_sort.rc add one;"
. "../src/task rc:bug_sort.rc add two;"
. "../src/task rc:bug_sort.rc add three recur:daily due:eom;";
qx{$setup};
my $output = qx{../task rc:bug_sort.rc list};
my $output = qx{../src/task rc:bug_sort.rc list};
like ($output, qr/three.*(?:one.*two|two.*one)/msi, 'list did not hang');
qx{../task rc:bug_sort.rc 1 priority:H};
$output = qx{../task rc:bug_sort.rc list};
qx{../src/task rc:bug_sort.rc 1 priority:H};
$output = qx{../src/task rc:bug_sort.rc list};
like ($output, qr/three.*one.*two/msi, 'list did not hang after pri:H on 1');
# Cleanup.

View file

@ -39,10 +39,10 @@ if (open my $fh, '>', 'extra.rc')
ok (-r 'extra.rc', 'Created extra.rc');
}
qx{../task rc:extra.rc add foo};
my $output = qx{../task rc:extra.rc 1 start pri:L};
qx{../src/task rc:extra.rc add foo};
my $output = qx{../src/task rc:extra.rc 1 start pri:L};
like ($output, qr/The 'start' command does not allow further modification of a task\./, 'no modifications allowed for start');
$output = qx{../task rc:extra.rc 1 stop pro:bar};
$output = qx{../src/task rc:extra.rc 1 stop pro:bar};
like ($output, qr/The 'stop' command does not allow further modification of a task\./, 'no modifications allowed for stop');
# Cleanup.

View file

@ -41,16 +41,16 @@ if (open my $fh, '>', 'summary.rc')
# Add three tasks. Do 1, delete 1, leave 1 pending. Summary should depict a
# 50% completion.
qx{../task rc:summary.rc add project:A one};
qx{../task rc:summary.rc add project:A two};
qx{../task rc:summary.rc add project:A three};
qx{../task rc:summary.rc do 1};
qx{../task rc:summary.rc delete 2};
my $output = qx{../task rc:summary.rc summary};
qx{../src/task rc:summary.rc add project:A one};
qx{../src/task rc:summary.rc add project:A two};
qx{../src/task rc:summary.rc add project:A three};
qx{../src/task rc:summary.rc do 1};
qx{../src/task rc:summary.rc delete 2};
my $output = qx{../src/task rc:summary.rc summary};
like ($output, qr/A\s+1\s+(?:-|\d\ssecs?)\s+50%/, 'summary correctly shows 50% before report');
qx{../task rc:summary.rc list};
$output = qx{../task rc:summary.rc summary};
qx{../src/task rc:summary.rc list};
$output = qx{../src/task rc:summary.rc summary};
like ($output, qr/A\s+1\s+(?:-|\d\ssecs?)\s+50%/, 'summary correctly shows 50% after report');
# Cleanup.

View file

@ -41,39 +41,39 @@ if (open my $fh, '>', 'uuid.rc')
# Add a task, dup it, add a recurring task, list. Then make sure they all have
# unique UUID values.
qx{../task rc:uuid.rc add simple};
qx{../task rc:uuid.rc 1 duplicate};
qx{../task rc:uuid.rc add periodic recur:daily due:yesterday};
my $output = qx{../task rc:uuid.rc stats};
qx{../src/task rc:uuid.rc add simple};
qx{../src/task rc:uuid.rc 1 duplicate};
qx{../src/task rc:uuid.rc add periodic recur:daily due:yesterday};
my $output = qx{../src/task rc:uuid.rc stats};
my @all_uuids;
my %unique_uuids;
$output = qx{../task rc:uuid.rc 1 info};
$output = qx{../src/task rc:uuid.rc 1 info};
my ($uuid) = $output =~ /UUID\s+(\S+)/;
push @all_uuids, $uuid;
$unique_uuids{$uuid} = undef;
$output = qx{../task rc:uuid.rc 2 info};
$output = qx{../src/task rc:uuid.rc 2 info};
($uuid) = $output =~ /UUID\s+(\S+)/;
push @all_uuids, $uuid;
$unique_uuids{$uuid} = undef;
$output = qx{../task rc:uuid.rc 3 info};
$output = qx{../src/task rc:uuid.rc 3 info};
($uuid) = $output =~ /UUID\s+(\S+)/;
push @all_uuids, $uuid;
$unique_uuids{$uuid} = undef;
$output = qx{../task rc:uuid.rc 4 info};
$output = qx{../src/task rc:uuid.rc 4 info};
($uuid) = $output =~ /UUID\s+(\S+)/;
push @all_uuids, $uuid;
$unique_uuids{$uuid} = undef;
$output = qx{../task rc:uuid.rc 5 info};
$output = qx{../src/task rc:uuid.rc 5 info};
($uuid) = $output =~ /UUID\s+(\S+)/;
push @all_uuids, $uuid;
$unique_uuids{$uuid} = undef;
$output = qx{../task rc:uuid.rc 6 info};
$output = qx{../src/task rc:uuid.rc 6 info};
($uuid) = $output =~ /UUID\s+(\S+)/;
push @all_uuids, $uuid;
$unique_uuids{$uuid} = undef;

View file

@ -64,7 +64,7 @@ if ($day <= 9)
}
# task cal and task cal y
my $output = qx{../task rc:cal.rc rc._forcecolor:on cal};
my $output = qx{../src/task rc:cal.rc rc._forcecolor:on cal};
if ($wday == 6 || $wday == 0)
{
like ($output, qr/\[30;106m$day/, 'Current day is highlighted');
@ -74,14 +74,14 @@ else
like ($output, qr/\[30;46m$day/, 'Current day is highlighted');
}
like ($output, qr/$month\S*?\s+?$year/, 'Current month and year are displayed');
$output = qx{../task rc:cal.rc add zero};
$output = qx{../src/task rc:cal.rc add zero};
unlike ($output, qr/\[41m\d+/, 'No overdue tasks are present');
unlike ($output, qr/\[43m\d+/, 'No due tasks are present');
$output = qx{../task rc:cal.rc rc.weekstart:Sunday cal};
$output = qx{../src/task rc:cal.rc rc.weekstart:Sunday cal};
like ($output, qr/Su Mo Tu/, 'Week starts on Sunday');
$output = qx{../task rc:cal.rc rc.weekstart:Monday cal};
$output = qx{../src/task rc:cal.rc rc.weekstart:Monday cal};
like ($output, qr/Fr Sa Su/, 'Week starts on Monday');
$output = qx{../task rc:cal.rc cal y};
$output = qx{../src/task rc:cal.rc cal y};
like ($output, qr/$month\S*?\s+?$year/, 'Current month and year are displayed');
if ($month eq "Jan")
{
@ -95,21 +95,21 @@ if ($month eq "Jan")
unlike ($output, qr/$month\S*?\s+?$nextyear/, 'Current month and year ahead are not displayed');
# task cal due and task cal due y
qx{../task rc:cal.rc add due:20190515 one};
qx{../task rc:cal.rc add due:20200123 two};
$output = qx{../task rc:cal.rc rc._forcecolor:on cal due};
qx{../src/task rc:cal.rc add due:20190515 one};
qx{../src/task rc:cal.rc add due:20200123 two};
$output = qx{../src/task rc:cal.rc rc._forcecolor:on cal due};
unlike ($output, qr/April 2019/, 'April 2019 is not displayed');
like ($output, qr/May 2019/, 'May 2019 is displayed');
unlike ($output, qr/January 2020/, 'January 2020 is not displayed');
like ($output, qr/30;42m15/, 'Task 1 is color-coded due');
$output = qx{../task rc:cal.rc rc._forcecolor:on cal due y};
$output = qx{../src/task rc:cal.rc rc._forcecolor:on cal due y};
like ($output, qr/30;42m23/, 'Task 2 is color-coded due');
like ($output, qr/April 2020/, 'April 2020 is displayed');
unlike ($output, qr/May 2020/, 'May 2020 is not displayed');
qx{../task rc:cal.rc ls};
qx{../task rc:cal.rc del 1-3};
qx{../task rc:cal.rc add due:20080408 three};
$output = qx{../task rc:cal.rc rc._forcecolor:on cal due};
qx{../src/task rc:cal.rc ls};
qx{../src/task rc:cal.rc del 1-3};
qx{../src/task rc:cal.rc add due:20080408 three};
$output = qx{../src/task rc:cal.rc rc._forcecolor:on cal due};
like ($output, qr/April 2008/, 'April 2008 is displayed');
like ($output, qr/41m 8/, 'Task 3 is color-coded overdue');
like ($output, qr/37;100m19/, 'Saturday April 19, 2008 is color-coded');
@ -117,7 +117,7 @@ like ($output, qr/37;100m20/, 'Sunday April 20, 2008 is color-coded');
like ($output, qr/30;47m 1/, 'Weeknumbers are color-coded');
# task cal 2016
$output = qx{../task rc:cal.rc rc.weekstart:Monday cal 2016};
$output = qx{../src/task rc:cal.rc rc.weekstart:Monday cal 2016};
unlike ($output, qr/2015/, 'Year 2015 is not displayed');
unlike ($output, qr/2017/, 'Year 2017 is not displayed');
like ($output, qr/January 2016/, 'January 2016 is displayed');
@ -126,32 +126,32 @@ like ($output, qr/53 +1/, '2015 has 53 weeks (ISO)');
like ($output, qr/1 +4/, 'First week in 2016 starts with Mon Jan 4 (ISO)');
like ($output, qr/52 +26/, 'Last week in 2016 starts with Mon Dec 26 (ISO)');
like ($output, qr/9 +29/, 'Leap year - Feb 29 is Monday in week 9 (ISO)');
$output = qx{../task rc:cal.rc rc.weekstart:Sunday cal 2016};
$output = qx{../src/task rc:cal.rc rc.weekstart:Sunday cal 2016};
like ($output, qr/1 +1/, 'First week in 2016 starts with Fri Jan 1 (US)');
like ($output, qr/53 +25/, 'Last week in 2016 starts with Sun Dec 25 (US)');
$output = qx{../task rc:cal.rc rc.weekstart:Monday rc.displayweeknumber:off cal 2016};
$output = qx{../src/task rc:cal.rc rc.weekstart:Monday rc.displayweeknumber:off cal 2016};
unlike ($output, qr/53/, 'Weeknumbers are not displayed');
# task cal 4 2010
$output = qx{../task rc:cal.rc rc.monthsperline:1 cal 4 2010};
$output = qx{../src/task rc:cal.rc rc.monthsperline:1 cal 4 2010};
unlike ($output, qr/March 2010/, 'March 2010 is not displayed');
like ($output, qr/April 2010/, 'April 2010 is displayed');
unlike ($output, qr/May 2010/, 'May 2010 is not displayed');
# calendar offsets
$output = qx{../task rc:cal.rc rc.calendar.offset:on rc.monthsperline:1 cal 1 2011};
$output = qx{../src/task rc:cal.rc rc.calendar.offset:on rc.monthsperline:1 cal 1 2011};
unlike ($output, qr/November 2010/, 'November 2010 is not displayed');
like ($output, qr/December 2010/, 'December 2010 is displayed');
unlike ($output, qr/January 2011/, 'January 2011 is not displayed');
$output = qx{../task rc:cal.rc rc.calendar.offset:on rc.calendar.offset.value:2 rc.monthsperline:1 cal 1 2011};
$output = qx{../src/task rc:cal.rc rc.calendar.offset:on rc.calendar.offset.value:2 rc.monthsperline:1 cal 1 2011};
unlike ($output, qr/January 2011/, 'January 2011 is not displayed');
unlike ($output, qr/February 2011/, 'February 2011 is not displayed');
like ($output, qr/March 2011/, 'March 2011 is displayed');
unlike ($output, qr/April 2011/, 'April 2011 is not displayed');
$output = qx{../task rc:cal.rc rc.calendar.offset:on rc.calendar.offset.value:-12 rc.monthsperline:1 cal};
$output = qx{../src/task rc:cal.rc rc.calendar.offset:on rc.calendar.offset.value:-12 rc.monthsperline:1 cal};
like ($output, qr/$month\S*?\s+?$prevyear/, 'Current month and year ahead are displayed');
unlike ($output, qr/$month\S*?\s+?$year/, 'Current month and year are not displayed');
$output = qx{../task rc:cal.rc rc.calendar.offset:on rc.calendar.offset.value:12 rc.monthsperline:1 cal};
$output = qx{../src/task rc:cal.rc rc.calendar.offset:on rc.calendar.offset.value:12 rc.monthsperline:1 cal};
unlike ($output, qr/$month\S*?\s+?$year/, 'Current month and year are not displayed');
like ($output, qr/$month\S*?\s+?$nextyear/, 'Current month and year ahead are displayed');
@ -189,19 +189,19 @@ if (open my $fh, '>', 'details.rc')
}
# task calendar details
qx{../task rc:details.rc add due:20150105 one};
qx{../task rc:details.rc add due:20150110 two};
qx{../task rc:details.rc add due:20150210 three};
qx{../task rc:details.rc add due:20150410 four};
qx{../task rc:details.rc add due:20151225 five};
qx{../task rc:details.rc add due:20141231 six};
qx{../task rc:details.rc add due:20160101 seven};
qx{../task rc:details.rc add due:20081231 eight};
qx{../src/task rc:details.rc add due:20150105 one};
qx{../src/task rc:details.rc add due:20150110 two};
qx{../src/task rc:details.rc add due:20150210 three};
qx{../src/task rc:details.rc add due:20150410 four};
qx{../src/task rc:details.rc add due:20151225 five};
qx{../src/task rc:details.rc add due:20141231 six};
qx{../src/task rc:details.rc add due:20160101 seven};
qx{../src/task rc:details.rc add due:20081231 eight};
$output = qx{../task rc:details.rc rc.calendar.legend:no cal};
$output = qx{../src/task rc:details.rc rc.calendar.legend:no cal};
unlike ($output, qr/Legend:/, 'Legend is not displayed');
$output = qx{../task rc:details.rc cal rc.monthsperline:3 1 2015};
$output = qx{../src/task rc:details.rc cal rc.monthsperline:3 1 2015};
like ($output, qr/January 2015/, 'January 2015 is displayed');
like ($output, qr/20150105/, 'Due date 20150105 is displayed');
like ($output, qr/20150110/, 'Due date 20150110 is displayed');
@ -210,12 +210,12 @@ unlike ($output, qr/20141231/, 'Due date 20141231 is not displayed');
unlike ($output, qr/20150410/, 'Due date 20150410 is not displayed');
like ($output, qr/3 tasks/, '3 due tasks are displayed');
$output = qx{../task rc:details.rc cal due};
$output = qx{../src/task rc:details.rc cal due};
like ($output, qr/December 2008/, 'December 2008 is displayed');
like ($output, qr/20081231/, 'Due date 20081231 is displayed');
like ($output, qr/1 task/, '1 due task is displayed');
$output = qx{../task rc:details.rc cal 2015};
$output = qx{../src/task rc:details.rc cal 2015};
like ($output, qr/January 2015/, 'January 2015 is displayed');
like ($output, qr/December 2015/, 'December 2015 is displayed');
unlike ($output, qr/20141231/, 'Due date 20141231 is not displayed');
@ -234,13 +234,13 @@ if ( $mon <= 9)
}
my $duedate = $year.$mon.$day;
qx{../task rc:details.rc add due:$duedate rc.monthsperline:1 nine};
$output = qx{../task rc:details.rc cal};
qx{../src/task rc:details.rc add due:$duedate rc.monthsperline:1 nine};
$output = qx{../src/task rc:details.rc cal};
like ($output, qr/$month\S*?\s+?$year/, 'Current month and year are displayed');
like ($output, qr/$duedate/, 'Due date on current day is displayed');
like ($output, qr/1 task/, '1 due task is displayed');
$output = qx{../task rc:details.rc cal rc.monthsperline:1 1 2015};
$output = qx{../src/task rc:details.rc cal rc.monthsperline:1 1 2015};
like ($output, qr/Date/, 'Word Date is displayed');
like ($output, qr/Holiday/, 'Word Holiday is displayed');
like ($output, qr/20150101/, 'Holiday 20150101 is displayed');
@ -250,7 +250,7 @@ like ($output, qr/AAAA/, 'Holiday name AAAA is displayed');
like ($output, qr/BBBBBB/, 'Holiday name BBBBBB is displayed');
like ($output, qr/åäö/, 'Holiday name åäö is displayed');
$output = qx{../task rc:details.rc cal rc._forcecolor:on rc.monthsperline:1 rc.calendar.details:sparse rc.calendar.holidays:sparse 1 2015};
$output = qx{../src/task rc:details.rc cal rc._forcecolor:on rc.monthsperline:1 rc.calendar.details:sparse rc.calendar.holidays:sparse 1 2015};
unlike ($output, qr/Date/, 'Word Date is not displayed');
unlike ($output, qr/Holiday/, 'Word Holiday is not displayed');
like ($output, qr/30;103m 1/, 'Holiday AAAA is color-coded');

View file

@ -39,84 +39,84 @@ if (open my $fh, '>', 'caseless.rc')
}
# Attempt case-sensitive and case-insensitive substitutions and filters.
qx{../task rc:caseless.rc add one two three};
qx{../task rc:caseless.rc 1 annotate four five six};
qx{../src/task rc:caseless.rc add one two three};
qx{../src/task rc:caseless.rc 1 annotate four five six};
my $output;
# Description substitution.
# 2
qx{../task rc:caseless.rc rc.search.case.sensitive:yes 1 /One/ONE/};
$output = qx{../task rc:caseless.rc info 1};
qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes 1 /One/ONE/};
$output = qx{../src/task rc:caseless.rc info 1};
unlike ($output, qr/One two three/, 'one two three\nfour five six -> /One/ONE/ = fail');
# 3
qx{../task rc:caseless.rc rc.search.case.sensitive:no 1 /One/ONE/};
$output = qx{../task rc:caseless.rc info 1};
qx{../src/task rc:caseless.rc rc.search.case.sensitive:no 1 /One/ONE/};
$output = qx{../src/task rc:caseless.rc info 1};
like ($output, qr/ONE two three/, 'one two three\nfour five six -> /One/ONE/ = caseless succeed');
# 4
qx{../task rc:caseless.rc rc.search.case.sensitive:yes 1 /one/One/};
$output = qx{../task rc:caseless.rc info 1};
qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes 1 /one/One/};
$output = qx{../src/task rc:caseless.rc info 1};
unlike ($output, qr/One two three/, 'ONE two three\nfour five six -> /one/ONE/ = fail');
# 5
qx{../task rc:caseless.rc rc.search.case.sensitive:no 1 /one/one/};
$output = qx{../task rc:caseless.rc info 1};
qx{../src/task rc:caseless.rc rc.search.case.sensitive:no 1 /one/one/};
$output = qx{../src/task rc:caseless.rc info 1};
like ($output, qr/one two three/, 'ONE two three\nfour five six -> /one/one/ = caseless succeed');
# Annotation substitution.
# 6
qx{../task rc:caseless.rc rc.search.case.sensitive:yes 1 /Five/FIVE/};
$output = qx{../task rc:caseless.rc info 1};
qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes 1 /Five/FIVE/};
$output = qx{../src/task rc:caseless.rc info 1};
unlike ($output, qr/four FIVE six/, 'one two three\nfour five six -> /Five/FIVE/ = fail');
# 7
qx{../task rc:caseless.rc rc.search.case.sensitive:no 1 /Five/FIVE/};
$output = qx{../task rc:caseless.rc info 1};
qx{../src/task rc:caseless.rc rc.search.case.sensitive:no 1 /Five/FIVE/};
$output = qx{../src/task rc:caseless.rc info 1};
like ($output, qr/four FIVE six/, 'one two three\nfour five six -> /Five/FIVE/ = caseless succeed');
# 8
qx{../task rc:caseless.rc rc.search.case.sensitive:yes 1 /five/Five/};
$output = qx{../task rc:caseless.rc info 1};
qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes 1 /five/Five/};
$output = qx{../src/task rc:caseless.rc info 1};
unlike ($output, qr/four Five six/, 'one two three\nfour FIVE six -> /five/Five/ = fail');
# 9
qx{../task rc:caseless.rc rc.search.case.sensitive:no 1 /five/five/};
$output = qx{../task rc:caseless.rc info 1};
qx{../src/task rc:caseless.rc rc.search.case.sensitive:no 1 /five/five/};
$output = qx{../src/task rc:caseless.rc info 1};
like ($output, qr/four five six/, 'one two three\nfour FIVE six -> /five/five/ = caseless succeed');
# Description filter.
# 10
$output = qx{../task rc:caseless.rc rc.search.case.sensitive:yes ls One};
$output = qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes ls One};
unlike ($output, qr/one two three/, 'one two three\nfour five six -> ls One = fail');
# 11
$output = qx{../task rc:caseless.rc rc.search.case.sensitive:no ls One};
$output = qx{../src/task rc:caseless.rc rc.search.case.sensitive:no ls One};
like ($output, qr/one two three/, 'one two three\nfour five six -> ls One caseless = succeed');
# 12
$output = qx{../task rc:caseless.rc rc.search.case.sensitive:yes ls Five};
$output = qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes ls Five};
unlike ($output, qr/four five six/, 'one two three\nfour five six -> ls Five = fail');
# 13
$output = qx{../task rc:caseless.rc rc.search.case.sensitive:no ls Five};
$output = qx{../src/task rc:caseless.rc rc.search.case.sensitive:no ls Five};
like ($output, qr/four five six/, 'one two three\nfour five six -> ls Five caseless = succeed');
# Annotation filter.
# 14
$output = qx{../task rc:caseless.rc rc.search.case.sensitive:yes ls description.contains:Three};
$output = qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes ls description.contains:Three};
unlike ($output, qr/one two three/, 'one two three\nfour five six -> ls description.contains:Three = fail');
# 15
$output = qx{../task rc:caseless.rc rc.search.case.sensitive:no ls description.contains:Three};
$output = qx{../src/task rc:caseless.rc rc.search.case.sensitive:no ls description.contains:Three};
like ($output, qr/one two three/, 'one two three\nfour five six -> ls description.contains:Three caseless = succeed');
# 16
$output = qx{../task rc:caseless.rc rc.search.case.sensitive:yes ls description.contains:Six};
$output = qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes ls description.contains:Six};
unlike ($output, qr/four five six/, 'one two three\nfour five six -> ls description.contains:Six = fail');
# 17
$output = qx{../task rc:caseless.rc rc.search.case.sensitive:no ls description.contains:Six};
$output = qx{../src/task rc:caseless.rc rc.search.case.sensitive:no ls description.contains:Six};
like ($output, qr/four five six/, 'one two three\nfour five six -> ls description.contains:Six caseless = succeed');
# Cleanup.

View file

@ -41,10 +41,10 @@ if (open my $fh, '>', 'color.rc')
}
# Test the add command.
qx{../task rc:color.rc add nothing};
qx{../task rc:color.rc add red};
qx{../task rc:color.rc start 2};
my $output = qx{../task rc:color.rc list};
qx{../src/task rc:color.rc add nothing};
qx{../src/task rc:color.rc add red};
qx{../src/task rc:color.rc start 2};
my $output = qx{../src/task rc:color.rc list};
like ($output, qr/ (?!<\033\[\d\dm) .* nothing .* (?!>\033\[0m) /x, 'none');
like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.active');

View file

@ -42,10 +42,10 @@ if (open my $fh, '>', 'color.rc')
}
# Test the add command.
qx{../task rc:color.rc add red};
qx{../task rc:color.rc add nothing};
qx{../task rc:color.rc 1 depends:2};
my $output = qx{../task rc:color.rc list};
qx{../src/task rc:color.rc add red};
qx{../src/task rc:color.rc add nothing};
qx{../src/task rc:color.rc 1 depends:2};
my $output = qx{../src/task rc:color.rc list};
like ($output, qr/ (?!<\033\[\d\dm) .* nothing .* (?!>\033\[0m) /x, 'none');
like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.blocked');

View file

@ -41,7 +41,7 @@ if (open my $fh, '>', 'color.rc')
}
# Test the add command.
my $output = qx{../task rc:color.rc show};
my $output = qx{../src/task rc:color.rc show};
like ($output, qr/that use deprecated underscores/ms, 'Deprecated color detected');
# Cleanup.

View file

@ -40,8 +40,8 @@ if (open my $fh, '>', 'color.rc')
}
# Test the add command.
qx{../task rc:color.rc add priority:H red};
my $output = qx{../task rc:color.rc list};
qx{../src/task rc:color.rc add priority:H red};
my $output = qx{../src/task rc:color.rc list};
like ($output, qr/red/, 'color.disable - found red');
unlike ($output, qr/\033\[31m/, 'color.disable - no color red');

View file

@ -41,9 +41,9 @@ if (open my $fh, '>', 'color.rc')
}
# Test the add command.
qx{../task rc:color.rc add due:12/31/2037 nothing};
qx{../task rc:color.rc add due:tomorrow red};
my $output = qx{../task rc:color.rc list};
qx{../src/task rc:color.rc add due:12/31/2037 nothing};
qx{../src/task rc:color.rc add due:tomorrow red};
my $output = qx{../src/task rc:color.rc list};
like ($output, qr/ (?!<\033\[\d\dm) \d{1,2}\/\d{1,2}\/\d{4} (?!>\033\[0m) .* nothing /x, 'none');
like ($output, qr/ \033\[31m .* red .* \033\[0m/x, 'color.due');

View file

@ -41,9 +41,9 @@ if (open my $fh, '>', 'color.rc')
}
# Test the add command.
qx{../task rc:color.rc add due:12/31/2037 nothing};
qx{../task rc:color.rc add due:1hr red};
my $output = qx{../task rc:color.rc list};
qx{../src/task rc:color.rc add due:12/31/2037 nothing};
qx{../src/task rc:color.rc add due:1hr red};
my $output = qx{../src/task rc:color.rc list};
like ($output, qr/ (?!<\033\[\d\dm) \d{1,2}\/\d{1,2}\/\d{4} (?!>\033\[0m) .* nothing /x, 'none');
like ($output, qr/ (?:\033\[31m|\033\[38;5;9m) .* red .* \033\[0m/x, 'color.due.today');

View file

@ -46,12 +46,12 @@ if (open my $fh, '>', 'color.rc')
}
# Test the add command.
qx{../task rc:color.rc add nothing};
qx{../task rc:color.rc add red};
qx{../task rc:color.rc add green};
qx{../task rc:color.rc add -- annotation};
qx{../task rc:color.rc 4 annotate yellow};
my $output = qx{../task rc:color.rc list};
qx{../src/task rc:color.rc add nothing};
qx{../src/task rc:color.rc add red};
qx{../src/task rc:color.rc add green};
qx{../src/task rc:color.rc add -- annotation};
qx{../src/task rc:color.rc 4 annotate yellow};
my $output = qx{../src/task rc:color.rc list};
like ($output, qr/ (?!<\033\[\d\dm) .* nothing .* (?!>\033\[0m) /x, 'none');
like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.keyword.red');

View file

@ -41,9 +41,9 @@ if (open my $fh, '>', 'color.rc')
}
# Test the add command.
qx{../task rc:color.rc add due:tomorrow nothing};
qx{../task rc:color.rc add due:yesterday red};
my $output = qx{../task rc:color.rc list};
qx{../src/task rc:color.rc add due:tomorrow nothing};
qx{../src/task rc:color.rc add due:yesterday red};
my $output = qx{../src/task rc:color.rc list};
like ($output, qr/ (?!<\033\[\d\dm) \d{1,2}\/\d{1,2}\/\d{4} (?!>\033\[0m) .* nothing /x, 'none');
like ($output, qr/ \033\[31m .* red .* \033\[0m/x, 'color.overdue');

View file

@ -45,11 +45,11 @@ if (open my $fh, '>', 'color.rc')
}
# Test the add command.
qx{../task rc:color.rc add priority:H red};
qx{../task rc:color.rc add priority:M green};
qx{../task rc:color.rc add priority:L blue};
qx{../task rc:color.rc add yellow};
my $output = qx{../task rc:color.rc list};
qx{../src/task rc:color.rc add priority:H red};
qx{../src/task rc:color.rc add priority:M green};
qx{../src/task rc:color.rc add priority:L blue};
qx{../src/task rc:color.rc add yellow};
my $output = qx{../src/task rc:color.rc list};
like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.pri.H');
like ($output, qr/ \033\[32m .* green .* \033\[0m /x, 'color.pri.M');

View file

@ -43,9 +43,9 @@ if (open my $fh, '>', 'color.rc')
}
# Test the add command.
qx{../task rc:color.rc add nothing};
qx{../task rc:color.rc add project:x red};
my $output = qx{../task rc:color.rc list};
qx{../src/task rc:color.rc add nothing};
qx{../src/task rc:color.rc add project:x red};
my $output = qx{../src/task rc:color.rc list};
like ($output, qr/ \033\[32m .* nothing .* \033\[0m /x, 'color.project.none');
like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.project.red');

View file

@ -42,9 +42,9 @@ if (open my $fh, '>', 'color.rc')
}
# Test the add command.
qx{../task rc:color.rc add nothing};
qx{../task rc:color.rc add due:tomorrow recur:1w red};
my $output = qx{../task rc:color.rc list};
qx{../src/task rc:color.rc add nothing};
qx{../src/task rc:color.rc add due:tomorrow recur:1w red};
my $output = qx{../src/task rc:color.rc list};
like ($output, qr/ (?!<\033\[\d\dm) .* nothing .* (?!>\033\[0m) /x, 'none');
like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.recurring');

View file

@ -45,10 +45,10 @@ if (open my $fh, '>', 'color.rc')
}
# Test the add command.
qx{../task rc:color.rc add nothing};
qx{../task rc:color.rc add +red red};
qx{../task rc:color.rc add +green green};
my $output = qx{../task rc:color.rc list};
qx{../src/task rc:color.rc add nothing};
qx{../src/task rc:color.rc add +red red};
qx{../src/task rc:color.rc add +green green};
my $output = qx{../src/task rc:color.rc list};
like ($output, qr/ \033\[33m .* nothing .* \033\[0m /x, 'color.tag.none');
like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.tag.red');

View file

@ -45,9 +45,9 @@ if (open my $fh, '>', 'color.rc')
}
# Test the add command.
qx{../task rc:color.rc add nothing};
qx{../task rc:color.rc add +tag red};
my $output = qx{../task rc:color.rc list};
qx{../src/task rc:color.rc add nothing};
qx{../src/task rc:color.rc add +tag red};
my $output = qx{../src/task rc:color.rc list};
like ($output, qr/ (?!<\033\[\d\dm) .* nothing .* (?!>\033\[0m) /x, 'none');
like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.tagged');

View file

@ -40,13 +40,13 @@ if (open my $fh, '>', 'completed.rc')
}
# Add two tasks, mark 1 as done, the other as deleted.
qx{../task rc:completed.rc add one};
qx{../task rc:completed.rc add two};
qx{../task rc:completed.rc 1 done};
qx{../task rc:completed.rc 2 delete};
qx{../src/task rc:completed.rc add one};
qx{../src/task rc:completed.rc add two};
qx{../src/task rc:completed.rc 1 done};
qx{../src/task rc:completed.rc 2 delete};
# Generate completed report.
my $output = qx{../task rc:completed.rc completed};
my $output = qx{../src/task rc:completed.rc completed};
like ($output, qr/one/, 'one -> completed');
unlike ($output, qr/two/, 'two -> deleted');

View file

@ -40,7 +40,7 @@ if (open my $fh, '>', 'obsolete.rc')
}
# Test the add command.
my $output = qx{../task rc:obsolete.rc show};
my $output = qx{../src/task rc:obsolete.rc show};
like ($output, qr/Your .taskrc file contains these unrecognized variables:\n/,
'unsupported configuration variable');

View file

@ -47,52 +47,52 @@ if (open my $fh, '>', 'response.txt')
ok (-r 'response.txt', 'Created response.txt');
}
qx{../task rc:confirm.rc add foo} for 1..10;
qx{../src/task rc:confirm.rc add foo} for 1..10;
# Test the various forms of "Yes".
my $output = qx{echo "Yes" | ../task rc:confirm.rc del 1};
my $output = qx{echo "Yes" | ../src/task rc:confirm.rc del 1};
like ($output, qr/Permanently delete task 1 'foo'\? \(y\/n\)/, 'confirmation - Yes works');
unlike ($output, qr/Task not deleted\./, 'confirmation - Yes works');
$output = qx{echo "ye" | ../task rc:confirm.rc del 2};
$output = qx{echo "ye" | ../src/task rc:confirm.rc del 2};
like ($output, qr/Permanently delete task 2 'foo'\? \(y\/n\)/, 'confirmation - ye works');
unlike ($output, qr/Task not deleted\./, 'confirmation - ye works');
$output = qx{echo "y" | ../task rc:confirm.rc del 3};
$output = qx{echo "y" | ../src/task rc:confirm.rc del 3};
like ($output, qr/Permanently delete task 3 'foo'\? \(y\/n\)/, 'confirmation - y works');
unlike ($output, qr/Task not deleted\./, 'confirmation - y works');
$output = qx{echo "YES" | ../task rc:confirm.rc del 4};
$output = qx{echo "YES" | ../src/task rc:confirm.rc del 4};
like ($output, qr/Permanently delete task 4 'foo'\? \(y\/n\)/, 'confirmation - YES works');
unlike ($output, qr/Task not deleted\./, 'confirmation - YES works');
$output = qx{echo "YE" | ../task rc:confirm.rc del 5};
$output = qx{echo "YE" | ../src/task rc:confirm.rc del 5};
like ($output, qr/Permanently delete task 5 'foo'\? \(y\/n\)/, 'confirmation - YE works');
unlike ($output, qr/Task not deleted\./, 'confirmation - YE works');
$output = qx{echo "Y" | ../task rc:confirm.rc del 6};
$output = qx{echo "Y" | ../src/task rc:confirm.rc del 6};
like ($output, qr/Permanently delete task 6 'foo'\? \(y\/n\)/, 'confirmation - Y works');
unlike ($output, qr/Task not deleted\./, 'confirmation - Y works');
# Test the various forms of "no".
$output = qx{echo "no" | ../task rc:confirm.rc del 7};
$output = qx{echo "no" | ../src/task rc:confirm.rc del 7};
like ($output, qr/Permanently delete task 7 'foo'\? \(y\/n\)/, 'confirmation - no works');
like ($output, qr/Task not deleted\./, 'confirmation - no works');
$output = qx{echo "n" | ../task rc:confirm.rc del 7};
$output = qx{echo "n" | ../src/task rc:confirm.rc del 7};
like ($output, qr/Permanently delete task 7 'foo'\? \(y\/n\)/, 'confirmation - n works');
like ($output, qr/Task not deleted\./, 'confirmation - n works');
$output = qx{echo "NO" | ../task rc:confirm.rc del 7};
$output = qx{echo "NO" | ../src/task rc:confirm.rc del 7};
like ($output, qr/Permanently delete task 7 'foo'\? \(y\/n\)/, 'confirmation - NO works');
like ($output, qr/Task not deleted\./, 'confirmation - NO works');
$output = qx{echo "N" | ../task rc:confirm.rc del 7};
$output = qx{echo "N" | ../src/task rc:confirm.rc del 7};
like ($output, qr/Permanently delete task 7 'foo'\? \(y\/n\)/, 'confirmation - N works');
like ($output, qr/Task not deleted\./, 'confirmation - N works');
# Test Yes for multiple changes
$output = qx{echo -e "y\nY\nY\nY\nY" | ../task rc:confirm.rc 7-10 +bar};
$output = qx{echo -e "y\nY\nY\nY\nY" | ../src/task rc:confirm.rc 7-10 +bar};
like ($output, qr/Proceed with change\? \(Yes\/no\/All\/quit\)/, 'multiple confirmations - Y works');
like ($output, qr/Task 7 "foo"/, 'multiple confirmations - Y works');
like ($output, qr/Task 8 "foo"/, 'multiple confirmations - Y works');
@ -101,7 +101,7 @@ like ($output, qr/Task 10 "foo"/, 'multiple confirmations - Y works');
like ($output, qr/Modified 4 tasks/, 'multiple confirmations - Y works');
# Test no for multiple changes
$output = qx{echo -e "N\nn\nn\nn\nn" | ../task rc:confirm.rc 7-10 -bar};
$output = qx{echo -e "N\nn\nn\nn\nn" | ../src/task rc:confirm.rc 7-10 -bar};
like ($output, qr/Proceed with change\? \(Yes\/no\/All\/quit\)/, 'multiple confirmations - n works');
like ($output, qr/Task 7 "foo"/, 'multiple confirmations - n works');
like ($output, qr/Task 8 "foo"/, 'multiple confirmations - n works');
@ -110,21 +110,21 @@ like ($output, qr/Task 10 "foo"/, 'multiple confirmations - n works');
like ($output, qr/Modified 0 tasks/, 'multiple confirmations - n works');
# Test All for multiple changes
$output = qx{echo -e "a\nA" | ../task rc:confirm.rc 7-10 -bar};
$output = qx{echo -e "a\nA" | ../src/task rc:confirm.rc 7-10 -bar};
like ($output, qr/Proceed with change\? \(Yes\/no\/All\/quit\)/, 'multiple confirmations - A works');
like ($output, qr/Task 7 "foo"/, 'multiple confirmations - A works');
unlike ($output, qr/Task 8 "foo"/, 'multiple confirmations - A works');
like ($output, qr/Modified 4 tasks/, 'multiple confirmations - A works');
# Test quit for multiple changes
$output = qx{echo "q" | ../task rc:confirm.rc 7-10 +bar};
$output = qx{echo "q" | ../src/task rc:confirm.rc 7-10 +bar};
like ($output, qr/Proceed with change\? \(Yes\/no\/All\/quit\)/, 'multiple confirmations - q works');
like ($output, qr/Task 7 "foo"/, 'multiple confirmations - q works');
unlike ($output, qr/Task 8 "foo"/, 'multiple confirmations - q works');
like ($output, qr/Modified 0 tasks/, 'multiple confirmations - q works');
# Test newlines.
$output = qx{cat response.txt | ../task rc:confirm.rc del 7};
$output = qx{cat response.txt | ../src/task rc:confirm.rc del 7};
like ($output, qr/(Permanently delete task 7 'foo'\? \(y\/n\)) \1 \1/, 'confirmation - \n re-prompt works');
# Cleanup.

View file

@ -40,26 +40,26 @@ if (open my $fh, '>', 'count.rc')
}
# Test the count command.
qx{../task rc:count.rc add one};
qx{../task rc:count.rc log two};
qx{../task rc:count.rc add three};
qx{../task rc:count.rc delete 3};
qx{../task rc:count.rc add four wait:eom};
qx{../task rc:count.rc add five due:eom recur:monthly};
qx{../src/task rc:count.rc add one};
qx{../src/task rc:count.rc log two};
qx{../src/task rc:count.rc add three};
qx{../src/task rc:count.rc delete 3};
qx{../src/task rc:count.rc add four wait:eom};
qx{../src/task rc:count.rc add five due:eom recur:monthly};
my $output = qx{../task rc:count.rc count};
my $output = qx{../src/task rc:count.rc count};
like ($output, qr/^5$/ms, 'count');
$output = qx{../task rc:count.rc count status:deleted};
$output = qx{../src/task rc:count.rc count status:deleted};
like ($output, qr/^1$/ms, 'count status:deleted');
$output = qx{../task rc:count.rc count e};
$output = qx{../src/task rc:count.rc count e};
like ($output, qr/^3$/ms, 'count e');
$output = qx{../task rc:count.rc count description.startswith:f};
$output = qx{../src/task rc:count.rc count description.startswith:f};
like ($output, qr/^2$/ms, 'count description.startswith:f');
$output = qx{../task rc:count.rc count due.any:};
$output = qx{../src/task rc:count.rc count due.any:};
like ($output, qr/^1$/ms, 'count due.any:');
# Cleanup.

View file

@ -64,29 +64,29 @@ if (open my $fh, '>', 'countdown.rc')
# Create a variety of pending tasks with increasingly higher due dates
# to ensure proper sort order.
qx{../task rc:countdown.rc add one due:-1.2y};
qx{../task rc:countdown.rc add two due:-9mo};
qx{../task rc:countdown.rc add three due:-2mo};
qx{../task rc:countdown.rc add four due:-3wk};
qx{../task rc:countdown.rc add five due:-7d};
qx{../task rc:countdown.rc add six due:-2d};
qx{../task rc:countdown.rc add seven due:-1d};
qx{../task rc:countdown.rc add eight due:-12h};
qx{../task rc:countdown.rc add nine due:-6h};
qx{../task rc:countdown.rc add ten due:-1h};
qx{../task rc:countdown.rc add eleven due:-30s};
qx{../task rc:countdown.rc add twelve due:1h};
qx{../task rc:countdown.rc add thirteen due:6h};
qx{../task rc:countdown.rc add fourteen due:12h};
qx{../task rc:countdown.rc add fifteen due:1d};
qx{../task rc:countdown.rc add sixteen due:2d};
qx{../task rc:countdown.rc add seventeen due:7d};
qx{../task rc:countdown.rc add eighteen due:3wk};
qx{../task rc:countdown.rc add nineteen due:2mo};
qx{../task rc:countdown.rc add twenty due:9mo};
qx{../task rc:countdown.rc add twentyone due:1.2y};
qx{../src/task rc:countdown.rc add one due:-1.2y};
qx{../src/task rc:countdown.rc add two due:-9mo};
qx{../src/task rc:countdown.rc add three due:-2mo};
qx{../src/task rc:countdown.rc add four due:-3wk};
qx{../src/task rc:countdown.rc add five due:-7d};
qx{../src/task rc:countdown.rc add six due:-2d};
qx{../src/task rc:countdown.rc add seven due:-1d};
qx{../src/task rc:countdown.rc add eight due:-12h};
qx{../src/task rc:countdown.rc add nine due:-6h};
qx{../src/task rc:countdown.rc add ten due:-1h};
qx{../src/task rc:countdown.rc add eleven due:-30s};
qx{../src/task rc:countdown.rc add twelve due:1h};
qx{../src/task rc:countdown.rc add thirteen due:6h};
qx{../src/task rc:countdown.rc add fourteen due:12h};
qx{../src/task rc:countdown.rc add fifteen due:1d};
qx{../src/task rc:countdown.rc add sixteen due:2d};
qx{../src/task rc:countdown.rc add seventeen due:7d};
qx{../src/task rc:countdown.rc add eighteen due:3wk};
qx{../src/task rc:countdown.rc add nineteen due:2mo};
qx{../src/task rc:countdown.rc add twenty due:9mo};
qx{../src/task rc:countdown.rc add twentyone due:1.2y};
my $output = qx{../task rc:countdown.rc up};
my $output = qx{../src/task rc:countdown.rc up};
like ($output, qr/\bone\b.+\btwo\b/ms, 'up: one < two');
like ($output, qr/\btwo\b.+\bthree/ms, 'up: two < three');
like ($output, qr/\bthree\b.+\bfour/ms, 'up: three < four');
@ -108,7 +108,7 @@ like ($output, qr/\beighteen\b.+\bnineteen/ms, 'up: eighteen < nineteen');
like ($output, qr/\bnineteen\b.+\btwenty/ms, 'up: nineteen < twenty');
like ($output, qr/\btwenty\b.+\btwentyone/ms, 'up: twenty < twentyone');
$output = qx{../task rc:countdown.rc down};
$output = qx{../src/task rc:countdown.rc down};
like ($output, qr/\btwentyone\b.+\btwenty/ms, 'down: twentyone < twenty');
like ($output, qr/\btwenty\b.+\bnineteen/ms, 'down: twenty < nineteen');
like ($output, qr/\bnineteen\b.+\beighteen/ms, 'down: nineteen < eighteen');
@ -130,7 +130,7 @@ like ($output, qr/\bfour\b.+\bthree/ms, 'down: four < three');
like ($output, qr/\bthree\b.+\btwo/ms, 'down: three < two');
like ($output, qr/\btwo\b.+\bone\b/ms, 'down: two < one');
$output = qx{../task rc:countdown.rc upc};
$output = qx{../src/task rc:countdown.rc upc};
like ($output, qr/\bone\b.+\btwo\b/ms, 'upc: one < two');
like ($output, qr/\btwo\b.+\bthree/ms, 'upc: two < three');
like ($output, qr/\bthree\b.+\bfour/ms, 'upc: three < four');
@ -152,7 +152,7 @@ like ($output, qr/\beighteen\b.+\bnineteen/ms, 'upc: eighteen < nineteen');
like ($output, qr/\bnineteen\b.+\btwenty/ms, 'upc: nineteen < twenty');
like ($output, qr/\btwenty\b.+\btwentyone/ms, 'upc: twenty < twentyone');
$output = qx{../task rc:countdown.rc downc};
$output = qx{../src/task rc:countdown.rc downc};
like ($output, qr/\btwentyone\b.+\btwenty/ms, 'downc: twentyone < twenty');
like ($output, qr/\btwenty\b.+\bnineteen/ms, 'downc: twenty < nineteen');
like ($output, qr/\bnineteen\b.+\beighteen/ms, 'downc: nineteen < eighteen');

View file

@ -43,7 +43,7 @@ if (open my $fh, '>', 'custom.rc')
}
# Generate the usage screen, and locate the custom report on it.
my $output = qx{../task rc:custom.rc foo 2>&1};
my $output = qx{../src/task rc:custom.rc foo 2>&1};
like ($output, qr/Unrecognized column name: foo\.\n/, 'custom report spotted invalid column');
# Cleanup.

View file

@ -43,12 +43,12 @@ if (open my $fh, '>', 'pri.rc')
}
# Generate the usage screen, and locate the custom report on it.
qx{../task rc:pri.rc add one pri:H};
qx{../task rc:pri.rc add two pri:M};
qx{../task rc:pri.rc add three pri:L};
qx{../task rc:pri.rc add four pri:};
qx{../src/task rc:pri.rc add one pri:H};
qx{../src/task rc:pri.rc add two pri:M};
qx{../src/task rc:pri.rc add three pri:L};
qx{../src/task rc:pri.rc add four pri:};
my $output = qx{../task rc:pri.rc foo 2>&1};
my $output = qx{../src/task rc:pri.rc foo 2>&1};
like ($output, qr/ID P/, 'priority_long indicator heading');
like ($output, qr/1\s+High/, 'priority_long High');
like ($output, qr/2\s+Medium/, 'priority_long Medium');

View file

@ -43,14 +43,14 @@ if (open my $fh, '>', 'custom.rc')
}
# Add a recurring and non-recurring task, look for the indicator.
qx{../task rc:custom.rc add foo due:tomorrow recur:weekly};
qx{../task rc:custom.rc add bar};
my $output = qx{../task rc:custom.rc foo 2>&1};
qx{../src/task rc:custom.rc add foo due:tomorrow recur:weekly};
qx{../src/task rc:custom.rc add bar};
my $output = qx{../src/task rc:custom.rc foo 2>&1};
like ($output, qr/ID R/, 'Recurrence indicator heading');
like ($output, qr/2\s+R/, 'Recurrence indicator t1');
unlike ($output, qr/1\s+R/, 'No recurrence indicator t2');
$output = qx{../task rc:custom.rc foo rc.recurrence.indicator=RE 2>&1};
$output = qx{../src/task rc:custom.rc foo rc.recurrence.indicator=RE 2>&1};
like ($output, qr/2\s+RE/, 'Custom recurrence indicator t1');
unlike ($output, qr/1\s+RE/, 'No custom recurrence indicator t2');

View file

@ -43,12 +43,12 @@ if (open my $fh, '>', 'custom.rc')
}
# Generate the usage screen, and locate the custom report on it.
my $output = qx{../task rc:custom.rc usage};
my $output = qx{../src/task rc:custom.rc usage};
like ($output, qr/task foo \[tags\] \[attrs\] desc\.\.\.\s+DESC\n/m, 'report.foo');
qx{../task rc:custom.rc add project:A one};
qx{../task rc:custom.rc add two};
$output = qx{../task rc:custom.rc foo};
qx{../src/task rc:custom.rc add project:A one};
qx{../src/task rc:custom.rc add two};
$output = qx{../src/task rc:custom.rc foo};
like ($output, qr/one/, 'custom filter included');
unlike ($output, qr/two/, 'custom filter excluded');

View file

@ -43,14 +43,14 @@ if (open my $fh, '>', 'custom.rc')
}
# Generate the usage screen, and locate the custom report on it.
qx{../task rc:custom.rc add foo +tag};
qx{../task rc:custom.rc add bar};
my $output = qx{../task rc:custom.rc foo 2>&1};
qx{../src/task rc:custom.rc add foo +tag};
qx{../src/task rc:custom.rc add bar};
my $output = qx{../src/task rc:custom.rc foo 2>&1};
like ($output, qr/ID T/, 'Tag indicator heading');
like ($output, qr/1\s+\+/, 'Tag indicator t1');
unlike ($output, qr/2\s+\+/, 'No tag indicator t2');
$output = qx{../task rc:custom.rc foo rc.tag.indicator=TAG 2>&1};
$output = qx{../src/task rc:custom.rc foo rc.tag.indicator=TAG 2>&1};
like ($output, qr/1\s+TAG/, 'Custom ag indicator t1');
unlike ($output, qr/2\s+TAG/, 'No custom tag indicator t2');

View file

@ -60,24 +60,24 @@ if (open my $fh, '>', 'date3.rc')
ok (-r 'date3.rc', 'Created date3.rc');
}
qx{../task rc:date1.rc add foo due:20091231};
my $output = qx{../task rc:date1.rc info 1};
qx{../src/task rc:date1.rc add foo due:20091231};
my $output = qx{../src/task rc:date1.rc info 1};
like ($output, qr/\b20091231\b/, 'date format YMD parsed');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
qx{../task rc:date2.rc add foo due:12/1/09};
$output = qx{../task rc:date2.rc info 1};
qx{../src/task rc:date2.rc add foo due:12/1/09};
$output = qx{../src/task rc:date2.rc info 1};
like ($output, qr/\b12\/1\/09\b/, 'date format m/d/y parsed');
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
qx{../task rc:date3.rc add foo due:4/8/10};
$output = qx{../task rc:date3.rc list};
qx{../src/task rc:date3.rc add foo due:4/8/10};
$output = qx{../src/task rc:date3.rc list};
like ($output, qr/Thursday 08 April 2010 \(v14\)/, 'date format A D B Y (vV) parsed');
$output = qx{../task rc:date3.rc rc.dateformat.report:"D b Y - a" list};
$output = qx{../src/task rc:date3.rc rc.dateformat.report:"D b Y - a" list};
like ($output, qr/08 Apr 2010 - Thu/, 'date format D b Y - a parsed');
# Cleanup.

View file

@ -46,14 +46,14 @@ if (open my $fh, '>', 'datesort.rc')
ok (-r 'datesort.rc', 'Created datesort.rc');
}
qx{../task rc:datesort.rc add two due:20100201};
qx{../task rc:datesort.rc add one due:20100101};
qx{../task rc:datesort.rc add three due:20100301};
qx{../src/task rc:datesort.rc add two due:20100201};
qx{../src/task rc:datesort.rc add one due:20100101};
qx{../src/task rc:datesort.rc add three due:20100301};
my $output = qx{../task rc:datesort.rc small_list};
my $output = qx{../src/task rc:datesort.rc small_list};
like ($output, qr/one.+two.+three/ms, 'Sorting by due+ with format MD works');
$output = qx{../task rc:datesort.rc rc.report.small_list.sort=due- small_list};
$output = qx{../src/task rc:datesort.rc rc.report.small_list.sort=due- small_list};
like ($output, qr/three.+two.+one/ms, 'Sorting by due- with format MD works');
# Cleanup.

View file

@ -43,38 +43,38 @@ if (open my $fh, '>', 'default.rc')
}
# Set up a default command, project and priority.
qx{../task rc:default.rc add all defaults};
my $output = qx{../task rc:default.rc list};
qx{../src/task rc:default.rc add all defaults};
my $output = qx{../src/task rc:default.rc list};
like ($output, qr/ all defaults/, 'task added');
like ($output, qr/ PROJECT /, 'default project added');
like ($output, qr/ M /, 'default priority added');
like ($output, qr/\//, 'default due added');
unlink 'pending.data';
qx{../task rc:default.rc add project:specific priority:L due:eoy all specified};
$output = qx{../task rc:default.rc list};
qx{../src/task rc:default.rc add project:specific priority:L due:eoy all specified};
$output = qx{../src/task rc:default.rc list};
like ($output, qr/ all specified/, 'task added');
like ($output, qr/ specific /, 'project specified');
like ($output, qr/ L /, 'priority specified');
like ($output, qr/\//, 'due specified');
unlink 'pending.data';
qx{../task rc:default.rc add project:specific project specified};
$output = qx{../task rc:default.rc list};
qx{../src/task rc:default.rc add project:specific project specified};
$output = qx{../src/task rc:default.rc list};
like ($output, qr/ project specified/, 'task added');
like ($output, qr/ specific /, 'project specified');
like ($output, qr/ M /, 'default priority added');
like ($output, qr/\//, 'default due added');
unlink 'pending.data';
qx{../task rc:default.rc add priority:L priority specified};
$output = qx{../task rc:default.rc list};
qx{../src/task rc:default.rc add priority:L priority specified};
$output = qx{../src/task rc:default.rc list};
like ($output, qr/ priority specified/, 'task added');
like ($output, qr/ PROJECT /, 'default project added');
like ($output, qr/ L /, 'priority specified');
like ($output, qr/\//, 'default due added');
$output = qx{../task rc:default.rc};
$output = qx{../src/task rc:default.rc};
like ($output, qr/1 PROJECT L .+ priority specified/, 'default command worked');
# Cleanup.

View file

@ -41,23 +41,23 @@ if (open my $fh, '>', 'delete.rc')
}
# Add a task, delete it, undelete it.
my $output = qx{../task rc:delete.rc add one; ../task rc:delete.rc info 1};
my $output = qx{../src/task rc:delete.rc add one; ../src/task rc:delete.rc info 1};
ok (-r 'pending.data', 'pending.data created');
like ($output, qr/Status\s+Pending\n/, 'Pending');
$output = qx{../task rc:delete.rc delete 1; ../task rc:delete.rc info 1};
$output = qx{../src/task rc:delete.rc delete 1; ../src/task rc:delete.rc info 1};
like ($output, qr/Status\s+Deleted\n/, 'Deleted');
ok (-r 'completed.data', 'completed.data created');
$output = qx{echo 'y' | ../task rc:delete.rc undo; ../task rc:delete.rc info 1};
$output = qx{echo 'y' | ../src/task rc:delete.rc undo; ../src/task rc:delete.rc info 1};
like ($output, qr/Status\s+Pending\n/, 'Pending');
ok (-r 'completed.data', 'completed.data created');
$output = qx{../task rc:delete.rc delete 1; ../task rc:delete.rc list};
$output = qx{../src/task rc:delete.rc delete 1; ../src/task rc:delete.rc list};
like ($output, qr/No matches./, 'No matches');
ok (-r 'completed.data', 'completed.data created');
$output = qx{../task rc:delete.rc info 1};
$output = qx{../src/task rc:delete.rc info 1};
like ($output, qr/Task 1 not found/, 'No matches');
# Cleanup.

View file

@ -45,23 +45,23 @@ if (open my $fh, '>', 'denotate.rc')
}
# Add four tasks, annotate one three times, one twice, one just once and one none.
qx{../task rc:denotate.rc add one};
qx{../task rc:denotate.rc annotate 1 Ernie};
qx{../src/task rc:denotate.rc add one};
qx{../src/task rc:denotate.rc annotate 1 Ernie};
diag ("6 second delay");
sleep 1;
qx{../task rc:denotate.rc annotate 1 Bert};
qx{../src/task rc:denotate.rc annotate 1 Bert};
sleep 1;
qx{../task rc:denotate.rc annotate 1 Bibo};
qx{../src/task rc:denotate.rc annotate 1 Bibo};
sleep 1;
qx{../task rc:denotate.rc annotate 1 Kermit the frog};
qx{../src/task rc:denotate.rc annotate 1 Kermit the frog};
sleep 1;
qx{../task rc:denotate.rc annotate 1 Kermit the frog};
qx{../src/task rc:denotate.rc annotate 1 Kermit the frog};
sleep 1;
qx{../task rc:denotate.rc annotate 1 Kermit};
qx{../src/task rc:denotate.rc annotate 1 Kermit};
sleep 1;
qx{../task rc:denotate.rc annotate 1 Kermit and Miss Piggy};
qx{../src/task rc:denotate.rc annotate 1 Kermit and Miss Piggy};
my $output = qx{../task rc:denotate.rc rrr};
my $output = qx{../src/task rc:denotate.rc rrr};
like ($output, qr/1 one/, 'task 1');
like ($output, qr/one.+\d{1,2}\/\d{1,2}\/\d{4} Ernie/ms, 'first annotation');
@ -73,36 +73,36 @@ like ($output, qr/frog.+\d{1,2}\/\d{1,2}\/\d{4} Kermit/ms, 'six
like ($output, qr/Kermit.+\d{1,2}\/\d{1,2}\/\d{4} Kermit and Miss Piggy/ms, 'seventh annotation');
like ($output, qr/1 task/, 'count');
qx{../task rc:denotate.rc denotate 1 Ernie};
$output = qx{../task rc:denotate.rc rrr};
qx{../src/task rc:denotate.rc denotate 1 Ernie};
$output = qx{../src/task rc:denotate.rc rrr};
unlike ($output, qr/one.+\d{1,2}\/\d{1,2}\/\d{4} Ernie/ms, 'Delete annotation');
like ($output, qr/one.+\d{1,2}\/\d{1,2}\/\d{4} Bert/ms, 'Bert now first annotationt');
qx{../task rc:denotate.rc denotate 1 Bi};
$output = qx{../task rc:denotate.rc rrr};
qx{../src/task rc:denotate.rc denotate 1 Bi};
$output = qx{../src/task rc:denotate.rc rrr};
unlike ($output, qr/Bert.+\d{1,2}\/\d{1,2}\/\d{4} Bibo/ms, 'Delete partial match');
like ($output, qr/Bert.+\d{1,2}\/\d{1,2}\/\d{4} Kermit the frog/ms, 'Kermit the frog now second annotation');
qx{../task rc:denotate.rc denotate 1 BErt};
$output = qx{../task rc:denotate.rc rrr};
qx{../src/task rc:denotate.rc denotate 1 BErt};
$output = qx{../src/task rc:denotate.rc rrr};
like ($output, qr/one.+\d{1,2}\/\d{1,2}\/\d{4} Bert/ms, 'Denotate is case sensitive');
like ($output, qr/Bert.+\d{1,2}\/\d{1,2}\/\d{4} Kermit the frog/ms, 'Kermit the frog still second annoation');
qx{../task rc:denotate.rc denotate 1 Kermit};
$output = qx{../task rc:denotate.rc rrr};
qx{../src/task rc:denotate.rc denotate 1 Kermit};
$output = qx{../src/task rc:denotate.rc rrr};
like ($output, qr/one.+\d{1,2}\/\d{1,2}\/\d{4} Bert/ms, 'Exact match deletion - Bert');
like ($output, qr/Bert.+\d{1,2}\/\d{1,2}\/\d{4} Kermit the frog/ms, 'Exact match deletion - Kermit the frog');
like ($output, qr/frog.+\d{1,2}\/\d{1,2}\/\d{4} Kermit the frog/ms, 'Exact match deletion - Kermit the frog');
like ($output, qr/frog.+\d{1,2}\/\d{1,2}\/\d{4} Kermit and Miss Piggy/ms, 'Exact match deletion - Kermit and Miss Piggy');
qx{../task rc:denotate.rc denotate 1 Kermit the};
$output = qx{../task rc:denotate.rc rrr};
qx{../src/task rc:denotate.rc denotate 1 Kermit the};
$output = qx{../src/task rc:denotate.rc rrr};
like ($output, qr/one.+\d{1,2}\/\d{1,2}\/\d{4} Bert/ms, 'Delete just one annotation - Bert');
like ($output, qr/Bert.+\d{1,2}\/\d{1,2}\/\d{4} Kermit the frog/ms, 'Delete just one annotation - Kermit the frog');
like ($output, qr/frog.+\d{1,2}\/\d{1,2}\/\d{4} Kermit and Miss Piggy/ms, 'Delete just one annotation - Kermit and Miss Piggy');
qx{../task rc:denotate.rc denotate 1 Kermit a};
$output = qx{../task rc:denotate.rc rrr};
qx{../src/task rc:denotate.rc denotate 1 Kermit a};
$output = qx{../src/task rc:denotate.rc rrr};
like ($output, qr/one.+\d{1,2}\/\d{1,2}\/\d{4} Bert/ms, 'Delete partial match - Bert');
like ($output, qr/Bert.+\d{1,2}\/\d{1,2}\/\d{4} Kermit the frog/ms, 'Delete partial match - Kermit the frog');
unlike ($output, qr/frog.+\d{1,2}\/\d{1,2}\/\d{4} Kermit and Miss Piggy/ms, 'Delete partial match - Kermit and Miss Piggy');

View file

@ -45,50 +45,50 @@ if (open my $fh, '>', 'dep.rc')
ok (-r 'dep.rc', 'Created dep.rc');
}
qx{../task rc:dep.rc add One};
qx{../task rc:dep.rc add Two};
qx{../src/task rc:dep.rc add One};
qx{../src/task rc:dep.rc add Two};
# [2]
my $output = qx{../task rc:dep.rc 1 dep:-2};
my $output = qx{../src/task rc:dep.rc 1 dep:-2};
like ($output, qr/Modified 0 tasks\./, 'dependencies - remove nonexistent dependency');
# [3]
$output = qx{../task rc:dep.rc 1 dep:99};
$output = qx{../src/task rc:dep.rc 1 dep:99};
like ($output, qr/Could not create a dependency on task 99 - not found\./, 'dependencies - add dependency for nonexistent task');
# [4]
$output = qx{../task rc:dep.rc 99 dep:1};
$output = qx{../src/task rc:dep.rc 99 dep:1};
like ($output, qr/Task 99 not found\./, 'dependencies - add dependency to nonexistent task');
# [5,6] t 1 dep:2; t info 1 => blocked by 2
$output = qx{../task rc:dep.rc 1 dep:2; ../task rc:dep.rc info 1};
$output = qx{../src/task rc:dep.rc 1 dep:2; ../src/task rc:dep.rc info 1};
like ($output, qr/This task blocked by\s+2 Two\nUUID/, 'dependencies - trivial blocked');
unlike ($output, qr/This task is blocking\n/, 'dependencies - trivial blocked');
# [7,8] t info 2 => blocking 1
$output = qx{../task rc:dep.rc info 2};
$output = qx{../src/task rc:dep.rc info 2};
unlike ($output, qr/This task blocked by/, 'dependencies - trivial blocking');
like ($output, qr/This task is blocking\s+1 One\nUUID/, 'dependencies - trivial blocking');
# [9] t 1 dep:2 (again)
$output = qx{../task rc:dep.rc 1 dep:2};
$output = qx{../src/task rc:dep.rc 1 dep:2};
like ($output, qr/Task 1 already depends on task 2\./, 'dependencies - add already existing dependency');
# [10,11] t 1 dep:1 => error
$output = qx{../task rc:dep.rc 1 dep:1};
$output = qx{../src/task rc:dep.rc 1 dep:1};
like ($output, qr/A task cannot be dependent on itself\./, 'dependencies - cannot depend on self');
unlike ($output, qr/Modified 1 task\./, 'dependencies - cannot depend on self');
# [12,13] t 1 dep:2; t 2 dep:1 => error
$output = qx{../task rc:dep.rc 2 dep:1};
$output = qx{../src/task rc:dep.rc 2 dep:1};
like ($output, qr/Circular dependency detected and disallowed\./, 'dependencies - trivial circular');
unlike ($output, qr/Modified 1 task\./, 'dependencies - trivial circular');
# [14,15] t 1 dep:2; t 2 dep:3; t 1 dep:3 => not circular
qx{../task rc:dep.rc 1 dep:2};
qx{../task rc:dep.rc add Three};
qx{../task rc:dep.rc 2 dep:3};
$output = qx{../task rc:dep.rc 1 dep:3};
qx{../src/task rc:dep.rc 1 dep:2};
qx{../src/task rc:dep.rc add Three};
qx{../src/task rc:dep.rc 2 dep:3};
$output = qx{../src/task rc:dep.rc 1 dep:3};
unlike ($output, qr/Circular dependency detected and disallowed\./, 'dependencies - diamond, non-circular');
like ($output, qr/Modified 1 task\./, 'dependencies - diamond, non-circular');
@ -96,16 +96,16 @@ like ($output, qr/Modified 1 task\./, 'dependencie
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data for a fresh start');
qx{../task rc:dep.rc add One};
qx{../task rc:dep.rc add Two};
qx{../task rc:dep.rc add Three};
qx{../task rc:dep.rc add Four};
qx{../task rc:dep.rc add Five};
qx{../src/task rc:dep.rc add One};
qx{../src/task rc:dep.rc add Two};
qx{../src/task rc:dep.rc add Three};
qx{../src/task rc:dep.rc add Four};
qx{../src/task rc:dep.rc add Five};
qx{../task rc:dep.rc 5 dep:4; ../task rc:dep.rc 4 dep:3; ../task rc:dep.rc 3 dep:2; ../task rc:dep.rc 2 dep:1};
qx{../src/task rc:dep.rc 5 dep:4; ../src/task rc:dep.rc 4 dep:3; ../src/task rc:dep.rc 3 dep:2; ../src/task rc:dep.rc 2 dep:1};
# [17,18] 5 dep 4 dep 3 dep 2 dep 1 dep 5 => error
$output = qx{../task rc:dep.rc 1 dep:5};
$output = qx{../src/task rc:dep.rc 1 dep:5};
like ($output, qr/Circular dependency detected and disallowed\./, 'dependencies - nontrivial circular');
unlike ($output, qr/Modified 1 task\./, 'dependencies - nontrivial circular');
@ -113,108 +113,108 @@ unlike ($output, qr/Modified 1 task\./, 'dependencie
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data for a fresh start');
qx{../task rc:dep.rc add One};
qx{../task rc:dep.rc add Two};
qx{../task rc:dep.rc add Three};
qx{../task rc:dep.rc add Four};
qx{../task rc:dep.rc add Five};
qx{../task rc:dep.rc add Six recurring due:tomorrow recur:daily};
qx{../src/task rc:dep.rc add One};
qx{../src/task rc:dep.rc add Two};
qx{../src/task rc:dep.rc add Three};
qx{../src/task rc:dep.rc add Four};
qx{../src/task rc:dep.rc add Five};
qx{../src/task rc:dep.rc add Six recurring due:tomorrow recur:daily};
# [20]
qx{../task rc:dep.rc ls}; # To force handleRecurrence call.
$output = qx{../task rc:dep.rc 6 dep:5};
qx{../src/task rc:dep.rc ls}; # To force handleRecurrence call.
$output = qx{../src/task rc:dep.rc 6 dep:5};
like ($output, qr/Modified \d+ task/, 'dependencies - recurring task depending on another task');
# [21]
$output = qx{../task rc:dep.rc 4 dep:5};
$output = qx{../src/task rc:dep.rc 4 dep:5};
like ($output, qr/Modified \d+ task/, 'dependencies - task depending on recurring task');
# [22] t 1 dep:2,3,4; t 1 dep:-2,-4,5; t info 1 => blocked by 3,5
$output = qx{../task rc:dep.rc 1 dep:2,3,4; ../task rc:dep.rc 1 dep:-2,-4,5; ../task rc:dep.rc info 1};
$output = qx{../src/task rc:dep.rc 1 dep:2,3,4; ../src/task rc:dep.rc 1 dep:-2,-4,5; ../src/task rc:dep.rc info 1};
like ($output, qr/This task blocked by\s+3 Three\n\s+5 Five\nUUID/, 'dependencies - multiple dependencies modified');
# [23,24]
$output = qx{../task rc:dep.rc do 3,5; ../task rc:dep.rc info 1};
$output = qx{../src/task rc:dep.rc do 3,5; ../src/task rc:dep.rc info 1};
unlike ($output, qr/This task blocked by/, 'dependencies - task info reflects completed dependencies');
unlike ($output, qr/This task is blocking/, 'dependencies - task info reflects completed dependencies');
# [25]
$output = qx{../task rc:dep.rc depreport};
$output = qx{../src/task rc:dep.rc depreport};
like ($output, qr/\s1\s+One\s+/, 'dependencies - depends report column reflects completed dependencies');
# [26]
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data for a fresh start');
qx{../task rc:dep.rc add One};
qx{../task rc:dep.rc add Two};
qx{../task rc:dep.rc add Three};
qx{../task rc:dep.rc add Four};
qx{../src/task rc:dep.rc add One};
qx{../src/task rc:dep.rc add Two};
qx{../src/task rc:dep.rc add Three};
qx{../src/task rc:dep.rc add Four};
qx{../task rc:dep.rc 1 dep:3,4};
qx{../task rc:dep.rc do 2};
qx{../src/task rc:dep.rc 1 dep:3,4};
qx{../src/task rc:dep.rc do 2};
# [27]
$output = qx{../task rc:dep.rc depreport};
$output = qx{../src/task rc:dep.rc depreport};
like ($output, qr/\s1\s+2,3\s+One\s+/, 'dependencies - depends report column reflects changed IDs');
# [28]
qx{../task rc:dep.rc do 3};
$output = qx{../task rc:dep.rc depreport};
qx{../src/task rc:dep.rc do 3};
$output = qx{../src/task rc:dep.rc depreport};
like ($output, qr/\s1\s+2\s+One\s+/, 'dependencies - depends report column reflects completed dependencies');
# [29]
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data for a fresh start');
qx{../task rc:dep.rc add One};
qx{../task rc:dep.rc add Two};
qx{../task rc:dep.rc add Three};
qx{../task rc:dep.rc add Four};
qx{../src/task rc:dep.rc add One};
qx{../src/task rc:dep.rc add Two};
qx{../src/task rc:dep.rc add Three};
qx{../src/task rc:dep.rc add Four};
qx{../task rc:dep.rc 2 dep:1; ../task rc:dep.rc 3 dep:2; ../task rc:dep.rc 4 dep:3};
qx{../src/task rc:dep.rc 2 dep:1; ../src/task rc:dep.rc 3 dep:2; ../src/task rc:dep.rc 4 dep:3};
# [30,31]
$output = qx{echo y | ../task rc:dep.rc do 2};
$output = qx{echo y | ../src/task rc:dep.rc do 2};
like ($output, qr/fixed/, 'dependencies - user prompted to fix broken chain after completing a blocked task');
like ($output, qr/is blocked by/, 'dependencies - user nagged for completing a blocked task');
# [32]
$output = qx{echo y | ../task rc:dep.rc do 1};
$output = qx{echo y | ../src/task rc:dep.rc do 1};
unlike ($output, qr/fixed/, 'dependencies - user not prompted to fix broken chain when the head of the chain is marked as complete');
# [33]
$output = qx{echo y | ../task rc:dep.rc del 4};
$output = qx{echo y | ../src/task rc:dep.rc del 4};
unlike ($output, qr/fixed/, 'dependencies - user not prompted to fix broken chain when the tail of the chain is deleted');
# [34]
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data for a fresh start');
qx{../task rc:dep.rc add One};
qx{../task rc:dep.rc add Two};
qx{../task rc:dep.rc add Three};
qx{../task rc:dep.rc add Four};
qx{../task rc:dep.rc add Five};
qx{../src/task rc:dep.rc add One};
qx{../src/task rc:dep.rc add Two};
qx{../src/task rc:dep.rc add Three};
qx{../src/task rc:dep.rc add Four};
qx{../src/task rc:dep.rc add Five};
qx{../task rc:dep.rc 2 dep:1};
qx{../task rc:dep.rc 3 dep:2};
qx{../task rc:dep.rc 4 dep:3};
qx{../task rc:dep.rc 5 dep:4};
qx{../src/task rc:dep.rc 2 dep:1};
qx{../src/task rc:dep.rc 3 dep:2};
qx{../src/task rc:dep.rc 4 dep:3};
qx{../src/task rc:dep.rc 5 dep:4};
# [35]
qx{echo y | ../task rc:dep.rc do 2};
$output = qx{../task rc:dep.rc depreport};
qx{echo y | ../src/task rc:dep.rc do 2};
$output = qx{../src/task rc:dep.rc depreport};
like ($output, qr/\s1\s+One\s*\n\s2\s+1\s+Three\s*\n\s3\s+2\s+Four\s*\n\s4\s+3\s+Five/, 'dependencies - fixed chain after completing a blocked task');
# [36]
qx{printf "Y\nY\n" | ../task rc:dep.rc del 2};
$output = qx{../task rc:dep.rc depreport};
qx{printf "Y\nY\n" | ../src/task rc:dep.rc del 2};
$output = qx{../src/task rc:dep.rc depreport};
like ($output, qr/\s1\s+One\s*\n\s2\s+1\s+Four\s*\n\s3\s+2\s+Five/, 'dependencies - fixed chain after deleting a blocked task');
# [37]
qx{../task rc:dep.rc 2 dep:-1};
$output = qx{../task rc:dep.rc depreport};
qx{../src/task rc:dep.rc 2 dep:-1};
$output = qx{../src/task rc:dep.rc depreport};
like ($output, qr/\s1\s+One\s*\n\s2\s+Four\s*\n\s3\s+2\s+Five/, 'dependencies - chain should not be automatically repaired after manually removing a dependency');
# TODO - test dependency.confirmation config variable

View file

@ -51,17 +51,17 @@ my $just = sprintf ("%d/%d/%d", $m + 1, $d, $y + 1900);
($d, $m, $y) = (localtime (time + 5 * 86_400))[3..5];
my $almost = sprintf ("%d/%d/%d", $m + 1, $d, $y + 1900);
qx{../task rc:due.rc add one due:$just};
qx{../task rc:due.rc add two due:$almost};
my $output = qx{../task rc:due.rc list};
qx{../src/task rc:due.rc add one due:$just};
qx{../src/task rc:due.rc add two due:$almost};
my $output = qx{../src/task rc:due.rc list};
like ($output, qr/\[31m.+$just.+\[0m/, 'one marked due');
like ($output, qr/\s+$almost\s+/, 'two not marked due');
qx{../task rc:due.rc add three due:today};
$output = qx{../task rc:due.rc list due:today};
qx{../src/task rc:due.rc add three due:today};
$output = qx{../src/task rc:due.rc list due:today};
like ($output, qr/three/, 'due:today works as a filter');
$output = qx{../task rc:due.rc list due.is:today};
$output = qx{../src/task rc:due.rc list due.is:today};
like ($output, qr/three/, 'due.is:today works as a filter');
# Cleanup.

View file

@ -39,16 +39,16 @@ if (open my $fh, '>', 'dup.rc')
}
# Test the duplicate command.
qx{../task rc:dup.rc add foo};
qx{../task rc:dup.rc duplicate 1};
my $output = qx{../task rc:dup.rc info 2};
qx{../src/task rc:dup.rc add foo};
qx{../src/task rc:dup.rc duplicate 1};
my $output = qx{../src/task rc:dup.rc info 2};
like ($output, qr/ID\s+2/, 'duplicate new id');
like ($output, qr/Status\s+Pending/, 'duplicate same status');
like ($output, qr/Description\s+foo/, 'duplicate same description');
# Test the en passant modification while duplicating.
qx{../task rc:dup.rc duplicate 1 priority:H /foo/FOO/ +tag};
$output = qx{../task rc:dup.rc info 3};
qx{../src/task rc:dup.rc duplicate 1 priority:H /foo/FOO/ +tag};
$output = qx{../src/task rc:dup.rc info 3};
like ($output, qr/ID\s+3/, 'duplicate new id');
like ($output, qr/Status\s+Pending/, 'duplicate same status');
like ($output, qr/Description\s+FOO/, 'duplicate modified description');
@ -56,7 +56,7 @@ like ($output, qr/Priority\s+H/, 'duplicate added priority');
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};
$output = qx{../src/task rc:dup.rc duplicate 1};
like ($output, qr/Duplicated\s+1\s+'foo'/, 'duplicate output task id and description');
like ($output, qr/Created\s+task\s+4/, 'duplicate output of new task id');

View file

@ -39,15 +39,15 @@ if (open my $fh, '>', 'enp.rc')
}
# Test the en passant feature.
qx{../task rc:enp.rc add foo};
qx{../task rc:enp.rc add foo bar};
qx{../task rc:enp.rc do 1,2 /foo/FOO/ pri:H +tag};
my $output = qx{../task rc:enp.rc info 1};
qx{../src/task rc:enp.rc add foo};
qx{../src/task rc:enp.rc add foo bar};
qx{../src/task rc:enp.rc do 1,2 /foo/FOO/ pri:H +tag};
my $output = qx{../src/task rc:enp.rc info 1};
like ($output, qr/Status\s+Completed/, 'en passant 1 status change');
like ($output, qr/Description\s+FOO/, 'en passant 1 description change');
like ($output, qr/Priority\s+H/, 'en passant 1 description change');
like ($output, qr/Tags\s+tag/, 'en passant 1 description change');
$output = qx{../task rc:enp.rc info 2};
$output = qx{../src/task rc:enp.rc info 2};
like ($output, qr/Status\s+Completed/, 'en passant 2 status change');
like ($output, qr/Description\s+FOO bar/, 'en passant 2 description change');
like ($output, qr/Priority\s+H/, 'en passant 2 description change');

View file

@ -39,9 +39,9 @@ if (open my $fh, '>', 'export.rc')
}
# Add two tasks, export, examine result.
qx{../task rc:export.rc add priority:H project:A one};
qx{../task rc:export.rc add +tag1 +tag2 two};
qx{../task rc:export.rc export.csv > ./export.txt};
qx{../src/task rc:export.rc add priority:H project:A one};
qx{../src/task rc:export.rc add +tag1 +tag2 two};
qx{../src/task rc:export.rc export.csv > ./export.txt};
my @lines;
if (open my $fh, '<', './export.txt')

View file

@ -39,9 +39,9 @@ if (open my $fh, '>', 'export.rc')
}
# Add two tasks, export, examine result.
qx{../task rc:export.rc add priority:H project:A one};
qx{../task rc:export.rc add +tag1 +tag2 two};
qx{../task rc:export.rc export.yaml > ./export.txt};
qx{../src/task rc:export.rc add priority:H project:A one};
qx{../src/task rc:export.rc add +tag1 +tag2 two};
qx{../src/task rc:export.rc export.yaml > ./export.txt};
my @lines;
if (open my $fh, '<', './export.txt')

View file

@ -39,10 +39,10 @@ if (open my $fh, '>', 'exit.rc')
ok (-r 'exit.rc', 'Created exit.rc');
}
qx{../task rc:exit.rc add foo};
my $exit_good = system ('../task rc:exit.rc ls foo 2>&1 >>/dev/null');
qx{../src/task rc:exit.rc add foo};
my $exit_good = system ('../src/task rc:exit.rc ls foo 2>&1 >>/dev/null');
is ($exit_good, 0, 'task returns 0 on success');
my $exit_bad = system ('../task rc:exit.rc ls bar 2>&1 >>/dev/null');
my $exit_bad = system ('../src/task rc:exit.rc ls bar 2>&1 >>/dev/null');
isnt ($exit_bad, 0, 'task returns non-zero on failure');
# Cleanup.

View file

@ -39,15 +39,15 @@ if (open my $fh, '>', 'filter.rc')
}
# Test the filters.
qx{../task rc:filter.rc add project:A priority:H +tag one foo};
qx{../task rc:filter.rc add project:A priority:H two};
qx{../task rc:filter.rc add project:A three};
qx{../task rc:filter.rc add priority:H four};
qx{../task rc:filter.rc add +tag five};
qx{../task rc:filter.rc add six foo};
qx{../task rc:filter.rc add priority:L seven bar foo};
qx{../src/task rc:filter.rc add project:A priority:H +tag one foo};
qx{../src/task rc:filter.rc add project:A priority:H two};
qx{../src/task rc:filter.rc add project:A three};
qx{../src/task rc:filter.rc add priority:H four};
qx{../src/task rc:filter.rc add +tag five};
qx{../src/task rc:filter.rc add six foo};
qx{../src/task rc:filter.rc add priority:L seven bar foo};
my $output = qx{../task rc:filter.rc list};
my $output = qx{../src/task rc:filter.rc list};
like ($output, qr/one/, 'a1');
like ($output, qr/two/, 'a2');
like ($output, qr/three/, 'a3');
@ -56,7 +56,7 @@ like ($output, qr/five/, 'a5');
like ($output, qr/six/, 'a6');
like ($output, qr/seven/, 'a7');
$output = qx{../task rc:filter.rc list project:A};
$output = qx{../src/task rc:filter.rc list project:A};
like ($output, qr/one/, 'b1');
like ($output, qr/two/, 'b2');
like ($output, qr/three/, 'b3');
@ -65,7 +65,7 @@ unlike ($output, qr/five/, 'b5');
unlike ($output, qr/six/, 'b6');
unlike ($output, qr/seven/, 'b7');
$output = qx{../task rc:filter.rc list priority:H};
$output = qx{../src/task rc:filter.rc list priority:H};
like ($output, qr/one/, 'c1');
like ($output, qr/two/, 'c2');
unlike ($output, qr/three/, 'c3');
@ -74,7 +74,7 @@ unlike ($output, qr/five/, 'c5');
unlike ($output, qr/six/, 'c6');
unlike ($output, qr/seven/, 'c7');
$output = qx{../task rc:filter.rc list priority:};
$output = qx{../src/task rc:filter.rc list priority:};
unlike ($output, qr/one/, 'd1');
unlike ($output, qr/two/, 'd2');
like ($output, qr/three/, 'd3');
@ -83,7 +83,7 @@ like ($output, qr/five/, 'd5');
like ($output, qr/six/, 'd6');
unlike ($output, qr/seven/, 'd7');
$output = qx{../task rc:filter.rc list foo};
$output = qx{../src/task rc:filter.rc list foo};
like ($output, qr/one/, 'e1');
unlike ($output, qr/two/, 'e2');
unlike ($output, qr/three/, 'e3');
@ -92,7 +92,7 @@ unlike ($output, qr/five/, 'e5');
like ($output, qr/six/, 'e6');
like ($output, qr/seven/, 'e7');
$output = qx{../task rc:filter.rc list foo bar};
$output = qx{../src/task rc:filter.rc list foo bar};
unlike ($output, qr/one/, 'f1');
unlike ($output, qr/two/, 'f2');
unlike ($output, qr/three/, 'f3');
@ -101,7 +101,7 @@ unlike ($output, qr/five/, 'f5');
unlike ($output, qr/six/, 'f6');
like ($output, qr/seven/, 'f7');
$output = qx{../task rc:filter.rc list +tag};
$output = qx{../src/task rc:filter.rc list +tag};
like ($output, qr/one/, 'g1');
unlike ($output, qr/two/, 'g2');
unlike ($output, qr/three/, 'g3');
@ -110,7 +110,7 @@ like ($output, qr/five/, 'g5');
unlike ($output, qr/six/, 'g6');
unlike ($output, qr/seven/, 'g7');
$output = qx{../task rc:filter.rc list -tag};
$output = qx{../src/task rc:filter.rc list -tag};
unlike ($output, qr/one/, 'h1');
like ($output, qr/two/, 'h2');
like ($output, qr/three/, 'h3');
@ -119,7 +119,7 @@ unlike ($output, qr/five/, 'h5');
like ($output, qr/six/, 'h6');
like ($output, qr/seven/, 'h7');
$output = qx{../task rc:filter.rc list -missing};
$output = qx{../src/task rc:filter.rc list -missing};
like ($output, qr/one/, 'i1');
like ($output, qr/two/, 'i2');
like ($output, qr/three/, 'i3');
@ -128,7 +128,7 @@ like ($output, qr/five/, 'i5');
like ($output, qr/six/, 'i6');
like ($output, qr/seven/, 'i7');
$output = qx{../task rc:filter.rc list +tag -tag};
$output = qx{../src/task rc:filter.rc list +tag -tag};
unlike ($output, qr/one/, 'j1');
unlike ($output, qr/two/, 'j2');
unlike ($output, qr/three/, 'j3');
@ -137,7 +137,7 @@ unlike ($output, qr/five/, 'j5');
unlike ($output, qr/six/, 'j6');
unlike ($output, qr/seven/, 'j7');
$output = qx{../task rc:filter.rc list project:A priority:H};
$output = qx{../src/task rc:filter.rc list project:A priority:H};
like ($output, qr/one/, 'k1');
like ($output, qr/two/, 'k2');
unlike ($output, qr/three/, 'k3');
@ -146,7 +146,7 @@ unlike ($output, qr/five/, 'k5');
unlike ($output, qr/six/, 'k6');
unlike ($output, qr/seven/, 'k7');
$output = qx{../task rc:filter.rc list project:A priority:};
$output = qx{../src/task rc:filter.rc list project:A priority:};
unlike ($output, qr/one/, 'l1');
unlike ($output, qr/two/, 'l2');
like ($output, qr/three/, 'l3');
@ -155,7 +155,7 @@ unlike ($output, qr/five/, 'l5');
unlike ($output, qr/six/, 'l6');
unlike ($output, qr/seven/, 'l7');
$output = qx{../task rc:filter.rc list project:A foo};
$output = qx{../src/task rc:filter.rc list project:A foo};
like ($output, qr/one/, 'm1');
unlike ($output, qr/two/, 'm2');
unlike ($output, qr/three/, 'm3');
@ -164,7 +164,7 @@ unlike ($output, qr/five/, 'm5');
unlike ($output, qr/six/, 'm6');
unlike ($output, qr/seven/, 'm7');
$output = qx{../task rc:filter.rc list project:A +tag};
$output = qx{../src/task rc:filter.rc list project:A +tag};
like ($output, qr/one/, 'n1');
unlike ($output, qr/two/, 'n2');
unlike ($output, qr/three/, 'n3');
@ -173,7 +173,7 @@ unlike ($output, qr/five/, 'n5');
unlike ($output, qr/six/, 'n6');
unlike ($output, qr/seven/, 'n7');
$output = qx{../task rc:filter.rc list project:A priority:H foo};
$output = qx{../src/task rc:filter.rc list project:A priority:H foo};
like ($output, qr/one/, 'o1');
unlike ($output, qr/two/, 'o2');
unlike ($output, qr/three/, 'o3');
@ -182,7 +182,7 @@ unlike ($output, qr/five/, 'o5');
unlike ($output, qr/six/, 'o6');
unlike ($output, qr/seven/, 'o7');
$output = qx{../task rc:filter.rc list project:A priority:H +tag};
$output = qx{../src/task rc:filter.rc list project:A priority:H +tag};
like ($output, qr/one/, 'p1');
unlike ($output, qr/two/, 'p2');
unlike ($output, qr/three/, 'p3');
@ -191,7 +191,7 @@ unlike ($output, qr/five/, 'p5');
unlike ($output, qr/six/, 'p6');
unlike ($output, qr/seven/, 'p7');
$output = qx{../task rc:filter.rc list project:A priority:H foo +tag};
$output = qx{../src/task rc:filter.rc list project:A priority:H foo +tag};
like ($output, qr/one/, 'q1');
unlike ($output, qr/two/, 'q2');
unlike ($output, qr/three/, 'q3');
@ -200,7 +200,7 @@ unlike ($output, qr/five/, 'q5');
unlike ($output, qr/six/, 'q6');
unlike ($output, qr/seven/, 'q7');
$output = qx{../task rc:filter.rc list project:A priority:H foo +tag baz};
$output = qx{../src/task rc:filter.rc list project:A priority:H foo +tag baz};
unlike ($output, qr/one/, 'r1');
unlike ($output, qr/two/, 'r2');
unlike ($output, qr/three/, 'r3');
@ -210,7 +210,7 @@ unlike ($output, qr/six/, 'r6');
unlike ($output, qr/seven/, 'r7');
# Regex filters.
$output = qx{../task rc:filter.rc list rc.regex:on project:[A-Z]};
$output = qx{../src/task rc:filter.rc list rc.regex:on project:[A-Z]};
like ($output, qr/one/, 's1');
like ($output, qr/two/, 's2');
like ($output, qr/three/, 's3');
@ -219,7 +219,7 @@ unlike ($output, qr/five/, 's5');
unlike ($output, qr/six/, 's6');
unlike ($output, qr/seven/, 's7');
$output = qx{../task rc:filter.rc list rc.regex:on project:.};
$output = qx{../src/task rc:filter.rc list rc.regex:on project:.};
like ($output, qr/one/, 't1');
like ($output, qr/two/, 't2');
like ($output, qr/three/, 't3');
@ -228,7 +228,7 @@ unlike ($output, qr/five/, 't5');
unlike ($output, qr/six/, 't6');
unlike ($output, qr/seven/, 't7');
$output = qx{../task rc:filter.rc rc.regex:on list fo\{2\}};
$output = qx{../src/task rc:filter.rc rc.regex:on list fo\{2\}};
like ($output, qr/one/, 'u1');
unlike ($output, qr/two/, 'u2');
unlike ($output, qr/three/, 'u3');
@ -237,7 +237,7 @@ unlike ($output, qr/five/, 'u5');
like ($output, qr/six/, 'u6');
like ($output, qr/seven/, 'u7');
$output = qx{../task rc:filter.rc rc.regex:on list f.. b..};
$output = qx{../src/task rc:filter.rc rc.regex:on list f.. b..};
unlike ($output, qr/one/, 'v1');
unlike ($output, qr/two/, 'v2');
unlike ($output, qr/three/, 'v3');
@ -246,7 +246,7 @@ unlike ($output, qr/five/, 'v5');
unlike ($output, qr/six/, 'v6');
like ($output, qr/seven/, 'v7');
$output = qx{../task rc:filter.rc rc.regex:on list ^s};
$output = qx{../src/task rc:filter.rc rc.regex:on list ^s};
unlike ($output, qr/one/, 'w1');
unlike ($output, qr/two/, 'w2');
unlike ($output, qr/three/, 'w3');
@ -255,7 +255,7 @@ unlike ($output, qr/five/, 'w5');
like ($output, qr/six/, 'w6');
like ($output, qr/seven/, 'w7');
$output = qx{../task rc:filter.rc rc.regex:on list ^.i};
$output = qx{../src/task rc:filter.rc rc.regex:on list ^.i};
unlike ($output, qr/one/, 'x1');
unlike ($output, qr/two/, 'x2');
unlike ($output, qr/three/, 'x3');
@ -264,7 +264,7 @@ like ($output, qr/five/, 'x5');
like ($output, qr/six/, 'x6');
unlike ($output, qr/seven/, 'x7');
$output = qx{../task rc:filter.rc rc.regex:on list "two|five"};
$output = qx{../src/task rc:filter.rc rc.regex:on list "two|five"};
unlike ($output, qr/one/, 'y1');
like ($output, qr/two/, 'y2');
unlike ($output, qr/three/, 'y3');

View file

@ -54,22 +54,22 @@ if (open my $fh, '>', 'font.rc')
#
# * When isatty (fileno (stdout)) is false, color is automatically disabled.
qx{../task rc:font.rc add foo};
my $output = qx{../task 1 info rc:font.rc rc.color:off rc._forcecolor:off rc.fontunderline:off};
qx{../src/task rc:font.rc add foo};
my $output = qx{../src/task 1 info rc:font.rc rc.color:off rc._forcecolor:off rc.fontunderline:off};
like ($output, qr/--------/, '0,0,0 -> dashes');
$output = qx{../task 1 info rc:font.rc rc.color:off rc._forcecolor:off rc.fontunderline:on};
$output = qx{../src/task 1 info rc:font.rc rc.color:off rc._forcecolor:off rc.fontunderline:on};
like ($output, qr/--------/, '0,0,1 -> dashes');
$output = qx{../task 1 info rc:font.rc rc.color:off rc._forcecolor:on rc.fontunderline:off};
$output = qx{../src/task 1 info rc:font.rc rc.color:off rc._forcecolor:on rc.fontunderline:off};
like ($output, qr/--------/, '0,1,0 -> dashes');
$output = qx{../task 1 info rc:font.rc rc.color:off rc._forcecolor:on rc.fontunderline:on};
$output = qx{../src/task 1 info rc:font.rc rc.color:off rc._forcecolor:on rc.fontunderline:on};
unlike ($output, qr/--------/, '0,1,1 -> underline');
$output = qx{../task 1 info rc:font.rc rc.color:on rc._forcecolor:off rc.fontunderline:off};
$output = qx{../src/task 1 info rc:font.rc rc.color:on rc._forcecolor:off rc.fontunderline:off};
like ($output, qr/--------/, '1,0,0 -> dashes');
$output = qx{../task 1 info rc:font.rc rc.color:on rc._forcecolor:off rc.fontunderline:on};
$output = qx{../src/task 1 info rc:font.rc rc.color:on rc._forcecolor:off rc.fontunderline:on};
like ($output, qr/--------/, '1,0,1 -> dashes');
$output = qx{../task 1 info rc:font.rc rc.color:on rc._forcecolor:on rc.fontunderline:off};
$output = qx{../src/task 1 info rc:font.rc rc.color:on rc._forcecolor:on rc.fontunderline:off};
like ($output, qr/--------/, '1,1,0 -> dashes');
$output = qx{../task 1 info rc:font.rc rc.color:on rc._forcecolor:on rc.fontunderline:on};
$output = qx{../src/task 1 info rc:font.rc rc.color:on rc._forcecolor:on rc.fontunderline:on};
unlike ($output, qr/--------/, '1,1,1 -> underline');
# Cleanup.

View file

@ -62,7 +62,7 @@ EOF
ok (-r 'pending.data', 'Created pending.data');
}
my $output = qx{../task rc:time.rc history.annual};
my $output = qx{../src/task rc:time.rc history.annual};
like ($output, qr/7\s+1\s+0\s+6/, 'history.annual - last year');
like ($output, qr/2\s+3\s+3\s+-4/, 'history.annual - this year');
like ($output, qr/4\s+2\s+1\s+1/, 'history.annual - average');

View file

@ -62,7 +62,7 @@ EOF
ok (-r 'pending.data', 'Created pending.data');
}
my $output = qx{../task rc:time.rc history.monthly};
my $output = qx{../src/task rc:time.rc history.monthly};
like ($output, qr/7\s+1\s+0\s+6/, 'history.monthly - last month');
like ($output, qr/2\s+3\s+3\s+-4/, 'history.monthly - this month');
like ($output, qr/4\s+2\s+1\s+1/, 'history.monthly - average');

View file

@ -48,12 +48,12 @@ if (open my $fh, '>', 'hook')
ok (-r 'hook', 'Created hook');
}
my $output = qx{../task rc:hook.rc version};
my $output = qx{../src/task rc:hook.rc version};
if ($output =~ /PUC-Rio/)
{
# Test the hook.
qx{../task rc:hook.rc add foo};
$output = qx{../task rc:hook.rc info 1};
qx{../src/task rc:hook.rc add foo};
$output = qx{../src/task rc:hook.rc info 1};
like ($output, qr/DEBUG MESSAGE/ms, 'Hook called task_debug_message');
}
else

View file

@ -47,11 +47,11 @@ if (open my $fh, '>', 'hook')
ok (-r 'hook', 'Created hook');
}
my $output = qx{../task rc:hook.rc version};
my $output = qx{../src/task rc:hook.rc version};
if ($output =~ /PUC-Rio/)
{
# Test the hook.
$output = qx{../task rc:hook.rc _version};
$output = qx{../src/task rc:hook.rc _version};
like ($output, qr/^Exiting.$/ms, 'Hook called task_exit');
}
else

View file

@ -55,11 +55,11 @@ if (open my $fh, '>', 'hook')
ok (-r 'hook', 'Created hook');
}
my $output = qx{../task rc:hook.rc version};
my $output = qx{../src/task rc:hook.rc version};
if ($output =~ /PUC-Rio/)
{
# Test the hook.
$output = qx{../task rc:hook.rc _version};
$output = qx{../src/task rc:hook.rc _version};
like ($output, qr/^<<lua>>$/ms, 'Hook called task_feature (lua)');
unlike ($output, qr/^<<foo>>$/ms, 'Hook called task_feature (foo)');
}

View file

@ -47,12 +47,12 @@ if (open my $fh, '>', 'hook')
ok (-r 'hook', 'Created hook');
}
my $output = qx{../task rc:hook.rc version};
my $output = qx{../src/task rc:hook.rc version};
if ($output =~ /PUC-Rio/)
{
# Test the hook.
qx{../task rc:hook.rc add foo};
$output = qx{../task rc:hook.rc info 1};
qx{../src/task rc:hook.rc add foo};
$output = qx{../src/task rc:hook.rc info 1};
like ($output, qr/FOOTNOTE MESSAGE/ms, 'Hook called task_footnote_message');
}
else

View file

@ -48,11 +48,11 @@ if (open my $fh, '>', 'hook')
ok (-r 'hook', 'Created hook');
}
my $output = qx{../task rc:hook.rc version};
my $output = qx{../src/task rc:hook.rc version};
if ($output =~ /PUC-Rio/)
{
# Test the hook.
$output = qx{../task rc:hook.rc _version};
$output = qx{../src/task rc:hook.rc _version};
like ($output, qr/^NAG-STRING$/ms, 'Hook called task_get_config');
}
else

View file

@ -47,12 +47,12 @@ if (open my $fh, '>', 'hook')
ok (-r 'hook', 'Created hook');
}
my $output = qx{../task rc:hook.rc version};
my $output = qx{../src/task rc:hook.rc version};
if ($output =~ /PUC-Rio/)
{
# Test the hook.
qx{../task rc:hook.rc add foo};
$output = qx{../task rc:hook.rc info 1};
qx{../src/task rc:hook.rc add foo};
$output = qx{../src/task rc:hook.rc info 1};
like ($output, qr/^<<foo>>$/ms, 'Hook called task_get_description');
}
else

View file

@ -50,12 +50,12 @@ if (open my $fh, '>', 'hook')
ok (-r 'hook', 'Created hook');
}
my $output = qx{../task rc:hook.rc version};
my $output = qx{../src/task rc:hook.rc version};
if ($output =~ /PUC-Rio/)
{
# Test the hook.
qx{../task rc:hook.rc add foo due:eom};
$output = qx{../task rc:hook.rc info 1};
qx{../src/task rc:hook.rc add foo due:eom};
$output = qx{../src/task rc:hook.rc info 1};
like ($output, qr/^<<\d+>>$/ms, 'Hook called task_get_due');
}
else

View file

@ -50,13 +50,13 @@ if (open my $fh, '>', 'hook')
ok (-r 'hook', 'Created hook');
}
my $output = qx{../task rc:hook.rc version};
my $output = qx{../src/task rc:hook.rc version};
if ($output =~ /PUC-Rio/)
{
# Test the hook.
qx{../task rc:hook.rc add foo};
qx{../task rc:hook.rc do 1};
$output = qx{../task rc:hook.rc info 1};
qx{../src/task rc:hook.rc add foo};
qx{../src/task rc:hook.rc do 1};
$output = qx{../src/task rc:hook.rc info 1};
like ($output, qr/^<<\d+>>$/ms, 'Hook called task_get_end');
}
else

View file

@ -50,12 +50,12 @@ if (open my $fh, '>', 'hook')
ok (-r 'hook', 'Created hook');
}
my $output = qx{../task rc:hook.rc version};
my $output = qx{../src/task rc:hook.rc version};
if ($output =~ /PUC-Rio/)
{
# Test the hook.
qx{../task rc:hook.rc add foo};
$output = qx{../task rc:hook.rc info 1};
qx{../src/task rc:hook.rc add foo};
$output = qx{../src/task rc:hook.rc info 1};
like ($output, qr/^<<\d+>>$/ms, 'Hook called task_get_entry');
}
else

View file

@ -47,12 +47,12 @@ if (open my $fh, '>', 'hook')
ok (-r 'hook', 'Created hook');
}
my $output = qx{../task rc:hook.rc version};
my $output = qx{../src/task rc:hook.rc version};
if ($output =~ /PUC-Rio/)
{
# Test the hook.
qx{../task rc:hook.rc add foo priority:M};
$output = qx{../task rc:hook.rc info 1};
qx{../src/task rc:hook.rc add foo priority:M};
$output = qx{../src/task rc:hook.rc info 1};
like ($output, qr/^<<M>>$/ms, 'Hook called task_get_priority');
}
else

View file

@ -47,12 +47,12 @@ if (open my $fh, '>', 'hook')
ok (-r 'hook', 'Created hook');
}
my $output = qx{../task rc:hook.rc version};
my $output = qx{../src/task rc:hook.rc version};
if ($output =~ /PUC-Rio/)
{
# Test the hook.
qx{../task rc:hook.rc add foo pro:PPP};
$output = qx{../task rc:hook.rc info 1};
qx{../src/task rc:hook.rc add foo pro:PPP};
$output = qx{../src/task rc:hook.rc info 1};
like ($output, qr/^<<PPP>>$/ms, 'Hook called task_get_project');
}
else

View file

@ -50,13 +50,13 @@ if (open my $fh, '>', 'hook')
ok (-r 'hook', 'Created hook');
}
my $output = qx{../task rc:hook.rc version};
my $output = qx{../src/task rc:hook.rc version};
if ($output =~ /PUC-Rio/)
{
# Test the hook.
qx{../task rc:hook.rc add foo};
qx{../task rc:hook.rc start 1};
$output = qx{../task rc:hook.rc info 1};
qx{../src/task rc:hook.rc add foo};
qx{../src/task rc:hook.rc start 1};
$output = qx{../src/task rc:hook.rc info 1};
like ($output, qr/^<<\d+>>$/ms, 'Hook called task_get_start');
}
else

Some files were not shown because too many files have changed in this diff Show more