From dbb556bce98431cc29e15c9c1220663ceb82a745 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 13 Apr 2011 23:19:30 -0400 Subject: [PATCH] Unit Tests - Eliminated obsolete unit tests pertaining to Hooks that are no longer needed. --- test/hook.api.task_get_description.t | 80 -------------------------- test/hook.api.task_get_due.t | 83 --------------------------- test/hook.api.task_get_end.t | 84 ---------------------------- test/hook.api.task_get_entry.t | 83 --------------------------- test/hook.api.task_get_priority.t | 80 -------------------------- test/hook.api.task_get_project.t | 80 -------------------------- test/hook.api.task_get_start.t | 84 ---------------------------- test/hook.api.task_get_status.t | 80 -------------------------- test/hook.api.task_get_until.t | 83 --------------------------- test/hook.api.task_get_uuid.t | 80 -------------------------- test/hook.api.task_get_wait.t | 83 --------------------------- 11 files changed, 900 deletions(-) delete mode 100755 test/hook.api.task_get_description.t delete mode 100755 test/hook.api.task_get_due.t delete mode 100755 test/hook.api.task_get_end.t delete mode 100755 test/hook.api.task_get_entry.t delete mode 100755 test/hook.api.task_get_priority.t delete mode 100755 test/hook.api.task_get_project.t delete mode 100755 test/hook.api.task_get_start.t delete mode 100755 test/hook.api.task_get_status.t delete mode 100755 test/hook.api.task_get_until.t delete mode 100755 test/hook.api.task_get_uuid.t delete mode 100755 test/hook.api.task_get_wait.t diff --git a/test/hook.api.task_get_description.t b/test/hook.api.task_get_description.t deleted file mode 100755 index f4b7846ec..000000000 --- a/test/hook.api.task_get_description.t +++ /dev/null @@ -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 () print ('<<' .. task_get_description () .. '>>') 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/^<>$/ms, 'Hook called task_get_description'); -} -else -{ - pass ('Hook called task_get_description - 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; - diff --git a/test/hook.api.task_get_due.t b/test/hook.api.task_get_due.t deleted file mode 100755 index 11665dbad..000000000 --- a/test/hook.api.task_get_due.t +++ /dev/null @@ -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-display=" . $ENV{'PWD'} . "/hook:test\n"; - close $fh; - ok (-r 'hook.rc', 'Created hook.rc'); -} - -if (open my $fh, '>', 'hook') -{ - print $fh "function test ()\n", - " print ('<<' .. task_get_due () .. '>>')\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. - qx{../src/task rc:hook.rc add foo due:eom}; - $output = qx{../src/task rc:hook.rc info 1}; - like ($output, qr/^<<\d+>>$/ms, 'Hook called task_get_due'); -} -else -{ - pass ('Hook called task_get_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; - diff --git a/test/hook.api.task_get_end.t b/test/hook.api.task_get_end.t deleted file mode 100755 index 2b32910d7..000000000 --- a/test/hook.api.task_get_end.t +++ /dev/null @@ -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.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 ()\n", - " print ('<<' .. task_get_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. - qx{../src/task rc:hook.rc add foo}; - qx{../src/task rc:hook.rc do 1}; - $output = qx{../src/task rc:hook.rc info 1}; - like ($output, qr/^<<\d+>>$/ms, 'Hook called task_get_end'); -} -else -{ - pass ('Hook called task_get_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; - diff --git a/test/hook.api.task_get_entry.t b/test/hook.api.task_get_entry.t deleted file mode 100755 index 8e066c27b..000000000 --- a/test/hook.api.task_get_entry.t +++ /dev/null @@ -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-display=" . $ENV{'PWD'} . "/hook:test\n"; - close $fh; - ok (-r 'hook.rc', 'Created hook.rc'); -} - -if (open my $fh, '>', 'hook') -{ - print $fh "function test ()\n", - " print ('<<' .. task_get_entry () .. '>>')\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. - qx{../src/task rc:hook.rc add foo}; - $output = qx{../src/task rc:hook.rc info 1}; - like ($output, qr/^<<\d+>>$/ms, 'Hook called task_get_entry'); -} -else -{ - pass ('Hook called task_get_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; - diff --git a/test/hook.api.task_get_priority.t b/test/hook.api.task_get_priority.t deleted file mode 100755 index 036b840bb..000000000 --- a/test/hook.api.task_get_priority.t +++ /dev/null @@ -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 () print ('<<' .. task_get_priority () .. '>>') 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 priority:M}; - $output = qx{../src/task rc:hook.rc info 1}; - like ($output, qr/^<>$/ms, 'Hook called task_get_priority'); -} -else -{ - pass ('Hook called task_get_priority - 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; - diff --git a/test/hook.api.task_get_project.t b/test/hook.api.task_get_project.t deleted file mode 100755 index 41b84cb1a..000000000 --- a/test/hook.api.task_get_project.t +++ /dev/null @@ -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 () print ('<<' .. task_get_project () .. '>>') 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 pro:PPP}; - $output = qx{../src/task rc:hook.rc info 1}; - like ($output, qr/^<>$/ms, 'Hook called task_get_project'); -} -else -{ - pass ('Hook called task_get_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; - diff --git a/test/hook.api.task_get_start.t b/test/hook.api.task_get_start.t deleted file mode 100755 index 534c7df25..000000000 --- a/test/hook.api.task_get_start.t +++ /dev/null @@ -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.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 ()\n", - " print ('<<' .. task_get_start () .. '>>')\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. - qx{../src/task rc:hook.rc add foo}; - qx{../src/task rc:hook.rc start 1}; - $output = qx{../src/task rc:hook.rc info 1}; - like ($output, qr/^<<\d+>>$/ms, 'Hook called task_get_start'); -} -else -{ - pass ('Hook called task_get_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; - diff --git a/test/hook.api.task_get_status.t b/test/hook.api.task_get_status.t deleted file mode 100755 index 4fd2b3b12..000000000 --- a/test/hook.api.task_get_status.t +++ /dev/null @@ -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 () print ('<<' .. task_get_status () .. '>>') 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/^<>$/ms, 'Hook called task_get_status'); -} -else -{ - pass ('Hook called task_get_status - 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; - diff --git a/test/hook.api.task_get_until.t b/test/hook.api.task_get_until.t deleted file mode 100755 index f4785d1d1..000000000 --- a/test/hook.api.task_get_until.t +++ /dev/null @@ -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-display=" . $ENV{'PWD'} . "/hook:test\n"; - close $fh; - ok (-r 'hook.rc', 'Created hook.rc'); -} - -if (open my $fh, '>', 'hook') -{ - print $fh "function test ()\n", - " print ('<<' .. task_get_until () .. '>>')\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. - qx{../src/task rc:hook.rc add foo due:tomorrow recur:weekly until:eoy}; - $output = qx{../src/task rc:hook.rc info 1}; - like ($output, qr/^<<\d+>>$/ms, 'Hook called task_get_until'); -} -else -{ - pass ('Hook called task_get_until - 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; - diff --git a/test/hook.api.task_get_uuid.t b/test/hook.api.task_get_uuid.t deleted file mode 100755 index 319743538..000000000 --- a/test/hook.api.task_get_uuid.t +++ /dev/null @@ -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 () print ('<<' .. task_get_uuid () .. '>>') 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/^<<.+>>$/ms, 'Hook called task_get_uuid'); -} -else -{ - pass ('Hook called task_get_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; - diff --git a/test/hook.api.task_get_wait.t b/test/hook.api.task_get_wait.t deleted file mode 100755 index af07054a2..000000000 --- a/test/hook.api.task_get_wait.t +++ /dev/null @@ -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-display=" . $ENV{'PWD'} . "/hook:test\n"; - close $fh; - ok (-r 'hook.rc', 'Created hook.rc'); -} - -if (open my $fh, '>', 'hook') -{ - print $fh "function test ()\n", - " print ('<<' .. task_get_wait () .. '>>')\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. - qx{../src/task rc:hook.rc add foo wait:tomorrow}; - $output = qx{../src/task rc:hook.rc info 1}; - like ($output, qr/^<<\d+>>$/ms, 'Hook called task_get_wait'); -} -else -{ - pass ('Hook called task_get_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; -