mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unit Tests
- Corrected all unit tests that used the old syntax "task done 1" to use the new syntax "task 1 done". Similarly, "task 1 ..." is now "task 1 modify ...".
This commit is contained in:
parent
9ce7f63d85
commit
ac7bcc81ee
48 changed files with 177 additions and 177 deletions
|
@ -45,7 +45,7 @@ my $output = qx{../src/task rc:append.rc info 1};
|
|||
like ($output, qr/Description\s+foo\sbar\n/, 'append worked');
|
||||
|
||||
# Should cause an error when nothing is appended.
|
||||
$output = qx{../src/task rc:append.rc append 1};
|
||||
$output = qx{../src/task rc:append.rc 1 append};
|
||||
unlike ($output, qr/Appended 0 tasks/, 'blank append failed');
|
||||
|
||||
# Cleanup.
|
||||
|
|
|
@ -63,9 +63,9 @@ for my $i (1 .. 1000)
|
|||
diag ("1000 tasks added in " . (time () - $cursor) . " seconds");
|
||||
$cursor = time ();
|
||||
|
||||
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;
|
||||
qx{../src/task rc:bench.rc modify /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 ();
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ if (open my $fh, '>', 'bug.rc')
|
|||
# Setup: Add a recurring task then remove the due date.
|
||||
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:};
|
||||
qx{../src/task rc:bug.rc 2 modify due:};
|
||||
|
||||
# Result: Somehow the due date is incremented and wraps around to 12/31/1969,
|
||||
# then keeps going back to today.
|
||||
|
|
|
@ -45,23 +45,23 @@ 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{../src/task rc:bug.rc 1 project:bar};
|
||||
my $output = qx{../src/task rc:bug.rc 1 modify 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{../src/task rc:bug.rc 1 recur:};
|
||||
$output = qx{../src/task rc:bug.rc 1 modify 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{../src/task rc:bug.rc 1 due:};
|
||||
$output = qx{../src/task rc:bug.rc 1 modify 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{../src/task rc:bug.rc add nonrecurring};
|
||||
$output = qx{../src/task rc:bug.rc ls};
|
||||
my ($id) = $output =~ /(\d+)\s+nonrecurring/;
|
||||
$output = qx{../src/task rc:bug.rc $id due:};
|
||||
$output = qx{../src/task rc:bug.rc $id modify 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.
|
||||
|
|
|
@ -45,7 +45,7 @@ if (open my $fh, '>', '425.rc')
|
|||
# (this breaks in 1.9.3 and earlier)
|
||||
|
||||
qx{../src/task rc:425.rc add Foo};
|
||||
qx{../src/task rc:425.rc 1 Bar in Bar};
|
||||
qx{../src/task rc:425.rc 1 modify Bar in Bar};
|
||||
|
||||
my $output = qx{../src/task rc:425.rc 1 ls};
|
||||
like ($output, qr/1\s+Bar in Bar/m, 'parser - interpret \'in\' in description');
|
||||
|
|
|
@ -42,7 +42,7 @@ if (open my $fh, '>', 'bug.rc')
|
|||
|
||||
# Add a task that is waiting
|
||||
qx{../src/task rc:bug.rc add One wait:tomorrow};
|
||||
my $output = qx{../src/task rc:bug.rc do 1};
|
||||
my $output = qx{../src/task rc:bug.rc 1 done};
|
||||
like ($output, qr/Marked 1 task as done\./, 'Waiting task marked completed');
|
||||
|
||||
# Cleanup.
|
||||
|
|
|
@ -57,10 +57,10 @@ $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{../src/task rc:bug.rc start 1};
|
||||
qx{../src/task rc:bug.rc 1 start};
|
||||
diag ("1 second delay");
|
||||
sleep 1;
|
||||
qx{../src/task rc:bug.rc start 2};
|
||||
qx{../src/task rc:bug.rc 2 start};
|
||||
|
||||
$output = qx{../src/task rc:bug.rc rc.report.foo.sort:start+ foo};
|
||||
like ($output, qr/older.+newer/ms, 'sort:start+ -> older newer');
|
||||
|
@ -69,10 +69,10 @@ $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{../src/task rc:bug.rc done 1};
|
||||
qx{../src/task rc:bug.rc 1 done};
|
||||
diag ("1 second delay");
|
||||
sleep 1;
|
||||
qx{../src/task rc:bug.rc done 2};
|
||||
qx{../src/task rc:bug.rc 2 done};
|
||||
|
||||
$output = qx{../src/task rc:bug.rc rc.report.foo.sort:end+ foo};
|
||||
like ($output, qr/older.+newer/ms, 'sort:end+ -> older newer');
|
||||
|
|
|
@ -42,7 +42,7 @@ if (open my $fh, '>', '441.rc')
|
|||
|
||||
# Bug #441: A colon messes up text replacement with ///
|
||||
qx{../src/task rc:441.rc add one two three};
|
||||
qx{../src/task rc:441.rc 1 /two/two:/};
|
||||
qx{../src/task rc:441.rc 1 modify /two/two:/};
|
||||
my $output = qx{../src/task rc:441.rc ls};
|
||||
like ($output, qr/one two: three/ms, 'Substitution with colon worked');
|
||||
|
||||
|
|
|
@ -83,9 +83,9 @@ unlike ($output, qr/two/, 'Triple: no t2');
|
|||
unlike ($output, qr/three/, 'Triple: no t3');
|
||||
|
||||
# Once again, with @ characters.
|
||||
qx{../src/task rc:bug.rc 1 +\@1};
|
||||
qx{../src/task rc:bug.rc 2 +\@2};
|
||||
qx{../src/task rc:bug.rc 3 +\@3};
|
||||
qx{../src/task rc:bug.rc 1 modify +\@1};
|
||||
qx{../src/task rc:bug.rc 2 modify +\@2};
|
||||
qx{../src/task rc:bug.rc 3 modify +\@3};
|
||||
|
||||
$output = qx{../src/task rc:bug.rc list -\@1};
|
||||
unlike ($output, qr/one/, 'Single: no @1');
|
||||
|
@ -103,9 +103,9 @@ unlike ($output, qr/two/, 'Triple: no @2');
|
|||
unlike ($output, qr/three/, 'Triple: no @3');
|
||||
|
||||
# Once again, with @ characters and punctuation.
|
||||
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};
|
||||
qx{../src/task rc:bug.rc 1 modify +\@foo.1};
|
||||
qx{../src/task rc:bug.rc 2 modify +\@foo.2};
|
||||
qx{../src/task rc:bug.rc 3 modify +\@foo.3};
|
||||
|
||||
$output = qx{../src/task rc:bug.rc list -\@foo.1};
|
||||
unlike ($output, qr/one/, 'Single: no @foo.1');
|
||||
|
|
|
@ -45,7 +45,7 @@ if (open my $fh, '>', 'bug.rc')
|
|||
qx{../src/task rc:bug.rc add Pay teh rent on teh 31st};
|
||||
|
||||
# Process: Global replace incorrect text
|
||||
qx{../src/task rc:bug.rc 1 /teh/the/g};
|
||||
qx{../src/task rc:bug.rc 1 modify /teh/the/g};
|
||||
|
||||
# Result: Verify corrected output
|
||||
my $output = qx{../src/task rc:bug.rc ls 1};
|
||||
|
|
|
@ -46,7 +46,7 @@ if (open my $fh, '>', 'bug.rc')
|
|||
qx{../src/task rc:bug.rc add Test due:3d rec:1w};
|
||||
|
||||
# Result: Immediately delete the created task
|
||||
my $output = qx{../src/task rc:bug.rc done 1};
|
||||
my $output = qx{../src/task rc:bug.rc 1 done};
|
||||
unlike ($output, qr/Completed/ms, 'New recurring task cannot be immediately completed.');
|
||||
|
||||
# Cleanup.
|
||||
|
|
|
@ -46,10 +46,10 @@ qx{../src/task rc:bug.rc add Two};
|
|||
qx{../src/task rc:bug.rc add Three};
|
||||
|
||||
# Complete task 1 and then attempt to complete task 2
|
||||
qx{../src/task rc:bug.rc do 1};
|
||||
qx{../src/task rc:bug.rc 1 done};
|
||||
|
||||
# Result: Immediately delete the created task
|
||||
my $output = qx{../src/task rc:bug.rc do 2};
|
||||
my $output = qx{../src/task rc:bug.rc 2 done};
|
||||
like ($output, qr/Two/ms, 'IDs correctly remain unchanged after done');
|
||||
|
||||
# Cleanup.
|
||||
|
|
|
@ -56,7 +56,7 @@ like ($output, qr/Annotation one/, 'original annotation one');
|
|||
like ($output, qr/Annotation two/, 'original annotation two');
|
||||
like ($output, qr/Annotation three/, 'original annotation three');
|
||||
|
||||
qx{../src/task rc:bug.rc 1 /i/I/g};
|
||||
qx{../src/task rc:bug.rc 1 modify /i/I/g};
|
||||
$output = qx{../src/task rc:bug.rc list};
|
||||
like ($output, qr/ThIs Is a test/, 'new description');
|
||||
like ($output, qr/AnnotatIon one/, 'new annotation one');
|
||||
|
|
|
@ -55,16 +55,16 @@ qx{../src/task rc:bug.rc add Nine pro:p1};
|
|||
qx{../src/task rc:bug.rc add Ten pro:p1};
|
||||
|
||||
# Complete three tasks and ensure pending and done counts are updated correctly.
|
||||
my $output = qx{../src/task rc:bug.rc do 1-3};
|
||||
my $output = qx{../src/task rc:bug.rc 1-3 do};
|
||||
like ($output, qr/Project 'p1' is 30% complete \(7 of 10 tasks remaining\)\./ms, 'Project counts correct for a multiple done');
|
||||
|
||||
# Change three projects and ensure pending and done counts are updated correctly.
|
||||
$output = qx{../src/task rc:bug.rc 4-6 pro:p2};
|
||||
$output = qx{../src/task rc:bug.rc 4-6 modify pro:p2};
|
||||
like ($output, qr/Project 'p1' is 42% complete \(4 of 7 tasks remaining\)\./ms, 'Project counts correct for a multiple project reassignment part a');
|
||||
like ($output, qr/Project 'p2' is 0% complete \(3 of 3 tasks remaining\)\./ms, 'Project counts correct for a multiple project reassignment part b');
|
||||
|
||||
# Delete three tasks and ensure pending and done counts are updated correctly.
|
||||
$output = qx{../src/task rc:bug.rc del 7-9};
|
||||
$output = qx{../src/task rc:bug.rc 7-9 del};
|
||||
like ($output, qr/Project 'p1' is 75% complete \(1 of 4 tasks remaining\)\./ms, 'Project counts correct for a multiple delete');
|
||||
|
||||
# Cleanup.
|
||||
|
|
|
@ -49,10 +49,10 @@ 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"|../src/task rc:bulk.rc pro:p1 pri:M 4 5 6};
|
||||
my $output = qx{echo "-- quit"|../src/task rc:bulk.rc 4 5 6 modify pro:p1 pri:M};
|
||||
like ($output, qr/Modified 0 tasks/, '"quit" prevents any further modifications');
|
||||
|
||||
$output = qx{echo "-- All"|../src/task rc:bulk.rc pro:p1 pri:M 4 5 6};
|
||||
$output = qx{echo "-- All"|../src/task rc:bulk.rc 4 5 6 mod pro:p1 pri:M};
|
||||
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');
|
||||
|
|
|
@ -41,7 +41,7 @@ if (open my $fh, '>', 'bug_concat.rc')
|
|||
|
||||
# When a task is modified like this:
|
||||
#
|
||||
# % task 1 This is a new description
|
||||
# % task 1 modify This is a new description
|
||||
#
|
||||
# The arguments are concatenated thus:
|
||||
#
|
||||
|
@ -51,7 +51,7 @@ 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{../src/task rc:bug_concat.rc 1 This is the modified text};
|
||||
qx{../src/task rc:bug_concat.rc 1 modify 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');
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ qx{$setup};
|
|||
my $output = qx{../src/task rc:bug_sort.rc list};
|
||||
like ($output, qr/three.*(?:one.*two|two.*one)/msi, 'list did not hang');
|
||||
|
||||
qx{../src/task rc:bug_sort.rc 1 priority:H};
|
||||
qx{../src/task rc:bug_sort.rc 1 modify 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');
|
||||
|
||||
|
|
|
@ -44,8 +44,8 @@ if (open my $fh, '>', 'summary.rc')
|
|||
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};
|
||||
qx{../src/task rc:summary.rc 1 do};
|
||||
qx{../src/task rc:summary.rc 2 delete};
|
||||
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');
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ 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{../src/task rc:cal.rc ls};
|
||||
qx{../src/task rc:cal.rc del 1-3};
|
||||
qx{../src/task rc:cal.rc 1-3 del};
|
||||
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');
|
||||
|
|
|
@ -45,43 +45,43 @@ my $output;
|
|||
|
||||
# Description substitution.
|
||||
# 2
|
||||
qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes 1 /One/ONE/};
|
||||
qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes 1 modify /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{../src/task rc:caseless.rc rc.search.case.sensitive:no 1 /One/ONE/};
|
||||
qx{../src/task rc:caseless.rc rc.search.case.sensitive:no 1 modify /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{../src/task rc:caseless.rc rc.search.case.sensitive:yes 1 /one/One/};
|
||||
qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes 1 modify /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{../src/task rc:caseless.rc rc.search.case.sensitive:no 1 /one/one/};
|
||||
qx{../src/task rc:caseless.rc rc.search.case.sensitive:no 1 modify /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{../src/task rc:caseless.rc rc.search.case.sensitive:yes 1 /Five/FIVE/};
|
||||
qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes 1 modify /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{../src/task rc:caseless.rc rc.search.case.sensitive:no 1 /Five/FIVE/};
|
||||
qx{../src/task rc:caseless.rc rc.search.case.sensitive:no 1 modify /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{../src/task rc:caseless.rc rc.search.case.sensitive:yes 1 /five/Five/};
|
||||
qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes 1 modify /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{../src/task rc:caseless.rc rc.search.case.sensitive:no 1 /five/five/};
|
||||
qx{../src/task rc:caseless.rc rc.search.case.sensitive:no 1 modify /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');
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ if (open my $fh, '>', 'color.rc')
|
|||
# Test the add command.
|
||||
qx{../src/task rc:color.rc add nothing};
|
||||
qx{../src/task rc:color.rc add red};
|
||||
qx{../src/task rc:color.rc start 2};
|
||||
qx{../src/task rc:color.rc 2 start};
|
||||
my $output = qx{../src/task rc:color.rc list};
|
||||
|
||||
like ($output, qr/ (?!<\033\[\d\dm) .* nothing .* (?!>\033\[0m) /x, 'none');
|
||||
|
|
|
@ -44,7 +44,7 @@ if (open my $fh, '>', 'color.rc')
|
|||
# Test the add command.
|
||||
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};
|
||||
qx{../src/task rc:color.rc 1 modify depends:2};
|
||||
my $output = qx{../src/task rc:color.rc list};
|
||||
|
||||
like ($output, qr/ (?!<\033\[\d\dm) .* nothing .* (?!>\033\[0m) /x, 'none');
|
||||
|
|
|
@ -50,49 +50,49 @@ if (open my $fh, '>', 'response.txt')
|
|||
qx{../src/task rc:confirm.rc add foo} for 1..10;
|
||||
|
||||
# Test the various forms of "Yes".
|
||||
my $output = qx{echo "-- Yes" | ../src/task rc:confirm.rc del 1};
|
||||
my $output = qx{echo "-- Yes" | ../src/task rc:confirm.rc 1 del};
|
||||
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" | ../src/task rc:confirm.rc del 2};
|
||||
$output = qx{echo "-- ye" | ../src/task rc:confirm.rc 2 del};
|
||||
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" | ../src/task rc:confirm.rc del 3};
|
||||
$output = qx{echo "-- y" | ../src/task rc:confirm.rc 3 del};
|
||||
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" | ../src/task rc:confirm.rc del 4};
|
||||
$output = qx{echo "-- YES" | ../src/task rc:confirm.rc 4 del};
|
||||
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" | ../src/task rc:confirm.rc del 5};
|
||||
$output = qx{echo "-- YE" | ../src/task rc:confirm.rc 5 del};
|
||||
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" | ../src/task rc:confirm.rc del 6};
|
||||
$output = qx{echo "-- Y" | ../src/task rc:confirm.rc 6 del};
|
||||
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" | ../src/task rc:confirm.rc del 7};
|
||||
$output = qx{echo "-- no" | ../src/task rc:confirm.rc 7 del};
|
||||
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" | ../src/task rc:confirm.rc del 7};
|
||||
$output = qx{echo "-- n" | ../src/task rc:confirm.rc 7 del};
|
||||
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" | ../src/task rc:confirm.rc del 7};
|
||||
$output = qx{echo "-- NO" | ../src/task rc:confirm.rc 7 del};
|
||||
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" | ../src/task rc:confirm.rc del 7};
|
||||
$output = qx{echo "-- N" | ../src/task rc:confirm.rc 7 del};
|
||||
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" | ../src/task rc:confirm.rc 7-10 +bar};
|
||||
$output = qx{echo -e "-- y\nY\nY\nY\nY" | ../src/task rc:confirm.rc 7-10 modify +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" | ../src/task rc:confirm.rc 7-10 -bar};
|
||||
$output = qx{echo -e "-- N\nn\nn\nn\nn" | ../src/task rc:confirm.rc 7-10 modify -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" | ../src/task rc:confirm.rc 7-10 -bar};
|
||||
$output = qx{echo -e "-- a\nA" | ../src/task rc:confirm.rc 7-10 modify -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" | ../src/task rc:confirm.rc 7-10 +bar};
|
||||
$output = qx{echo "-- q" | ../src/task rc:confirm.rc 7-10 modify +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 | ../src/task rc:confirm.rc del 7};
|
||||
$output = qx{cat response.txt | ../src/task rc:confirm.rc 7 del};
|
||||
like ($output, qr/(Permanently delete task 7 'foo'\? \(y\/n\)) \1 \1/, 'confirmation - \n re-prompt works');
|
||||
|
||||
# Cleanup.
|
||||
|
|
|
@ -43,7 +43,7 @@ if (open my $fh, '>', 'count.rc')
|
|||
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 3 delete};
|
||||
qx{../src/task rc:count.rc add four wait:eom};
|
||||
qx{../src/task rc:count.rc add five due:eom recur:monthly};
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ if (open my $fh, '>', 'custom.rc')
|
|||
|
||||
# Generate the help screen, and locate the custom report on it.
|
||||
my $output = qx{../src/task rc:custom.rc help};
|
||||
like ($output, qr/task foo \[tags\] \[attrs\] desc\.\.\.\s+DESC\n/m, 'report.foo');
|
||||
like ($output, qr/task foo \[<filter>\]\s+DESC\n/m, 'report.foo');
|
||||
|
||||
qx{../src/task rc:custom.rc add project:A one};
|
||||
qx{../src/task rc:custom.rc add two};
|
||||
|
|
|
@ -45,7 +45,7 @@ my $output = qx{../src/task rc:delete.rc add one; ../src/task rc:delete.rc info
|
|||
ok (-r 'pending.data', 'pending.data created');
|
||||
like ($output, qr/Status\s+Pending\n/, 'Pending');
|
||||
|
||||
$output = qx{../src/task rc:delete.rc delete 1; ../src/task rc:delete.rc info 1};
|
||||
$output = qx{../src/task rc:delete.rc 1 delete; ../src/task rc:delete.rc info 1};
|
||||
like ($output, qr/Status\s+Deleted\n/, 'Deleted');
|
||||
ok (-r 'completed.data', 'completed.data created');
|
||||
|
||||
|
@ -53,7 +53,7 @@ $output = qx{echo '-- y' | ../src/task rc:delete.rc undo; ../src/task rc:delete.
|
|||
like ($output, qr/Status\s+Pending\n/, 'Pending');
|
||||
ok (-r 'completed.data', 'completed.data created');
|
||||
|
||||
$output = qx{../src/task rc:delete.rc delete 1; ../src/task rc:delete.rc list};
|
||||
$output = qx{../src/task rc:delete.rc 1 delete; ../src/task rc:delete.rc list};
|
||||
like ($output, qr/No matches./, 'No matches');
|
||||
ok (-r 'completed.data', 'completed.data created');
|
||||
|
||||
|
|
|
@ -73,35 +73,35 @@ 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{../src/task rc:denotate.rc denotate 1 Ernie};
|
||||
qx{../src/task rc:denotate.rc 1 denotate 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{../src/task rc:denotate.rc denotate 1 Bi};
|
||||
qx{../src/task rc:denotate.rc 1 denotate 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{../src/task rc:denotate.rc denotate 1 BErt};
|
||||
qx{../src/task rc:denotate.rc 1 denotate 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{../src/task rc:denotate.rc denotate 1 Kermit};
|
||||
qx{../src/task rc:denotate.rc 1 denotate 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{../src/task rc:denotate.rc denotate 1 Kermit the};
|
||||
qx{../src/task rc:denotate.rc 1 denotate 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{../src/task rc:denotate.rc denotate 1 Kermit a};
|
||||
qx{../src/task rc:denotate.rc 1 denotate 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');
|
||||
|
|
|
@ -49,19 +49,19 @@ qx{../src/task rc:dep.rc add One};
|
|||
qx{../src/task rc:dep.rc add Two};
|
||||
|
||||
# [2]
|
||||
my $output = qx{../src/task rc:dep.rc 1 dep:-2};
|
||||
my $output = qx{../src/task rc:dep.rc 1 modify dep:-2};
|
||||
like ($output, qr/Modified 0 tasks\./, 'dependencies - remove nonexistent dependency');
|
||||
|
||||
# [3]
|
||||
$output = qx{../src/task rc:dep.rc 1 dep:99};
|
||||
$output = qx{../src/task rc:dep.rc 1 modify dep:99};
|
||||
like ($output, qr/Could not create a dependency on task 99 - not found\./, 'dependencies - add dependency for nonexistent task');
|
||||
|
||||
# [4]
|
||||
$output = qx{../src/task rc:dep.rc 99 dep:1};
|
||||
$output = qx{../src/task rc:dep.rc 99 modify 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{../src/task rc:dep.rc 1 dep:2; ../src/task rc:dep.rc info 1};
|
||||
$output = qx{../src/task rc:dep.rc 1 modify 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');
|
||||
|
||||
|
@ -71,24 +71,24 @@ unlike ($output, qr/This task blocked by/, 'dependencies - trivial
|
|||
like ($output, qr/This task is blocking\s+1 One\nUUID/, 'dependencies - trivial blocking');
|
||||
|
||||
# [9] t 1 dep:2 (again)
|
||||
$output = qx{../src/task rc:dep.rc 1 dep:2};
|
||||
$output = qx{../src/task rc:dep.rc 1 modify 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{../src/task rc:dep.rc 1 dep:1};
|
||||
$output = qx{../src/task rc:dep.rc 1 modify 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{../src/task rc:dep.rc 2 dep:1};
|
||||
$output = qx{../src/task rc:dep.rc 2 modify 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{../src/task rc:dep.rc 1 dep:2};
|
||||
qx{../src/task rc:dep.rc 1 modify 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};
|
||||
qx{../src/task rc:dep.rc 2 modify dep:3};
|
||||
$output = qx{../src/task rc:dep.rc 1 modify dep:3};
|
||||
unlike ($output, qr/Circular dependency detected and disallowed\./, 'dependencies - diamond, non-circular');
|
||||
like ($output, qr/Modified 1 task\./, 'dependencies - diamond, non-circular');
|
||||
|
||||
|
@ -102,10 +102,10 @@ 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 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};
|
||||
qx{../src/task rc:dep.rc 5 modify dep:4; ../src/task rc:dep.rc 4 modify dep:3; ../src/task rc:dep.rc 3 modify dep:2; ../src/task rc:dep.rc 2 modify dep:1};
|
||||
|
||||
# [17,18] 5 dep 4 dep 3 dep 2 dep 1 dep 5 => error
|
||||
$output = qx{../src/task rc:dep.rc 1 dep:5};
|
||||
$output = qx{../src/task rc:dep.rc 1 modify dep:5};
|
||||
like ($output, qr/Circular dependency detected and disallowed\./, 'dependencies - nontrivial circular');
|
||||
unlike ($output, qr/Modified 1 task\./, 'dependencies - nontrivial circular');
|
||||
|
||||
|
@ -122,19 +122,19 @@ qx{../src/task rc:dep.rc add Six recurring due:tomorrow recur:daily};
|
|||
|
||||
# [20]
|
||||
qx{../src/task rc:dep.rc ls}; # To force handleRecurrence call.
|
||||
$output = qx{../src/task rc:dep.rc 6 dep:5};
|
||||
$output = qx{../src/task rc:dep.rc 6 modify dep:5};
|
||||
like ($output, qr/Modified \d+ task/, 'dependencies - recurring task depending on another task');
|
||||
|
||||
# [21]
|
||||
$output = qx{../src/task rc:dep.rc 4 dep:5};
|
||||
$output = qx{../src/task rc:dep.rc 4 modify 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{../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};
|
||||
$output = qx{../src/task rc:dep.rc 1 modify dep:2,3,4; ../src/task rc:dep.rc 1 modify 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{../src/task rc:dep.rc do 3,5; ../src/task rc:dep.rc info 1};
|
||||
$output = qx{../src/task rc:dep.rc 3,5 do; ../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');
|
||||
|
||||
|
@ -151,15 +151,15 @@ 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 1 dep:3,4};
|
||||
qx{../src/task rc:dep.rc do 2};
|
||||
qx{../src/task rc:dep.rc 1 modify dep:3,4};
|
||||
qx{../src/task rc:dep.rc 2 do};
|
||||
|
||||
# [27]
|
||||
$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{../src/task rc:dep.rc do 3};
|
||||
qx{../src/task rc:dep.rc 3 do};
|
||||
$output = qx{../src/task rc:dep.rc depreport};
|
||||
like ($output, qr/\s1\s+2\s+One\s+/, 'dependencies - depends report column reflects completed dependencies');
|
||||
|
||||
|
@ -172,19 +172,19 @@ 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 2 dep:1; ../src/task rc:dep.rc 3 dep:2; ../src/task rc:dep.rc 4 dep:3};
|
||||
qx{../src/task rc:dep.rc 2 modify dep:1; ../src/task rc:dep.rc 3 modify dep:2; ../src/task rc:dep.rc 4 modify dep:3};
|
||||
|
||||
# [30,31]
|
||||
$output = qx{echo '-- y' | ../src/task rc:dep.rc do 2};
|
||||
$output = qx{echo '-- y' | ../src/task rc:dep.rc 2 do};
|
||||
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' | ../src/task rc:dep.rc do 1};
|
||||
$output = qx{echo '-- y' | ../src/task rc:dep.rc 1 do};
|
||||
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' | ../src/task rc:dep.rc del 4};
|
||||
$output = qx{echo '-- y' | ../src/task rc:dep.rc 4 del};
|
||||
unlike ($output, qr/fixed/, 'dependencies - user not prompted to fix broken chain when the tail of the chain is deleted');
|
||||
|
||||
# [34]
|
||||
|
@ -197,23 +197,23 @@ 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 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};
|
||||
qx{../src/task rc:dep.rc 2 modify dep:1};
|
||||
qx{../src/task rc:dep.rc 3 modify dep:2};
|
||||
qx{../src/task rc:dep.rc 4 modify dep:3};
|
||||
qx{../src/task rc:dep.rc 5 modify dep:4};
|
||||
|
||||
# [35]
|
||||
qx{echo '-- y' | ../src/task rc:dep.rc do 2};
|
||||
qx{echo '-- y' | ../src/task rc:dep.rc 2 do};
|
||||
$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{echo "-- Y\nY\n" | ../src/task rc:dep.rc del 2};
|
||||
qx{echo "-- Y\nY\n" | ../src/task rc:dep.rc 2 del};
|
||||
$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{../src/task rc:dep.rc 2 dep:-1};
|
||||
qx{../src/task rc:dep.rc 2 modify 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');
|
||||
|
||||
|
|
|
@ -40,14 +40,14 @@ if (open my $fh, '>', 'dup.rc')
|
|||
|
||||
# Test the duplicate command.
|
||||
qx{../src/task rc:dup.rc add foo};
|
||||
qx{../src/task rc:dup.rc duplicate 1};
|
||||
qx{../src/task rc:dup.rc 1 duplicate};
|
||||
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{../src/task rc:dup.rc duplicate 1 priority:H /foo/FOO/ +tag};
|
||||
qx{../src/task rc:dup.rc 1 duplicate 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');
|
||||
|
@ -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{../src/task rc:dup.rc duplicate 1};
|
||||
$output = qx{../src/task rc:dup.rc 1 duplicate};
|
||||
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');
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ if (open my $fh, '>', 'enp.rc')
|
|||
# Test the en passant feature.
|
||||
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};
|
||||
qx{../src/task rc:enp.rc 1,2 do /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');
|
||||
|
|
|
@ -42,10 +42,10 @@ if (open my $fh, '>', 'bug.rc')
|
|||
# Feature 608: Done should stop a task
|
||||
|
||||
# Setup: Add and start a task
|
||||
qx{../src/task rc:bug.rc add Test due:3d; ../src/task rc:bug.rc start 1};
|
||||
qx{../src/task rc:bug.rc add Test due:3d; ../src/task rc:bug.rc 1 start};
|
||||
|
||||
# Mark the task as completed
|
||||
qx{../src/task rc:bug.rc done 1};
|
||||
qx{../src/task rc:bug.rc 1 done};
|
||||
|
||||
# Check to ensure task was stopped
|
||||
my $output = qx{../src/task rc:bug.rc info 1};
|
||||
|
|
|
@ -42,7 +42,7 @@ if (open my $fh, '>', 'projects.rc')
|
|||
# pending, one completed.
|
||||
qx{../src/task rc:projects.rc add project:p1 one};
|
||||
qx{../src/task rc:projects.rc add project:p2 two};
|
||||
qx{../src/task rc:projects.rc done 1};
|
||||
qx{../src/task rc:projects.rc 1 done};
|
||||
my $output = qx{../src/task rc:projects.rc ls};
|
||||
unlike ($output, qr/p1/, 'p1 done');
|
||||
like ($output, qr/p2/, 'p2 pending');
|
||||
|
|
|
@ -43,7 +43,7 @@ if (open my $fh, '>', 'tags.rc')
|
|||
# pending, one completed.
|
||||
qx{../src/task rc:tags.rc add +t1 one};
|
||||
qx{../src/task rc:tags.rc add +t2 two};
|
||||
qx{../src/task rc:tags.rc done 1};
|
||||
qx{../src/task rc:tags.rc 1 done};
|
||||
my $output = qx{../src/task rc:tags.rc long};
|
||||
unlike ($output, qr/t1/, 't1 done');
|
||||
like ($output, qr/t2/, 't2 pending');
|
||||
|
|
32
test/merge.t
32
test/merge.t
|
@ -95,45 +95,45 @@ copy("local/completed.data", "remote/completed.data") or fail("copy local/undo.d
|
|||
# make local modifications
|
||||
qx{../src/task rc:local.rc add left_added}; #left_added
|
||||
sleep(1);
|
||||
qx{../src/task rc:local.rc 1 prio:H}; #left_modified
|
||||
qx{../src/task rc:local.rc 1 modify prio:H}; #left_modified
|
||||
sleep(1);
|
||||
qx{../src/task rc:local.rc 3 +stay}; #left_newer
|
||||
qx{../src/task rc:local.rc 3 modify +stay}; #left_newer
|
||||
sleep(1);
|
||||
qx{../src/task rc:local.rc 4 project:test}; #right_newer
|
||||
qx{../src/task rc:local.rc 4 modify project:test}; #right_newer
|
||||
sleep(1);
|
||||
qx{../src/task rc:local.rc 6 +delete}; #right_deleted
|
||||
qx{../src/task rc:local.rc 6 modify +delete}; #right_deleted
|
||||
sleep(1);
|
||||
|
||||
# make remote modifications
|
||||
qx{../src/task rc:remote.rc add right_added}; #right_added
|
||||
sleep(1);
|
||||
qx{../src/task rc:remote.rc 2 prio:L}; #right_modified
|
||||
qx{../src/task rc:remote.rc 2 modify prio:L}; #right_modified
|
||||
sleep(1);
|
||||
qx{../src/task rc:remote.rc 2 wait:tomorrow}; #right_modified
|
||||
qx{../src/task rc:remote.rc 2 modify wait:tomorrow}; #right_modified
|
||||
sleep(1);
|
||||
qx{../src/task rc:remote.rc 4 proj:realProject}; #right_newer
|
||||
qx{../src/task rc:remote.rc 4 modify proj:realProject}; #right_newer
|
||||
sleep(1);
|
||||
qx{../src/task rc:remote.rc 5 project:deletion}; #left_deleted
|
||||
qx{../src/task rc:remote.rc 5 modify project:deletion}; #left_deleted
|
||||
sleep(1);
|
||||
qx{../src/task rc:remote.rc done 8}; #right_completed
|
||||
qx{../src/task rc:remote.rc 8 done}; #right_completed
|
||||
sleep(1);
|
||||
qx{../src/task rc:remote.rc del 6}; #right_deleted
|
||||
qx{../src/task rc:remote.rc 6 del}; #right_deleted
|
||||
sleep(1);
|
||||
qx{../src/task rc:remote.rc done 3}; #left_newer
|
||||
qx{../src/task rc:remote.rc 3 done}; #left_newer
|
||||
sleep(1);
|
||||
|
||||
# make new local modifications
|
||||
qx{../src/task rc:local.rc start 3}; #left_newer
|
||||
qx{../src/task rc:local.rc 3 start}; #left_newer
|
||||
sleep(1);
|
||||
qx{../src/task rc:local.rc 4 +car}; #right_newer
|
||||
qx{../src/task rc:local.rc 4 modify +car}; #right_newer
|
||||
sleep(1);
|
||||
qx{../src/task rc:local.rc done 7}; #left_completed
|
||||
qx{../src/task rc:local.rc 7 done}; #left_completed
|
||||
sleep(1);
|
||||
qx{../src/task rc:local.rc del 5}; #left_deleted
|
||||
qx{../src/task rc:local.rc 5 del}; #left_deleted
|
||||
sleep(1);
|
||||
|
||||
# make new remote modifications
|
||||
qx{../src/task rc:remote.rc 4 +gym}; # right_newer
|
||||
qx{../src/task rc:remote.rc 4 modify +gym}; # right_newer
|
||||
|
||||
# merge remote into local
|
||||
copy("local/undo.data", "local/undo.save") or fail("copy local/undo.data to local/undo.save");
|
||||
|
|
12
test/nag.t
12
test/nag.t
|
@ -47,12 +47,12 @@ my $setup = "../src/task rc:nag.rc add due:yesterday one;"
|
|||
. "../src/task rc:nag.rc add six;";
|
||||
qx{$setup};
|
||||
|
||||
like (qx{../src/task rc:nag.rc do 6}, qr/NAG/, 'do pri: -> nag');
|
||||
like (qx{../src/task rc:nag.rc do 5}, qr/NAG/, 'do pri:L -> nag');
|
||||
like (qx{../src/task rc:nag.rc do 4}, qr/NAG/, 'do pri:M-> nag');
|
||||
like (qx{../src/task rc:nag.rc do 3}, qr/NAG/, 'do pri:H-> nag');
|
||||
like (qx{../src/task rc:nag.rc do 2}, qr/NAG/, 'do due:tomorrow -> nag');
|
||||
unlike (qx{../src/task rc:nag.rc do 1}, qr/NAG/, 'do due:yesterday -> no nag');
|
||||
like (qx{../src/task rc:nag.rc 6 do}, qr/NAG/, 'do pri: -> nag');
|
||||
like (qx{../src/task rc:nag.rc 5 do}, qr/NAG/, 'do pri:L -> nag');
|
||||
like (qx{../src/task rc:nag.rc 4 do}, qr/NAG/, 'do pri:M-> nag');
|
||||
like (qx{../src/task rc:nag.rc 3 do}, qr/NAG/, 'do pri:H-> nag');
|
||||
like (qx{../src/task rc:nag.rc 2 do}, qr/NAG/, 'do due:tomorrow -> nag');
|
||||
unlike (qx{../src/task rc:nag.rc 1 do}, qr/NAG/, 'do due:yesterday -> no nag');
|
||||
|
||||
# Cleanup.
|
||||
unlink 'pending.data';
|
||||
|
|
|
@ -45,7 +45,7 @@ my $output = qx{../src/task rc:prepend.rc info 1};
|
|||
like ($output, qr/Description\s+foo\sbar\n/, 'prepend worked');
|
||||
|
||||
# Should cause an error when nothing is appended.
|
||||
$output = qx{../src/task rc:prepend.rc prepend 1};
|
||||
$output = qx{../src/task rc:prepend.rc 1 prepend};
|
||||
unlike ($output, qr/Prepended 0 tasks/, 'blank prepend failed');
|
||||
|
||||
# Cleanup.
|
||||
|
|
|
@ -58,12 +58,12 @@ like ($output, qr/Project 'foo' is 25% complete \(3 of 4 tasks remaining\)\./, '
|
|||
$output = qx{../src/task rc:pro.rc 2 delete};
|
||||
like ($output, qr/The project 'foo' has changed\. Project 'foo' is 33% complete \(2 of 3 tasks remaining\)\./, 'delete two');
|
||||
|
||||
$output = qx{../src/task rc:pro.rc 3 pro:bar};
|
||||
$output = qx{../src/task rc:pro.rc 3 modify pro:bar};
|
||||
like ($output, qr/The project 'foo' has changed\. Project 'foo' is 50% complete \(1 of 2 tasks remaining\)\./, 'change project');
|
||||
like ($output, qr/The project 'bar' has changed\. Project 'bar' is 0% complete \(1 of 1 tasks remaining\)\./, 'change project');
|
||||
|
||||
# Test projects with spaces in them.
|
||||
$output = qx{../src/task rc:pro.rc 3 pro:"foo bar"};
|
||||
$output = qx{../src/task rc:pro.rc 3 modify pro:"foo bar"};
|
||||
like ($output, qr/The project 'foo bar' has changed\./, 'project with spaces');
|
||||
|
||||
# Cleanup.
|
||||
|
|
|
@ -48,7 +48,7 @@ like ($output, qr/^\s+3/ms, 'Found 3');
|
|||
like ($output, qr/^\s+4/ms, 'Found 4');
|
||||
like ($output, qr/^\s+5/ms, 'Found 5');
|
||||
|
||||
qx{../src/task rc:recur.rc do $_} for 1..5;
|
||||
qx{../src/task rc:recur.rc $_ do} for 1..5;
|
||||
$output = qx{../src/task rc:recur.rc list};
|
||||
like ($output, qr/and has been deleted/, 'Parent task deleted');
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ like ($output, qr/one/, 'recur weekdays');
|
|||
$output = qx{../src/task rc:recur.rc info 1};
|
||||
like ($output, qr/Recurrence\s+weekdays/, 'task recurs every weekday');
|
||||
|
||||
qx{../src/task rc:recur.rc do 1};
|
||||
qx{../src/task rc:recur.rc 1 do};
|
||||
$output = qx{../src/task rc:recur.rc list};
|
||||
|
||||
# Cleanup.
|
||||
|
|
|
@ -42,7 +42,7 @@ if (open my $fh, '>', 'seq.rc')
|
|||
# Test sequences in done/undo
|
||||
qx{../src/task rc:seq.rc add one mississippi};
|
||||
qx{../src/task rc:seq.rc add two mississippi};
|
||||
qx{../src/task rc:seq.rc do 1,2};
|
||||
qx{../src/task rc:seq.rc 1,2 do};
|
||||
my $output = qx{../src/task rc:seq.rc info 1};
|
||||
like ($output, qr/Status\s+Completed/, 'sequence do 1');
|
||||
$output = qx{../src/task rc:seq.rc info 2};
|
||||
|
@ -55,7 +55,7 @@ $output = qx{../src/task rc:seq.rc info 2};
|
|||
like ($output, qr/Status\s+Pending/, 'sequence undo 2');
|
||||
|
||||
# Test sequences in delete/undelete
|
||||
qx{../src/task rc:seq.rc delete 1,2};
|
||||
qx{../src/task rc:seq.rc 1,2 delete};
|
||||
$output = qx{../src/task rc:seq.rc info 1};
|
||||
like ($output, qr/Status\s+Deleted/, 'sequence delete 1');
|
||||
$output = qx{../src/task rc:seq.rc info 2};
|
||||
|
@ -68,31 +68,31 @@ $output = qx{../src/task rc:seq.rc info 2};
|
|||
like ($output, qr/Status\s+Pending/, 'sequence undo 2');
|
||||
|
||||
# Test sequences in start/stop
|
||||
qx{../src/task rc:seq.rc start 1,2};
|
||||
qx{../src/task rc:seq.rc 1,2 start};
|
||||
$output = qx{../src/task rc:seq.rc info 1};
|
||||
like ($output, qr/Start/, 'sequence start 1');
|
||||
$output = qx{../src/task rc:seq.rc info 2};
|
||||
like ($output, qr/Start/, 'sequence start 2');
|
||||
qx{../src/task rc:seq.rc stop 1,2};
|
||||
qx{../src/task rc:seq.rc 1,2 stop};
|
||||
$output = qx{../src/task rc:seq.rc info 1};
|
||||
like ($output, qr/Start\sdeleted/, 'sequence stop 1');
|
||||
$output = qx{../src/task rc:seq.rc info 2};
|
||||
like ($output, qr/Start\sdeleted/, 'sequence stop 2');
|
||||
|
||||
# Test sequences in modify
|
||||
qx{../src/task rc:seq.rc 1,2 +tag};
|
||||
qx{../src/task rc:seq.rc 1,2 modify +tag};
|
||||
$output = qx{../src/task rc:seq.rc info 1};
|
||||
like ($output, qr/Tags\s+tag/, 'sequence modify 1');
|
||||
$output = qx{../src/task rc:seq.rc info 2};
|
||||
like ($output, qr/Tags\s+tag/, 'sequence modify 2');
|
||||
qx{../src/task rc:seq.rc 1,2 -tag};
|
||||
qx{../src/task rc:seq.rc 1,2 modify -tag};
|
||||
$output = qx{../src/task rc:seq.rc info 1};
|
||||
unlike ($output, qr/Tags\s+tag/, 'sequence unmodify 1');
|
||||
$output = qx{../src/task rc:seq.rc info 2};
|
||||
unlike ($output, qr/Tags\s+tag/, 'sequence unmodify 2');
|
||||
|
||||
# Test sequences in substitutions
|
||||
qx{../src/task rc:seq.rc 1,2 /miss/Miss/};
|
||||
qx{../src/task rc:seq.rc 1,2 modify /miss/Miss/};
|
||||
$output = qx{../src/task rc:seq.rc info 1};
|
||||
like ($output, qr/Description\s+one Miss/, 'sequence substitution 1');
|
||||
$output = qx{../src/task rc:seq.rc info 2};
|
||||
|
@ -104,7 +104,7 @@ like ($output, qr/Description\s+one Miss/, 'sequence info 1');
|
|||
like ($output, qr/Description\s+two Miss/, 'sequence info 2');
|
||||
|
||||
# Test sequences in duplicate
|
||||
qx{../src/task rc:seq.rc duplicate 1,2 pri:H};
|
||||
qx{../src/task rc:seq.rc 1,2 duplicate pri:H};
|
||||
$output = qx{../src/task rc:seq.rc info 3};
|
||||
like ($output, qr/Priority\s+H/, 'sequence duplicate 1');
|
||||
$output = qx{../src/task rc:seq.rc info 4};
|
||||
|
|
|
@ -48,7 +48,7 @@ like ($output, qr/\[Shadow file '\.\/shadow\.txt' updated\.\]/, 'shadow file upd
|
|||
$output = qx{../src/task rc:shadow.rc list};
|
||||
unlike ($output, qr/\[Shadow file '\.\/shadow\.txt' updated\.\]/, 'shadow file not updated on list');
|
||||
|
||||
$output = qx{../src/task rc:shadow.rc delete 1};
|
||||
$output = qx{../src/task rc:shadow.rc 1 delete};
|
||||
like ($output, qr/\[Shadow file '\.\/shadow\.txt' updated\.\]/, 'shadow file updated on delete');
|
||||
|
||||
$output = qx{../src/task rc:shadow.rc list};
|
||||
|
|
|
@ -45,8 +45,8 @@ qx{../src/task rc:sorting.rc add priority:M project:B due:today two};
|
|||
qx{../src/task rc:sorting.rc add priority:L project:C due:tomorrow three};
|
||||
qx{../src/task rc:sorting.rc add priority:H project:C due:today four};
|
||||
|
||||
qx{../src/task rc:sorting.rc start 2};
|
||||
qx{../src/task rc:sorting.rc start 4};
|
||||
qx{../src/task rc:sorting.rc 2 start};
|
||||
qx{../src/task rc:sorting.rc 2 start};
|
||||
|
||||
my %tests =
|
||||
(
|
||||
|
|
|
@ -53,7 +53,7 @@ like ($output, qr/\033\[31mshould be red\s+\033\[0m/, 'red in second task');
|
|||
|
||||
# Prove that +nonag suppresses nagging when a low priority task is completed
|
||||
# ahead of a high priority one.
|
||||
$output = qx{../src/task rc:special.rc done 2};
|
||||
$output = qx{../src/task rc:special.rc 2 done};
|
||||
unlike ($output, qr/NAG/, '+nonag suppressed nagging for task 2');
|
||||
|
||||
# Cleanup.
|
||||
|
|
18
test/start.t
18
test/start.t
|
@ -45,23 +45,23 @@ my $output = qx{../src/task rc:start.rc active};
|
|||
unlike ($output, qr/one/, 'one not active');
|
||||
unlike ($output, qr/two/, 'two not active');
|
||||
|
||||
qx{../src/task rc:start.rc start 1};
|
||||
qx{../src/task rc:start.rc start 2};
|
||||
qx{../src/task rc:start.rc 1 start};
|
||||
qx{../src/task rc:start.rc 2 start};
|
||||
$output = qx{../src/task rc:start.rc active};
|
||||
like ($output, qr/one/, 'one active');
|
||||
like ($output, qr/two/, 'two active');
|
||||
|
||||
qx{../src/task rc:start.rc stop 1};
|
||||
qx{../src/task rc:start.rc 1 stop};
|
||||
$output = qx{../src/task rc:start.rc active};
|
||||
unlike ($output, qr/one/, 'one not active');
|
||||
like ($output, qr/two/, 'two active');
|
||||
|
||||
qx{../src/task rc:start.rc stop 2};
|
||||
qx{../src/task rc:start.rc 2 stop};
|
||||
$output = qx{../src/task rc:start.rc active};
|
||||
unlike ($output, qr/one/, 'one not active');
|
||||
unlike ($output, qr/two/, 'two not active');
|
||||
|
||||
qx{../src/task rc:start.rc done 2};
|
||||
qx{../src/task rc:start.rc 2 done};
|
||||
$output = qx{../src/task rc:start.rc list};
|
||||
unlike ($output, qr/two/, 'two deleted');
|
||||
|
||||
|
@ -74,11 +74,11 @@ if (open my $fh, '>', 'start2.rc')
|
|||
ok (-r 'start2.rc', 'Created start2.rc');
|
||||
}
|
||||
|
||||
qx{../src/task rc:start2.rc start 1};
|
||||
qx{../src/task rc:start2.rc 1 start};
|
||||
$output = qx{../src/task rc:start2.rc list};
|
||||
like ($output, qr/Started task/, 'one start and annotated');
|
||||
|
||||
qx{../src/task rc:start2.rc stop 1};
|
||||
qx{../src/task rc:start2.rc 1 stop};
|
||||
$output = qx{../src/task rc:start2.rc list};
|
||||
like ($output, qr/Stopped task/, 'one stopped and annotated');
|
||||
|
||||
|
@ -93,11 +93,11 @@ if (open my $fh, '>', 'start3.rc')
|
|||
ok (-r 'start3.rc', 'Created start3.rc');
|
||||
}
|
||||
|
||||
qx{../src/task rc:start3.rc start 1};
|
||||
qx{../src/task rc:start3.rc 1 start};
|
||||
$output = qx{../src/task rc:start3.rc list};
|
||||
like ($output, qr/Nu.+kör.+vi/ms, 'one start and annotated with custom description');
|
||||
|
||||
qx{../src/task rc:start3.rc stop 1};
|
||||
qx{../src/task rc:start3.rc 1 stop};
|
||||
$output = qx{../src/task rc:start3.rc list};
|
||||
like ($output, qr/Nu.+stannar.+vi/ms, 'one stopped and annotated with custom description');
|
||||
|
||||
|
|
|
@ -41,36 +41,36 @@ if (open my $fh, '>', 'subst.rc')
|
|||
|
||||
# Test the substitution command.
|
||||
qx{../src/task rc:subst.rc add foo foo foo};
|
||||
qx{../src/task rc:subst.rc 1 /foo/FOO/};
|
||||
qx{../src/task rc:subst.rc 1 modify /foo/FOO/};
|
||||
my $output = qx{../src/task rc:subst.rc info 1};
|
||||
like ($output, qr/FOO foo foo/, 'substitution in description');
|
||||
|
||||
qx{../src/task rc:subst.rc 1 /foo/FOO/g};
|
||||
qx{../src/task rc:subst.rc 1 modify /foo/FOO/g};
|
||||
$output = qx{../src/task rc:subst.rc info 1};
|
||||
like ($output, qr/FOO FOO FOO/, 'global substitution in description');
|
||||
|
||||
# Test the substitution command on annotations.
|
||||
qx{../src/task rc:subst.rc annotate 1 bar bar bar};
|
||||
qx{../src/task rc:subst.rc 1 /bar/BAR/};
|
||||
qx{../src/task rc:subst.rc 1 annotate bar bar bar};
|
||||
qx{../src/task rc:subst.rc 1 modify /bar/BAR/};
|
||||
$output = qx{../src/task rc:subst.rc info 1};
|
||||
like ($output, qr/BAR bar bar/, 'substitution in annotation');
|
||||
|
||||
qx{../src/task rc:subst.rc 1 /bar/BAR/g};
|
||||
qx{../src/task rc:subst.rc 1 modify /bar/BAR/g};
|
||||
$output = qx{../src/task rc:subst.rc info 1};
|
||||
like ($output, qr/BAR BAR BAR/, 'global substitution in annotation');
|
||||
|
||||
qx{../src/task rc:subst.rc 1 /FOO/aaa/};
|
||||
qx{../src/task rc:subst.rc 1 /FOO/bbb/};
|
||||
qx{../src/task rc:subst.rc 1 /FOO/ccc/};
|
||||
qx{../src/task rc:subst.rc 1 modify /FOO/aaa/};
|
||||
qx{../src/task rc:subst.rc 1 modify /FOO/bbb/};
|
||||
qx{../src/task rc:subst.rc 1 modify /FOO/ccc/};
|
||||
$output = qx{../src/task rc:subst.rc info 1};
|
||||
like ($output, qr/aaa bbb ccc/, 'individual successive substitution in description');
|
||||
|
||||
qx{../src/task rc:subst.rc 1 /bbb//};
|
||||
qx{../src/task rc:subst.rc 1 modify /bbb//};
|
||||
$output = qx{../src/task rc:subst.rc info 1};
|
||||
like ($output, qr/aaa ccc/, 'word deletion in description');
|
||||
|
||||
# Regexes
|
||||
qx{../src/task rc:subst.rc rc.regex:on 1 "/c(c)./C/"};
|
||||
qx{../src/task rc:subst.rc rc.regex:on 1 modify "/c(c)./C/"};
|
||||
$output = qx{../src/task rc:subst.rc info 1};
|
||||
like ($output, qr/aaa cCc/, 'regex');
|
||||
|
||||
|
|
10
test/tag.t
10
test/tag.t
|
@ -43,23 +43,23 @@ my $output = qx{../src/task rc:tag.rc add +one This +two is a test +three; ../sr
|
|||
like ($output, qr/^Tags\s+one two three\n/m, 'tags found');
|
||||
|
||||
# Remove tags.
|
||||
$output = qx{../src/task rc:tag.rc 1 -three -two -one; ../src/task rc:tag.rc info 1};
|
||||
$output = qx{../src/task rc:tag.rc 1 modify -three -two -one; ../src/task rc:tag.rc info 1};
|
||||
unlike ($output, qr/^Tags/m, '-three -two -one tag removed');
|
||||
|
||||
# Add tags.
|
||||
$output = qx{../src/task rc:tag.rc 1 +four +five +six; ../src/task rc:tag.rc info 1};
|
||||
$output = qx{../src/task rc:tag.rc 1 modify +four +five +six; ../src/task rc:tag.rc info 1};
|
||||
like ($output, qr/^Tags\s+four five six\n/m, 'tags found');
|
||||
|
||||
# Remove tags.
|
||||
$output = qx{../src/task rc:tag.rc 1 -four -five -six; ../src/task rc:tag.rc info 1};
|
||||
$output = qx{../src/task rc:tag.rc 1 modify -four -five -six; ../src/task rc:tag.rc info 1};
|
||||
unlike ($output, qr/^Tags/m, '-four -five -six tag removed');
|
||||
|
||||
# Add and remove tags.
|
||||
$output = qx{../src/task rc:tag.rc 1 +duplicate -duplicate; ../src/task rc:tag.rc info 1};
|
||||
$output = qx{../src/task rc:tag.rc 1 modify +duplicate -duplicate; ../src/task rc:tag.rc info 1};
|
||||
unlike ($output, qr/^Tags/m, '+duplicate -duplicate NOP');
|
||||
|
||||
# Remove missing tag.
|
||||
$output = qx{../src/task rc:tag.rc 1 -missing; ../src/task rc:tag.rc info 1};
|
||||
$output = qx{../src/task rc:tag.rc 1 modify -missing; ../src/task rc:tag.rc info 1};
|
||||
unlike ($output, qr/^Tags/m, '-missing NOP');
|
||||
|
||||
# Cleanup.
|
||||
|
|
|
@ -45,7 +45,7 @@ my $output = qx{../src/task rc:undo.rc add one; ../src/task rc:undo.rc info 1};
|
|||
ok (-r 'pending.data', 'pending.data created');
|
||||
like ($output, qr/Status\s+Pending\n/, 'Pending');
|
||||
|
||||
$output = qx{../src/task rc:undo.rc do 1; ../src/task rc:undo.rc info 1};
|
||||
$output = qx{../src/task rc:undo.rc 1 do; ../src/task rc:undo.rc info 1};
|
||||
ok (-r 'completed.data', 'completed.data created');
|
||||
like ($output, qr/Status\s+Completed\n/, 'Completed');
|
||||
|
||||
|
@ -53,7 +53,7 @@ $output = qx{../src/task rc:undo.rc undo; ../src/task rc:undo.rc info 1};
|
|||
ok (-r 'completed.data', 'completed.data created');
|
||||
like ($output, qr/Status\s+Pending\n/, 'Pending');
|
||||
|
||||
$output = qx{../src/task rc:undo.rc do 1; ../src/task rc:undo.rc list};
|
||||
$output = qx{../src/task rc:undo.rc 1 do; ../src/task rc:undo.rc list};
|
||||
like ($output, qr/No matches/, 'No matches');
|
||||
|
||||
# Cleanup.
|
||||
|
|
|
@ -55,7 +55,7 @@ $output = qx{../src/task rc:wait.rc ls};
|
|||
like ($output, qr/nowait/ms, 'non-waiting task still visible');
|
||||
like ($output, qr/yeswait/ms, 'waiting task now visible');
|
||||
|
||||
qx{../src/task rc:wait.rc 1 wait:2s};
|
||||
qx{../src/task rc:wait.rc 1 modify wait:2s};
|
||||
$output = qx{../src/task rc:wait.rc ls};
|
||||
like ($output, qr/nowait/ms, 'non-waiting task visible');
|
||||
unlike ($output, qr/yeswait/ms, 'waiting task invisible');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue