mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Hooks
- Removed obsolete hook unit tests.
This commit is contained in:
parent
87c285e6b2
commit
0240ffa1d2
30 changed files with 0 additions and 2540 deletions
|
@ -1,81 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"debug=on\n",
|
|
||||||
"hook.pre-display=" . $ENV{'PWD'} . "/hook:test\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function test () task_debug_message ('DEBUG MESSAGE') return 0, nil end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
# Test the hook.
|
|
||||||
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
|
|
||||||
{
|
|
||||||
pass ('Hook called task_debug_message - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,79 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.pre-exit=" . $ENV{'PWD'} . "/hook:test\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function test () task_exit () return 0, nil end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
# Test the hook.
|
|
||||||
$output = qx{../src/task rc:hook.rc _version};
|
|
||||||
like ($output, qr/^Exiting.$/ms, 'Hook called task_exit');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('Hook called task_exit - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,89 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 9;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.pre-exit=" . $ENV{'PWD'} . "/hook:test\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function test ()\n",
|
|
||||||
" if task_feature ('lua') then\n",
|
|
||||||
" print ('<<lua>>')\n",
|
|
||||||
" end\n",
|
|
||||||
" if task_feature ('foo') then\n",
|
|
||||||
" print ('<<foo>>')\n",
|
|
||||||
" end\n",
|
|
||||||
" return 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
# Test the hook.
|
|
||||||
$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)');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('Hook called task_feature (lua) - skip: no Lua support');
|
|
||||||
pass ('Hook called task_feature (foo) - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,80 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.pre-display=" . $ENV{'PWD'} . "/hook:test\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function test () task_footnote_message ('FOOTNOTE MESSAGE') return 0, nil end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
# Test the hook.
|
|
||||||
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
|
|
||||||
{
|
|
||||||
pass ('Hook called task_footnote_message - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,80 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"nag=NAG-STRING\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.post-start=" . $ENV{'PWD'} . "/hook:test\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function test () print (task_get_config ('nag')) return 0, nil end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
# Test the hook.
|
|
||||||
$output = qx{../src/task rc:hook.rc _version};
|
|
||||||
like ($output, qr/^NAG-STRING$/ms, 'Hook called task_get_config');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('Hook called task_get_config - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,80 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.pre-display=" . $ENV{'PWD'} . "/hook:test\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function test () task_header_message ('HEADER MESSAGE') return 0, nil end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
# Test the hook.
|
|
||||||
qx{../src/task rc:hook.rc add foo};
|
|
||||||
$output = qx{../src/task rc:hook.rc info 1};
|
|
||||||
like ($output, qr/HEADER MESSAGE/ms, 'Hook called task_header_message');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('Hook called task_header_message - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,79 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.pre-exit=" . $ENV{'PWD'} . "/hook:test\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function test () print ('<<' .. task_lua_version () .. '>>') return 0, nil end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
# Test the hook.
|
|
||||||
$output = qx{../src/task rc:hook.rc _version};
|
|
||||||
like ($output, qr/^<<\d\.\d+\.\d+.*>>$/ms, 'Hook called task_lua_version');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('Hook called task_lua_version - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,83 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.pre-exit=" . $ENV{'PWD'} . "/hook:test\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function test () print ('<<' .. task_os () .. '>>') return 0, nil end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
# Test the hook.
|
|
||||||
$output = qx{../src/task rc:hook.rc _version};
|
|
||||||
|
|
||||||
my ($os) = $output =~ /^<<(darwin|solaris|cygwin|openbsd|haiku|freebsd|linux)>>$/ms;
|
|
||||||
diag ($os);
|
|
||||||
|
|
||||||
like ($os, qr/darwin|solaris|cygwin|openbsd|haiku|freebsd|linux/, 'Hook called task_os');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('Hook called task_os - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,79 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.pre-exit=" . $ENV{'PWD'} . "/hook:test\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function test () print ('<<' .. task_version () .. '>>') return 0, nil end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
# Test the hook.
|
|
||||||
$output = qx{../src/task rc:hook.rc _version};
|
|
||||||
like ($output, qr/^<<\d\.\d+\.\d+.*>>$/ms, 'Hook called task_version');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('Hook called task_version - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,86 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-age=" . $ENV{'PWD'} . "/hook:age\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function age (name, value)\n",
|
|
||||||
" value = '<' .. value .. '>'\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add foo};
|
|
||||||
diag ("1 second delay");
|
|
||||||
sleep 1;
|
|
||||||
$output = qx{../src/task rc:hook.rc list};
|
|
||||||
|
|
||||||
like ($output, qr/<\d\ssecs?>/, 'format-age hook age -> <age>');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-age hook age -> <age> - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,87 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-age_compact=" . $ENV{'PWD'} . "/hook:age\n",
|
|
||||||
"report.list.columns=id,project,priority,due,active,age_compact,description\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function age (name, value)\n",
|
|
||||||
" value = '<' .. value .. '>'\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add foo};
|
|
||||||
diag ("1 second delay");
|
|
||||||
sleep 1;
|
|
||||||
$output = qx{../src/task rc:hook.rc list};
|
|
||||||
|
|
||||||
like ($output, qr/<\ds>/, 'format-age_compact hook age -> <age>');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-age_compact hook age -> <age> - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,84 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-countdown=" . $ENV{'PWD'} . "/hook:countdown\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function countdown (name, value)\n",
|
|
||||||
" value = '<' .. value .. '>'\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add foo due:eom};
|
|
||||||
$output = qx{../src/task rc:hook.rc long};
|
|
||||||
|
|
||||||
like ($output, qr/<-?\d+\s\D+>/, 'format-countdown hook countdown -> <countdown>');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-countdown hook countdown -> <countdown> - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,86 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"report.long.columns=id,project,priority,entry,start,due,",
|
|
||||||
"recur,countdown_compact,age,depends,tags,description\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-countdown_compact=" . $ENV{'PWD'} . "/hook:countdown_compact\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function countdown_compact (name, value)\n",
|
|
||||||
" value = '<' .. value .. '>'\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add foo due:eom};
|
|
||||||
$output = qx{../src/task rc:hook.rc long};
|
|
||||||
|
|
||||||
like ($output, qr/<-?\d+\D+>/, 'format-countdown_compact hook countdown_compact -> <countdown_compact>');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-countdown_compact hook countdown_compact -> <countdown_compact> - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,85 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-depends=" . $ENV{'PWD'} . "/hook:depends\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function depends (name, value)\n",
|
|
||||||
" value = '<' .. value .. '>'\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add one};
|
|
||||||
qx{../src/task rc:hook.rc add two depends:1};
|
|
||||||
$output = qx{../src/task rc:hook.rc long};
|
|
||||||
|
|
||||||
like ($output, qr/<1>/, 'format-depends hook 1 -> <1>');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-depends hook 1 -> <1> - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,84 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-description=" . $ENV{'PWD'} . "/hook:description\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function description (name, value)\n",
|
|
||||||
" value = '<' .. value .. '>'\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add foo};
|
|
||||||
$output = qx{../src/task rc:hook.rc ls};
|
|
||||||
|
|
||||||
like ($output, qr/<foo>/, 'format-description hook foo -> <foo>');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-description hook foo -> <foo> - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,86 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-description_only=" . $ENV{'PWD'} . "/hook:description_only\n",
|
|
||||||
"report.ls.columns=id,project,priority,description_only\n",
|
|
||||||
"report.ls.sort=priority-,project+\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function description_only (name, value)\n",
|
|
||||||
" value = '<' .. value .. '>'\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add foo};
|
|
||||||
$output = qx{../src/task rc:hook.rc ls};
|
|
||||||
|
|
||||||
like ($output, qr/<foo>/, 'format-description_only hook foo -> <foo>');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-description_only hook foo -> <foo> - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,84 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-due=" . $ENV{'PWD'} . "/hook:due\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function due (name, value)\n",
|
|
||||||
" value = '<' .. value .. '>'\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add foo due:tomorrow};
|
|
||||||
$output = qx{../src/task rc:hook.rc list};
|
|
||||||
|
|
||||||
like ($output, qr/<\d+\/\d+\/\d+>/, 'format-due hook due -> <due>');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-due hook due -> <due> - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,85 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-end=" . $ENV{'PWD'} . "/hook:xend\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function xend (name, value)\n",
|
|
||||||
" value = '<' .. value .. '>'\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add foo};
|
|
||||||
qx{../src/task rc:hook.rc do 1};
|
|
||||||
$output = qx{../src/task rc:hook.rc completed};
|
|
||||||
|
|
||||||
like ($output, qr/<\d+\/\d+\/\d+>/, 'format-end hook end -> <end>');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-end hook end -> <end> - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,84 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-entry=" . $ENV{'PWD'} . "/hook:entry\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function entry (name, value)\n",
|
|
||||||
" value = '<' .. value .. '>'\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add foo};
|
|
||||||
$output = qx{../src/task rc:hook.rc long};
|
|
||||||
|
|
||||||
like ($output, qr/<\d+\/\d+\/\d+>/, 'format-entry hook entry -> <entry>');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-entry hook entry -> <entry> - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,87 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 9;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-id=" . $ENV{'PWD'} . "/hook:priority\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function priority (name, value)\n",
|
|
||||||
" value = '(' .. value .. ')'\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add foo};
|
|
||||||
qx{../src/task rc:hook.rc add bar};
|
|
||||||
$output = qx{../src/task rc:hook.rc ls};
|
|
||||||
|
|
||||||
like ($output, qr/\(1\)\s+foo/, 'format-id hook 1 -> (1)');
|
|
||||||
like ($output, qr/\(2\)\s+bar/, 'format-id hook 2 -> (2)');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-id hook 1 -> (1) - skip: no Lua support');
|
|
||||||
pass ('format-id hook 2 -> (2) - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,98 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 10;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-priority_long=" . $ENV{'PWD'} . "/hook:priority\n",
|
|
||||||
"report.ls.columns=id,project,priority_long,description\n",
|
|
||||||
"report.ls.sort=priority_long-,project+\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function priority (name, value)\n",
|
|
||||||
" if value == 'High' then\n",
|
|
||||||
" value = '^^^^'\n",
|
|
||||||
" elseif value == 'Medium' then\n",
|
|
||||||
" value = '===='\n",
|
|
||||||
" elseif value == 'Low' then\n",
|
|
||||||
" value = 'vvvv'\n",
|
|
||||||
" end\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add foo pri:H};
|
|
||||||
qx{../src/task rc:hook.rc add bar pri:M};
|
|
||||||
qx{../src/task rc:hook.rc add baz pri:L};
|
|
||||||
$output = qx{../src/task rc:hook.rc ls};
|
|
||||||
|
|
||||||
like ($output, qr/\^\^\^\^\s+foo/, 'format-priority_long hook High -> ^^^^');
|
|
||||||
like ($output, qr/====\s+bar/, 'format-priority_long hook Medium -> ====');
|
|
||||||
like ($output, qr/vvvv\s+baz/, 'format-priority_long hook Low -> vvvv');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-priority_long hook High -> ^^^^ - skip: no Lua support');
|
|
||||||
pass ('format-priority_long hook Medium -> ==== - skip: no Lua support');
|
|
||||||
pass ('format-priority_long hook Low -> vvvv - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,96 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 10;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-priority=" . $ENV{'PWD'} . "/hook:priority\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function priority (name, value)\n",
|
|
||||||
" if value == 'H' then\n",
|
|
||||||
" value = 'Hi'\n",
|
|
||||||
" elseif value == 'M' then\n",
|
|
||||||
" value = 'Me'\n",
|
|
||||||
" elseif value == 'L' then\n",
|
|
||||||
" value = 'Lo'\n",
|
|
||||||
" end\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add foo pri:H};
|
|
||||||
qx{../src/task rc:hook.rc add bar pri:M};
|
|
||||||
qx{../src/task rc:hook.rc add baz pri:L};
|
|
||||||
$output = qx{../src/task rc:hook.rc ls};
|
|
||||||
|
|
||||||
like ($output, qr/Hi\s+foo/, 'format-priority hook H -> Hi');
|
|
||||||
like ($output, qr/Me\s+bar/, 'format-priority hook M -> Me');
|
|
||||||
like ($output, qr/Lo\s+baz/, 'format-priority hook L -> Lo');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-priority hook H -> Hi - skip: no Lua support');
|
|
||||||
pass ('format-priority hook M -> Me - skip: no Lua support');
|
|
||||||
pass ('format-priority hook L -> Lo - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,84 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-project=" . $ENV{'PWD'} . "/hook:project\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function project (name, value)\n",
|
|
||||||
" value = '<' .. value .. '>'\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add foo project:bar};
|
|
||||||
$output = qx{../src/task rc:hook.rc list};
|
|
||||||
|
|
||||||
like ($output, qr/<bar>/, 'format-project hook project -> <project>');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-project hook project -> <project> - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,84 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"shell.prompt=foo\n",
|
|
||||||
"default.command=_version\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-prompt=" . $ENV{'PWD'} . "/hook:prompt\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function prompt (name, value)\n",
|
|
||||||
" value = '<' .. value .. '>'\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
my $output = qx{echo "-- \\nquit\\n" | ../src/task rc:hook.rc shell};
|
|
||||||
like ($output, qr/<foo>/, 'format-prompt hook prompt -> <prompt>');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-prompt hook prompt -> <prompt> - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,84 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-recur=" . $ENV{'PWD'} . "/hook:recur\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function recur (name, value)\n",
|
|
||||||
" value = '<' .. value .. '>'\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add foo due:tomorrow recur:weekly};
|
|
||||||
$output = qx{../src/task rc:hook.rc long};
|
|
||||||
|
|
||||||
like ($output, qr/<weekly>/, 'format-recur hook recur -> <recur>');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-recur hook recur -> <recur> - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,85 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-start=" . $ENV{'PWD'} . "/hook:start\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function start (name, value)\n",
|
|
||||||
" value = '<' .. value .. '>'\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add foo};
|
|
||||||
qx{../src/task rc:hook.rc start 1};
|
|
||||||
$output = qx{../src/task rc:hook.rc long};
|
|
||||||
|
|
||||||
like ($output, qr/<\d+\/\d+\/\d+>/, 'format-start hook start -> <start>');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-start hook start -> <start> - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,84 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-tags=" . $ENV{'PWD'} . "/hook:tags\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function tags (name, value)\n",
|
|
||||||
" value = '<' .. value .. '>'\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add foo +t1 +t2};
|
|
||||||
$output = qx{../src/task rc:hook.rc long};
|
|
||||||
|
|
||||||
like ($output, qr/<t1 t2>/, 'format-tags hook t1 t2 -> <t1 t2>');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-tags hook t1 t2 -> <t1 t2> - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,84 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-uuid=" . $ENV{'PWD'} . "/hook:uuid\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function uuid (name, value)\n",
|
|
||||||
" value = '<' .. value .. '>'\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add foo};
|
|
||||||
$output = qx{../src/task rc:hook.rc info 1};
|
|
||||||
|
|
||||||
like ($output, qr/UUID\s+<[0-9a-f-]+>/, 'format-uuid hook uuid -> <uuid>');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-uuid hook uuid -> <uuid> - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,84 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n",
|
|
||||||
"hook.format-wait=" . $ENV{'PWD'} . "/hook:wait\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function wait (name, value)\n",
|
|
||||||
" value = '<' .. value .. '>'\n",
|
|
||||||
" return value, 0, nil\n",
|
|
||||||
"end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
qx{../src/task rc:hook.rc add foo wait:tomorrow};
|
|
||||||
$output = qx{../src/task rc:hook.rc waiting};
|
|
||||||
|
|
||||||
like ($output, qr/<\d+\/\d+\/\d+>/, 'format-wait hook wait -> <wait>');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('format-wait hook wait -> <wait> - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
|
@ -1,89 +0,0 @@
|
||||||
#! /usr/bin/perl
|
|
||||||
################################################################################
|
|
||||||
## taskwarrior - a command line task list manager.
|
|
||||||
##
|
|
||||||
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
|
||||||
## All rights reserved.
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify it under
|
|
||||||
## the terms of the GNU General Public License as published by the Free Software
|
|
||||||
## Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
## version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
## details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License along with
|
|
||||||
## this program; if not, write to the
|
|
||||||
##
|
|
||||||
## Free Software Foundation, Inc.,
|
|
||||||
## 51 Franklin Street, Fifth Floor,
|
|
||||||
## Boston, MA
|
|
||||||
## 02110-1301
|
|
||||||
## USA
|
|
||||||
##
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Test::More tests => 9;
|
|
||||||
|
|
||||||
# Create the rc file.
|
|
||||||
if (open my $fh, '>', 'hook.rc')
|
|
||||||
{
|
|
||||||
print $fh "data.location=.\n",
|
|
||||||
"hooks=on\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook.rc', 'Created hook.rc');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the hook functions.
|
|
||||||
if (open my $fh, '>', 'hook')
|
|
||||||
{
|
|
||||||
print $fh "function good () print ('marker') return 0, nil end\n",
|
|
||||||
"function bad () print ('marker') return 1, 'disallowed' end\n";
|
|
||||||
close $fh;
|
|
||||||
ok (-r 'hook', 'Created hook');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $output = qx{../src/task rc:hook.rc version};
|
|
||||||
if ($output =~ /PUC-Rio/)
|
|
||||||
{
|
|
||||||
my $good = $ENV{'PWD'} . '/hook:good';
|
|
||||||
my $bad = $ENV{'PWD'} . '/hook:bad';
|
|
||||||
|
|
||||||
qx{echo '-- y'|../src/task rc:hook.rc config -- hook.pre-completed "$bad"};
|
|
||||||
qx{../src/task rc:hook.rc add foo};
|
|
||||||
$output = qx{../src/task rc:hook.rc done 1};
|
|
||||||
like ($output, qr/disallowed/, 'pre-completed hook rejected completion');
|
|
||||||
|
|
||||||
qx{echo '-- y'|../src/task rc:hook.rc config -- hook.pre-completed "$good"};
|
|
||||||
$output = qx{../src/task rc:hook.rc done 1};
|
|
||||||
like ($output, qr/Marked 1 task as done/, 'pre-completed hook allowed completion');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pass ('pre-complete hook rejected completion - skip: no Lua support');
|
|
||||||
pass ('pre-complete hook allowed completion - skip: no Lua support');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
unlink 'pending.data';
|
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
|
||||||
|
|
||||||
unlink 'completed.data';
|
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
|
||||||
|
|
||||||
unlink 'undo.data';
|
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'hook';
|
|
||||||
ok (!-r 'hook', 'Removed hook');
|
|
||||||
|
|
||||||
unlink 'hook.rc';
|
|
||||||
ok (!-r 'hook.rc', 'Removed hook.rc');
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue