pax_global_header00006660000000000000000000000064121303513560014511gustar00rootroot0000000000000052 comment=05f7948f7e70d7be3642bdc336faace52eaa9dfb task-2.2.0-test/000075500000000000000000000000001213035135600134275ustar00rootroot00000000000000task-2.2.0-test/.gitignore000064400000000000000000000003371213035135600154220ustar00rootroot00000000000000*.o *.data *.log autocomplete.t color.t config.t date.t directory.t dom.t duration.t file.t i18n.t json.t list.t nibbler.t path.t rx.t t.t t2.t taskmod.t tdb2.t text.t uri.t utf8.t util.t view.t width.t json_test run_all task-2.2.0-test/CMakeLists.txt000064400000000000000000000026551213035135600161770ustar00rootroot00000000000000cmake_minimum_required (VERSION 2.8) include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/commands ${CMAKE_SOURCE_DIR}/src/columns ${CMAKE_SOURCE_DIR}/test ${TASK_INCLUDE_DIRS}) set (test_SRCS autocomplete.t color.t config.t date.t directory.t dom.t duration.t file.t i18n.t json.t list.t nibbler.t path.t rx.t t.t t2.t taskmod.t tdb2.t text.t uri.t utf8.t util.t view.t width.t json_test) message ("-- Configuring run_all") set (TESTBLOB "*.t") if (CYGWIN) set (TESTBLOB "*.t *.t.exe") endif (CYGWIN) configure_file ( ${CMAKE_SOURCE_DIR}/test/run_all.in ${CMAKE_SOURCE_DIR}/test/run_all) add_custom_target (test ./run_all --verbose DEPENDS ${test_SRCS} task_executable WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test) add_custom_target (build_tests DEPENDS ${test_SRCS} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test) foreach (src_FILE ${test_SRCS}) add_executable (${src_FILE} "${src_FILE}.cpp" test.cpp) target_link_libraries (${src_FILE} task commands task columns ${TASK_LIBRARIES}) endforeach (src_FILE) #SET(CMAKE_BUILD_TYPE gcov) #SET(CMAKE_CXX_FLAGS_GCOV "--coverage") #SET(CMAKE_C_FLAGS_GCOV "--coverage") #SET(CMAKE_EXE_LINKER_FLAGS_GCOV "--coverage") task-2.2.0-test/abbreviation.t000075500000000000000000000073641213035135600162760ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 21; # Create the rc file. if (open my $fh, '>', 'abbrev.rc') { print $fh "data.location=.\n", "abbreviation.minimum=1\n"; close $fh; ok (-r 'abbrev.rc', 'Created abbrev.rc'); } # Test the priority attribute abbrevations. qx{../src/task rc:abbrev.rc add priority:H with 2>&1}; qx{../src/task rc:abbrev.rc add without 2>&1}; my $output = qx{../src/task rc:abbrev.rc list priority:H 2>&1}; like ($output, qr/\bwith\b/, 'priority:H with'); unlike ($output, qr/\bwithout\b/, 'priority:H without'); $output = qx{../src/task rc:abbrev.rc list priorit:H 2>&1}; like ($output, qr/\bwith\b/, 'priorit:H with'); unlike ($output, qr/\bwithout\b/, 'priorit:H without'); $output = qx{../src/task rc:abbrev.rc list priori:H 2>&1}; like ($output, qr/\bwith\b/, 'priori:H with'); unlike ($output, qr/\bwithout\b/, 'priori:H without'); $output = qx{../src/task rc:abbrev.rc list prior:H 2>&1}; like ($output, qr/\bwith\b/, 'prior:H with'); unlike ($output, qr/\bwithout\b/, 'prior:H without'); $output = qx{../src/task rc:abbrev.rc list prio:H 2>&1}; like ($output, qr/\bwith\b/, 'prio:H with'); unlike ($output, qr/\bwithout\b/, 'prio:H without'); $output = qx{../src/task rc:abbrev.rc list pri:H 2>&1}; like ($output, qr/\bwith\b/, 'pri:H with'); unlike ($output, qr/\bwithout\b/, 'pri:H without'); # Test the version command abbreviations. $output = qx{../src/task rc:abbrev.rc version 2>&1}; like ($output, qr/MIT\s+license/, 'version'); $output = qx{../src/task rc:abbrev.rc versio 2>&1}; like ($output, qr/MIT\s+license/, 'version'); $output = qx{../src/task rc:abbrev.rc versi 2>&1}; like ($output, qr/MIT\s+license/, 'version'); $output = qx{../src/task rc:abbrev.rc vers 2>&1}; like ($output, qr/MIT\s+license/, 'version'); $output = qx{../src/task rc:abbrev.rc ver 2>&1}; like ($output, qr/MIT\s+license/, 'version'); $output = qx{../src/task rc:abbrev.rc ve 2>&1}; like ($output, qr/MIT\s+license/, 'version'); $output = qx{../src/task rc:abbrev.rc v 2>&1}; like ($output, qr/MIT\s+license/, 'version'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key abbrev.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'abbrev.rc', 'Cleanup'); exit 0; task-2.2.0-test/add.t000075500000000000000000000051761213035135600143600ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 9; # Create the rc file. if (open my $fh, '>', 'add.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'add.rc', 'Created add.rc'); } # Test the add command. qx{../src/task rc:add.rc add This is a test 2>&1}; my $output = qx{../src/task rc:add.rc info 1 2>&1}; like ($output, qr/ID\s+1\n/, 'add ID'); like ($output, qr/Description\s+This is a test\n/, 'add ID'); like ($output, qr/Status\s+Pending\n/, 'add Pending'); like ($output, qr/UUID\s+[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}\n/, 'add UUID'); # Test the /// modifier. qx{../src/task rc:add.rc 1 modify /test/TEST/ 2>&1}; qx{../src/task rc:add.rc 1 modify "/is //" 2>&1}; $output = qx{../src/task rc:add.rc info 1 2>&1}; like ($output, qr/ID\s+1\n/, 'add ID'); like ($output, qr/Status\s+Pending\n/, 'add Pending'); like ($output, qr/Description\s+This a TEST\n/, 'add Description'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key add.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'add.rc', 'Cleanup'); exit 0; task-2.2.0-test/alias.t000075500000000000000000000046241213035135600147160ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'alias.rc') { print $fh "data.location=.\n", "alias.foo=_projects\n", "alias.bar=foo\n"; close $fh; ok (-r 'alias.rc', 'Created alias.rc'); } # Add a task with certain project, then access that task via aliases. qx{../src/task rc:alias.rc add project:ALIAS foo 2>&1}; my $output = qx{../src/task rc:alias.rc _projects 2>&1}; like ($output, qr/ALIAS/, 'task _projects -> ALIAS'); $output = qx{../src/task rc:alias.rc foo 2>&1}; like ($output, qr/ALIAS/, 'task foo -> _projects -> ALIAS'); $output = qx{../src/task rc:alias.rc bar 2>&1}; like ($output, qr/ALIAS/, 'task bar -> foo -> _projects -> ALIAS'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key alias.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'alias.rc', 'Cleanup'); exit 0; task-2.2.0-test/annotate.t000075500000000000000000000121251213035135600154310ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 25; # Create the rc file. if (open my $fh, '>', 'annotate.rc') { # Note: Use 'rrr' to guarantee a unique report name. Using 'r' conflicts # with 'recurring'. print $fh "data.location=.\n", "confirmation=off\n", "report.rrr.description=rrr\n", "report.rrr.columns=id,description\n", "report.rrr.sort=id+\n", "color=off\n"; close $fh; ok (-r 'annotate.rc', 'Created annotate.rc'); } # Add four tasks, annotate one three times, one twice, one just once and one none. qx{../src/task rc:annotate.rc add one 2>&1}; qx{../src/task rc:annotate.rc add two 2>&1}; qx{../src/task rc:annotate.rc add three 2>&1}; qx{../src/task rc:annotate.rc add four 2>&1}; qx{../src/task rc:annotate.rc 1 annotate foo1 2>&1}; qx{../src/task rc:annotate.rc 1 annotate foo2 2>&1}; qx{../src/task rc:annotate.rc 1 annotate foo3 2>&1}; qx{../src/task rc:annotate.rc 2 annotate bar1 2>&1}; qx{../src/task rc:annotate.rc 2 annotate bar2 2>&1}; qx{../src/task rc:annotate.rc 3 annotate baz1 2>&1}; my $output = qx{../src/task rc:annotate.rc rrr 2>&1}; # ID Description # -- ------------------------------- # 1 one # 3/24/2009 foo1 # 3/24/2009 foo2 # 3/24/2009 foo3 # 2 two # 3/24/2009 bar1 # 3/24/2009 bar2 # 3 three # 3/24/2009 baz1 # 4 four # # 4 tasks like ($output, qr/1 one/, 'task 1'); # 2 like ($output, qr/2 two/, 'task 2'); like ($output, qr/3 three/, 'task 3'); like ($output, qr/4 four/, 'task 4'); like ($output, qr/one.+\d{1,2}\/\d{1,2}\/\d{4}\s+foo1/ms, 'full - first annotation task 1'); like ($output, qr/foo1.+\d{1,2}\/\d{1,2}\/\d{4}\s+foo2/ms, 'full - second annotation task 1'); like ($output, qr/foo2.+\d{1,2}\/\d{1,2}\/\d{4}\s+foo3/ms, 'full - third annotation task 1'); like ($output, qr/two.+\d{1,2}\/\d{1,2}\/\d{4}\s+bar1/ms, 'full - first annotation task 2'); like ($output, qr/bar1.+\d{1,2}\/\d{1,2}\/\d{4}\s+bar2/ms, 'full - second annotation task 2'); like ($output, qr/three.+\d{1,2}\/\d{1,2}\/\d{4}\s+baz1/ms,'full - first annotation task 3'); like ($output, qr/4 tasks/, 'count'); if (open my $fh, '>', 'annotate2.rc') { # Note: Use 'rrr' to guarantee a unique report name. Using 'r' conflicts # with 'recurring'. print $fh "data.location=.\n", "confirmation=off\n", "report.rrr.description=rrr\n", "report.rrr.columns=id,description\n", "report.rrr.sort=id+\n", "dateformat.annotation=yMD HNS\n"; close $fh; ok (-r 'annotate2.rc', 'Created annotate2.rc'); } $output = qx{../src/task rc:annotate2.rc rrr 2>&1}; like ($output, qr/1 one/, 'task 1'); # 14 like ($output, qr/2 two/, 'task 2'); like ($output, qr/3 three/, 'task 3'); like ($output, qr/4 four/, 'task 4'); like ($output, qr/one.+\d{1,6}\s+\d{1,6}\s+foo1/ms, 'dateformat - first annotation task 1'); #18 like ($output, qr/foo1.+\d{1,6}\s+\d{1,6}\s+foo2/ms, 'dateformat - second annotation task 1'); like ($output, qr/foo2.+\d{1,6}\s+\d{1,6}\s+foo3/ms, 'dateformat - third annotation task 1'); like ($output, qr/two.+\d{1,6}\s+\d{1,6}\s+bar1/ms, 'dateformat - first annotation task 2'); like ($output, qr/bar1.+\d{1,6}\s+\d{1,6}\s+bar2/ms, 'dateformat - second annotation task 2'); like ($output, qr/three.+\d{1,6}\s+\d{1,6}\s+baz1/ms,'dateformat - first annotation task 3'); like ($output, qr/4 tasks/, 'count'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key annotate.rc annotate2.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'annotate.rc' && ! -r 'annotate2.rc', 'Cleanup'); exit 0; task-2.2.0-test/append.t000075500000000000000000000047421213035135600150750ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'append.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'append.rc', 'Created append.rc'); } # Add a task, then append more description. qx{../src/task rc:append.rc add foo 2>&1}; my $output = qx{../src/task rc:append.rc 1 append bar 2>&1}; like ($output, qr/^Appended 1 task.$/m, 'append worked'); $output = qx{../src/task rc:append.rc info 1 2>&1}; like ($output, qr/Description\s+foo\sbar\n/, 'append worked'); # Should cause an error when nothing is appended. $output = qx{../src/task rc:append.rc 1 append 2>&1}; like ($output, qr/^Additional text must be provided.$/m, 'blank append failed'); unlike ($output, qr/^Appended 1 task.$/, 'blank append failed'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key append.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'append.rc', 'Cleanup'); exit 0; task-2.2.0-test/args.1.t000075500000000000000000000050601213035135600147130ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 8; # Create the rc file. if (open my $fh, '>', 'args.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'args.rc', 'Created args.rc'); } # Test id before command, and id after command. qx{../src/task rc:args.rc add one 2>&1}; qx{../src/task rc:args.rc add two 2>&1}; qx{../src/task rc:args.rc add three 2>&1}; my $output = qx{../src/task rc:args.rc list 2>&1}; like ($output, qr/one/, 'task 1 added'); like ($output, qr/two/, 'task 2 added'); like ($output, qr/three/, 'task 3 added'); $output = qx{../src/task rc:args.rc 1 done 2>&1}; like ($output, qr/^Completed 1 task.$/ms, 'COMMAND after ID'); $output = qx{../src/task rc:args.rc done 2 2>&1}; like ($output, qr/^Command prevented from running.$/ms, 'ID after COMMAND'); unlike ($output, qr/^Completed 1 task.$/ms, 'ID after COMMAND'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key args.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'args.rc', 'Cleanup'); exit 0; task-2.2.0-test/args.2.t000075500000000000000000000056541213035135600147250ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 7; # Create the rc file. if (open my $fh, '>', 'args.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'args.rc', 'Created args.rc'); } # Test 'done' with en-passant changes. qx{../src/task rc:args.rc add one 2>&1}; qx{../src/task rc:args.rc add two 2>&1}; qx{../src/task rc:args.rc add three 2>&1}; qx{../src/task rc:args.rc add four 2>&1}; qx{../src/task rc:args.rc add five 2>&1}; qx{../src/task rc:args.rc 1 done oneanno 2>&1}; my $output = qx{../src/task rc:args.rc 1 info 2>&1}; like ($output, qr/oneanno/, 'done enpassant anno'); qx{../src/task rc:args.rc 2 done /two/TWO/ 2>&1}; $output = qx{../src/task rc:args.rc 2 info 2>&1}; like ($output, qr/Description\s+TWO/, 'done enpassant subst'); qx{../src/task rc:args.rc 3 done +threetag 2>&1}; $output = qx{../src/task rc:args.rc 3 info 2>&1}; like ($output, qr/Tags\s+threetag/, 'done enpassant tag'); qx{../src/task rc:args.rc 4 done pri:H 2>&1}; $output = qx{../src/task rc:args.rc 4 info 2>&1}; like ($output, qr/Priority\s+H/, 'done enpassant priority'); qx{../src/task rc:args.rc 5 done pro:A 2>&1}; $output = qx{../src/task rc:args.rc 5 info 2>&1}; like ($output, qr/Project\s+A/, 'done enpassant project'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key args.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'args.rc', 'Cleanup'); exit 0; task-2.2.0-test/args.3.t000075500000000000000000000057021213035135600147200ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 7; # Create the rc file. if (open my $fh, '>', 'args.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'args.rc', 'Created args.rc'); } # Test 'delete' with en-passant changes. qx{../src/task rc:args.rc add one 2>&1}; qx{../src/task rc:args.rc add two 2>&1}; qx{../src/task rc:args.rc add three 2>&1}; qx{../src/task rc:args.rc add four 2>&1}; qx{../src/task rc:args.rc add five 2>&1}; qx{../src/task rc:args.rc 1 delete oneanno 2>&1}; my $output = qx{../src/task rc:args.rc 1 info 2>&1}; like ($output, qr/oneanno/, 'delete enpassant anno'); qx{../src/task rc:args.rc 2 delete /two/TWO/ 2>&1}; $output = qx{../src/task rc:args.rc 2 info 2>&1}; like ($output, qr/Description\s+TWO/, 'delete enpassant subst'); qx{../src/task rc:args.rc 3 delete +threetag 2>&1}; $output = qx{../src/task rc:args.rc 3 info 2>&1}; like ($output, qr/Tags\s+threetag/, 'delete enpassant tag'); qx{../src/task rc:args.rc 4 delete pri:H 2>&1}; $output = qx{../src/task rc:args.rc 4 info 2>&1}; like ($output, qr/Priority\s+H/, 'delete enpassant priority'); qx{../src/task rc:args.rc 5 delete pro:A 2>&1}; $output = qx{../src/task rc:args.rc 5 info 2>&1}; like ($output, qr/Project\s+A/, 'delete enpassant project'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key args.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'args.rc', 'Cleanup'); exit 0; task-2.2.0-test/args.4.t000075500000000000000000000056671213035135600147330ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 7; # Create the rc file. if (open my $fh, '>', 'args.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'args.rc', 'Created args.rc'); } # Test 'start' with en-passant changes. qx{../src/task rc:args.rc add one 2>&1}; qx{../src/task rc:args.rc add two 2>&1}; qx{../src/task rc:args.rc add three 2>&1}; qx{../src/task rc:args.rc add four 2>&1}; qx{../src/task rc:args.rc add five 2>&1}; qx{../src/task rc:args.rc 1 start oneanno 2>&1}; my $output = qx{../src/task rc:args.rc 1 info 2>&1}; like ($output, qr/oneanno/, 'start enpassant anno'); qx{../src/task rc:args.rc 2 start /two/TWO/ 2>&1}; $output = qx{../src/task rc:args.rc 2 info 2>&1}; like ($output, qr/Description\s+TWO/, 'start enpassant subst'); qx{../src/task rc:args.rc 3 start +threetag 2>&1}; $output = qx{../src/task rc:args.rc 3 info 2>&1}; like ($output, qr/Tags\s+threetag/, 'start enpassant tag'); qx{../src/task rc:args.rc 4 start pri:H 2>&1}; $output = qx{../src/task rc:args.rc 4 info 2>&1}; like ($output, qr/Priority\s+H/, 'start enpassant priority'); qx{../src/task rc:args.rc 5 start pro:A 2>&1}; $output = qx{../src/task rc:args.rc 5 info 2>&1}; like ($output, qr/Project\s+A/, 'start enpassant project'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key args.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'args.rc', 'Cleanup'); exit 0; task-2.2.0-test/args.5.t000075500000000000000000000061721213035135600147240ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 7; # Create the rc file. if (open my $fh, '>', 'args.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'args.rc', 'Created args.rc'); } # Test 'stop' with en-passant changes. qx{../src/task rc:args.rc add one 2>&1}; qx{../src/task rc:args.rc add two 2>&1}; qx{../src/task rc:args.rc add three 2>&1}; qx{../src/task rc:args.rc add four 2>&1}; qx{../src/task rc:args.rc add five 2>&1}; qx{../src/task rc:args.rc 1 start 2>&1}; qx{../src/task rc:args.rc 2 start 2>&1}; qx{../src/task rc:args.rc 3 start 2>&1}; qx{../src/task rc:args.rc 4 start 2>&1}; qx{../src/task rc:args.rc 5 start 2>&1}; qx{../src/task rc:args.rc 1 stop oneanno 2>&1}; my $output = qx{../src/task rc:args.rc 1 info 2>&1}; like ($output, qr/oneanno/, 'stop enpassant anno'); qx{../src/task rc:args.rc 2 stop /two/TWO/ 2>&1}; $output = qx{../src/task rc:args.rc 2 info 2>&1}; like ($output, qr/Description\s+TWO/, 'stop enpassant subst'); qx{../src/task rc:args.rc 3 stop +threetag 2>&1}; $output = qx{../src/task rc:args.rc 3 info 2>&1}; like ($output, qr/Tags\s+threetag/, 'stop enpassant tag'); qx{../src/task rc:args.rc 4 stop pri:H 2>&1}; $output = qx{../src/task rc:args.rc 4 info 2>&1}; like ($output, qr/Priority\s+H/, 'stop enpassant priority'); qx{../src/task rc:args.rc 5 stop pro:A 2>&1}; $output = qx{../src/task rc:args.rc 5 info 2>&1}; like ($output, qr/Project\s+A/, 'stop enpassant project'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key args.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'args.rc', 'Cleanup'); exit 0; task-2.2.0-test/args.t000075500000000000000000000057501213035135600145620ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 7; # Create the rc file. if (open my $fh, '>', 'args.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'args.rc', 'Created args.rc'); } # Test the -- argument. qx{../src/task rc:args.rc add project:p pri:H +tag foo 2>&1}; my $output = qx{../src/task rc:args.rc info 1 2>&1}; like ($output, qr/Description\s+foo\n/ms, 'task add project:p pri:H +tag foo'); qx{../src/task rc:args.rc 1 modify project:p pri:H +tag -- foo 2>&1}; $output = qx{../src/task rc:args.rc info 1 2>&1}; like ($output, qr/Description\s+foo\n/ms, 'task 1 modify project:p pri:H +tag -- foo'); qx{../src/task rc:args.rc 1 modify project:p pri:H -- +tag foo 2>&1}; $output = qx{../src/task rc:args.rc info 1 2>&1}; like ($output, qr/Description\s+\+tag\sfoo\n/ms, 'task 1 modify project:p pri:H -- +tag foo'); qx{../src/task rc:args.rc 1 modify project:p -- pri:H +tag foo 2>&1}; $output = qx{../src/task rc:args.rc info 1 2>&1}; like ($output, qr/Description\s+pri:H\s\+tag\sfoo\n/ms, 'task 1 modify project:p -- pri:H +tag foo'); qx{../src/task rc:args.rc 1 modify -- project:p pri:H +tag foo 2>&1}; $output = qx{../src/task rc:args.rc info 1 2>&1}; like ($output, qr/Description\s+project:p\spri:H\s\+tag\sfoo\n/ms, 'task 1 modify -- project:p pri:H +tag foo'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key args.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'args.rc', 'Cleanup'); exit 0; task-2.2.0-test/autocomplete.t.cpp000064400000000000000000000050231213035135600170760ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { UnitTest t (8); std::vector options; options.push_back ("abc"); options.push_back ("abcd"); options.push_back ("abcde"); options.push_back ("bcdef"); options.push_back ("cdefg"); std::vector matches; int result = autoComplete ("", options, matches); t.is (result, 0, "no match on empty string"); result = autoComplete ("x", options, matches); t.is (result, 0, "no match on wrong string"); result = autoComplete ("abcd", options, matches); t.is (result, 1, "exact match on 'abcd'"); t.is (matches[0], "abcd", "exact match on 'abcd'"); result = autoComplete ("ab", options, matches); t.is (result, 3, "partial match on 'ab'"); t.is (matches[0], "abc", "partial match on 'abc'"); t.is (matches[1], "abcd", "partial match on 'abcd'"); t.is (matches[2], "abcde", "partial match on 'abcde'"); return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/backslash.t000075500000000000000000000042611213035135600155550ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'backslash.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'backslash.rc', 'Created backslash.rc'); } # Add a description with a backslash. qx{../src/task rc:backslash.rc add \\\\ 2>&1}; my $output = qx{../src/task rc:backslash.rc ls 2>&1}; like ($output, qr/\\/, 'Backslash preserved, no parsing issues'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key backslash.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'backslash.rc', 'Cleanup'); exit 0; ################################################################################ task-2.2.0-test/bash_completion.t000075500000000000000000000133311213035135600167660ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 18; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; print $fh "alias.samplealias=long\n"; print $fh "abbreviation.minimum=5\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Copy task.sh and make substitutions & additions needed for testing. if (open my $target, '>', 'task.sh') { if (open my $source, '<', '../scripts/bash/task.sh') { while (<$source>) { my $temp=$_; chomp($_); if ($_ eq qw{taskcommand='task'}) { print $target "taskcommand='../src/task rc:bug.rc'"; } else { print $target $temp; } } close ($source); print $target 'COMP_WORDS=("$@")', "\n", 'COMP_CWORD=$(($#-1))', "\n", '_task', "\n", 'for reply_iter in "${COMPREPLY[@]}"; do', "\n", ' echo $reply_iter', "\n", 'done'; close $target; ok (-r 'task.sh', 'Created task.sh'); } } # aliases should be expanded my $output = qx{bash ./task.sh task sampleali 2>&1}; ok ($? == 0, 'Exit status check'); like ($output, qr/samplealias/, 'Aliases are expanded'); # commands should be expanded $output = qx{bash ./task.sh task m 2>&1}; ok ($? == 0, 'Exit status check'); like ($output, qr/modify/, 'expansion of \'m\' includes \'modify\''); # "project:" should be expanded correctly and dependent on abbreviation.minimum qx{../src/task rc:bug.rc add testing project expansion project:todd 2>&1}; # note the spaces between "projABC", ":", and "to" for correct bash parsing $output = qx{bash ./task.sh task projeABC : to 2>&1}; ok ($? == 0, 'Exit status check'); unlike ($output, qr/todd/, '\'projeABC:\' does not expand'); $output = qx{bash ./task.sh task proje : to 2>&1}; ok ($? == 0, 'Exit status check'); like ($output, qr/todd/, '\'proje:\' does expand'); $output = qx{bash ./task.sh task proj : to 2>&1}; ok ($? == 0, 'Exit status check'); unlike ($output, qr/todd/, '\'proj:\' does not expand if abbreviation.minimum is 5'); # The following tests were removed because we no longer expand task IDs after # depends. This expansion was stopped because it was using the _ids command # which runs _ids and can lead to confusing behavior for the user. See: # https://groups.google.com/forum/#!topic/taskwarrior-dev/KwHnb9MOOqA ## "priority:" should be expanded correctly and dependent on abbreviation.minimum #$output = qx{bash ./task.sh task priorABC : 2>&1}; #ok ($? == 0, 'Exit status check'); #unlike ($output, qr/H/, '\'priorABC:\' does not expand'); # #$output = qx{bash ./task.sh task prior : 2>&1}; #ok ($? == 0, 'Exit status check'); #like ($output, qr/H/, '\'prior:\' does expand'); # #$output = qx{bash ./task.sh task prio : 2>&1}; #ok ($? == 0, 'Exit status check'); #unlike ($output, qr/H/, '\'prio:\' does not expand if abbreviation.minimum is 5'); # ## "depends:" should be expanded correctly and dependent on abbreviation.minimum #$output = qx{bash ./task.sh task depenABC : 2>&1}; #ok ($? == 0, 'Exit status check'); #unlike ($output, qr/1/, '\'depenABC:\' does not expand'); # #$output = qx{bash ./task.sh task depen : 2>&1}; #ok ($? == 0, 'Exit status check'); #like ($output, qr/1/, '\'depen:\' does expand'); # #$output = qx{bash ./task.sh task depe : 2>&1}; #ok ($? == 0, 'Exit status check'); #unlike ($output, qr/1/, '\'depe:\' does not expand if abbreviation.minimum is 5'); # there should be no gc coming from bash completion qx{../src/task rc:bug.rc add this task should be number 2 and stay number 2 2>&1}; ok ($? == 0, 'Exit status check'); qx{../src/task rc:bug.rc rc.confirmation:off 1 delete 2>&1}; ok ($? == 0, 'Exit status check'); qx{bash ./task.sh task depends : 2>&1}; ok ($? == 0, 'Exit status check'); $output = qx{../src/task rc:bug.rc rc.confirmation:off 2 modify shouldreplacetext 2>&1}; ok ($? == 0, 'Should exit with 0 because task should exist'); like ($output, qr/shouldreplacetext/, 'no gc was run'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc task.sh); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc' && ! -r 'task.sh', 'Cleanup'); exit 0; task-2.2.0-test/basic.t000075500000000000000000000053261213035135600147060ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 7; # Create the rc file. if (open my $fh, '>', 'basic.rc') { print $fh "data.location=.\n", "default.command=\n"; close $fh; ok (-r 'basic.rc', 'Created basic.rc'); } # Get the version number from configure.ac my $version = slurp ('../CMakeLists.txt'); # Test the usage command. my $output = qx{../src/task rc:basic.rc 2>&1 >/dev/null}; like ($output, qr/You must specify a command or a task to modify./m, 'missing command and ID'); # Test the version command. $output = qx{../src/task rc:basic.rc version 2>&1}; like ($output, qr/task $version/, 'version - task version number'); like ($output, qr/MIT\slicense/, 'version - license'); like ($output, qr/http:\/\/taskwarrior\.org/, 'version - url'); # Test the _version command. $output = qx{../src/task rc:basic.rc _version 2>&1}; like ($output, qr/[a-f0-9]{7}/, '_version - task version number'); # Cleanup. unlink 'basic.rc'; ok (!-r 'basic.rc', 'Removed basic.rc'); exit 0; ################################################################################ sub slurp { my ($file) = @_; if (open my $fh, '<', $file) { while (<$fh>) { if (/PROJECT_VERSION/) { chomp; s/^set \(PROJECT_VERSION "//; s/"\).*$//; close $fh; return $_; } } } ''; } task-2.2.0-test/bug.1006.t000075500000000000000000000054661213035135600147740ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug with completion of "des" in task descriptions and annotations. It happens # for all the shortcuts for column attributes that are automatically completed. # This is because DOM elements are checked before standard words when strings # are tokenized. # Check that the completion is inactive in task descriptions qx{../src/task rc:bug.rc add des 2>&1}; qx{../src/task rc:bug.rc 1 annotate des 2>&1}; my $output = qx{../src/task rc:bug.rc 1 info 2>&1}; like ($output, qr/^Description\s+des$/ms, 'Attribute not completed in description'); unlike ($output, qr/description/ms, 'Attribute not completed in description'); # Check that the completion works when needed $output = qx{../src/task rc:bug.rc des:des 2>&1}; like ($output, qr/^1 task.$/ms, 'Task found using its description'); qx{../src/task rc:bug.rc add entrée interdite 2>&1}; $output = qx{../src/task rc:bug.rc list interdite 2>&1}; like ($output, qr/entrée interdite/, "'entrée' left intact"); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.1023.t000075500000000000000000000062061213035135600147640ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 11; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "default.project=home\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 1023: rc.default.project gets applied during modify, and should not. qx{../src/task rc:bug.rc add foo project:garden 2>&1}; qx{../src/task rc:bug.rc add bar 2>&1}; qx{../src/task rc:bug.rc add baz rc.default.project= 2>&1}; my $output = qx{../src/task rc:bug.rc 1 info 2>&1}; like ($output, qr/Project\s*garden/, "default project not applied when otherwise specified."); $output = qx{../src/task rc:bug.rc 2 info 2>&1}; like ($output, qr/Project\s*home/, "default project applied when blank."); $output = qx{../src/task rc:bug.rc 3 info 2>&1}; like ($output, qr/^Description\s+baz$/m, "task baz shown."); unlike ($output, qr/Project\s*home/, "no project applied when default project is blank."); $output = qx{../src/task rc:bug.rc 3 modify +tag 2>&1}; like ($output, qr/^Modified 1 task.$/m, "task modified."); unlike ($output, qr/Project\s*home/, "default project not applied on modification."); qx{../src/task rc:bug.rc 1 modify project: 2>&1}; $output = qx{../src/task rc:bug.rc 1 info 2>&1}; like ($output, qr/^Description\s+foo$/m, "task foo shown."); unlike ($output, qr/Project\s*garden/, "default project not re-applied on attribute removal."); unlike ($output, qr/Project\s*home/, "default project not re-applied on attribute removal."); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.1031.t000075500000000000000000000046541213035135600147700ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "alias.from=to\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 1031: -- does not bypass aliasing qx{../src/task rc:bug.rc add from 2>&1}; qx{../src/task rc:bug.rc add from -- to 2>&1}; qx{../src/task rc:bug.rc add to -- from 2>&1}; my $output = qx{../src/task rc:bug.rc 1 info 2>&1}; like ($output, qr/Description\s+to$/ms, "'from' --> 'to'"); $output = qx{../src/task rc:bug.rc 2 info 2>&1}; like ($output, qr/Description\s+to to$/ms, "'from -- to' --> 'to to'"); $output = qx{../src/task rc:bug.rc 3 info 2>&1}; like ($output, qr/Description\s+to from$/ms, "'to -- from' --> 'to from'"); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.1036.t000075500000000000000000000045751213035135600147770ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug #1036: prevents 'until' attributes to be modified for non-recurring # tasks. # Check that until attribute may be modified qx{../src/task rc:bug.rc add test 2>&1}; my $output = qx{../src/task rc:bug.rc 1 mod until:1/1/2020 2>&1}; like ($output, qr/^Modifying task 1 'test'.$/ms, '"until" attribute added'); qx{../src/task rc:bug.rc add test until:1/1/2020 2>&1}; $output = qx{../src/task rc:bug.rc 1 mod /test/Test/ 2>&1}; like ($output, qr/^Modifying task 1 'Test'.$/ms, 'Task with "until" attribute modified'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.1043.t000075500000000000000000000047731213035135600147750ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 7; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; print $fh "alias.samplealias=long\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug - aliases should be listed by '_aliases' and not by '_commands' or '_zshcommands' my $output = qx{../src/task rc:bug.rc _aliases 2>&1}; like ($output, qr/samplealias/, 'aliases are listed in _aliases'); $output = qx{../src/task rc:bug.rc _commands 2>&1}; like ($output, qr/^information$/m, 'info is listed in _commands'); unlike ($output, qr/samplealias/, 'aliases are not listed in _commands'); $output = qx{../src/task rc:bug.rc _zshcommands 2>&1}; like ($output, qr/^information:/m, 'info is listed in _zshcommands'); unlike ($output, qr/samplealias/, 'aliases are not listed in _zshcommands'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.1044.t000075500000000000000000000046001213035135600147630ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug #1044: 'task projects' considers newly deleted tasks and provides an # incorrect summary # Check that until attribute may be modified qx{../src/task rc:bug.rc add project:A 1 2>&1}; qx{../src/task rc:bug.rc add project:B 2 2>&1}; qx{../src/task rc:bug.rc add project:B 3 2>&1}; qx{../src/task rc:bug.rc 3 delete 2>&1}; my $output = qx{../src/task rc:bug.rc project:B projects 2>&1}; like ($output, qr/^1 project \(1 task\)$/ms, 'Summary filtered new deleted task 3 and project A'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.1056.t000075500000000000000000000063011213035135600147660ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 9; # Create the rc file. if (open my $fh, '>', 'bug.1056') { print $fh "data.location=.\n", "confirmation=off\n", "color=off\n", "verbose=nothing\n"; close $fh; ok (-r 'bug.1056', 'Created pro.rc'); } # Bug 1056: Project indentation in CmdSummary. qx{../src/task rc:bug.1056 add testing project:existingParent 2>&1 >/dev/null}; qx{../src/task rc:bug.1056 add testing project:existingParent.child 2>&1 >/dev/null}; qx{../src/task rc:bug.1056 add testing project:abstractParent.kid 2>&1 >/dev/null}; qx{../src/task rc:bug.1056 add testing project:.myProject 2>&1 >/dev/null}; qx{../src/task rc:bug.1056 add testing project:myProject. 2>&1 >/dev/null}; qx{../src/task rc:bug.1056 add testing project:.myProject. 2>&1 >/dev/null}; my $output = qx{../src/task rc:bug.1056 summary 2>&1}; my @lines = split ('\n',$output); like ($lines[0], qr/^\.myProject\s/, "'.myProject' not indented"); like ($lines[1], qr/^\.myProject\.\s/, "'.myProject.' not indented"); like ($lines[2], qr/^abstractParent\s*$/, "'abstractParent' not indented, no data"); like ($lines[3], qr/^\s\skid\s+\d/, "' kid' indented, without parent, with data"); like ($lines[4], qr/^existingParent\s+\d/, "'existingParent' not indented, with data"); like ($lines[5], qr/^\s\schild\s+\d/, "' child' indented, without parent, with data"); like ($lines[6], qr/^myProject\.\s+\d/, "'myProject.' not indented, with data"); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.1056); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.1056', 'Cleanup'); exit 0; task-2.2.0-test/bug.1063.t000075500000000000000000000054621213035135600147730ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 8; use File::Basename; my $ut = basename ($0); my $rc = $ut . '.rc'; # Create the rc file. if (open my $fh, '>', $rc) { print $fh "data.location=.\n", "confirmation=off\n", "uda.foo.type=numeric\n", "uda.foo.label=Foo\n", "report.bar.columns=foo,description\n", "report.bar.description=Bar\n", "report.bar.labels=Foo,Desc\n", "report.bar.sort=foo-\n"; close $fh; ok (-r $rc, "$ut: Created $rc"); } # Bug 1063 - Numeric UDA fields are not sortable. qx{../src/task rc:$rc add four foo:4 2>&1}; ok ($? == 0, "$ut: add four"); qx{../src/task rc:$rc add one foo:1 2>&1}; ok ($? == 0, "$ut: add one"); qx{../src/task rc:$rc add three foo:3 2>&1}; ok ($? == 0, "$ut: add three"); qx{../src/task rc:$rc add two foo:2 2>&1}; ok ($? == 0, "$ut: add two"); my $output = qx{../src/task rc:$rc bar 2>&1}; like ($output, qr/4.+3.+2.+1/ms, "$ut: Default descending sort correct"); $output = qx{../src/task rc:$rc bar rc.report.bar.sort=foo+ 2>&1}; like ($output, qr/1.+2.+3.+4/ms, "$ut: Default ascending sort correct"); ## Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key), $rc; ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r $rc, "$ut: Cleanup"); exit 0; task-2.2.0-test/bug.1065.t000075500000000000000000000066721213035135600150010ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 14; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; print $fh "alias.xyzzyx=status:waiting\n"; print $fh "imnotrecognized=kai\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 1065 - CmdShow should not display the differ message if no non-default in matched elements. my $output = qx{../src/task rc:bug.rc show alias 2>&1}; ok ($? == 0, 'Exit status check'); like ($output, qr/Some of your .taskrc variables differ from the default values./, 'Message is shown when non-default matches in pattern'); $output = qx{../src/task rc:bug.rc show 2>&1}; ok ($? == 0, 'Exit status check'); like ($output, qr/Some of your .taskrc variables differ from the default values./, 'Message is shown when non-default matches in all'); $output = qx{../src/task rc:bug.rc show report.overdue 2>&1}; ok ($? == 0, 'Exit status check'); unlike ($output, qr/Some of your .taskrc variables differ/, 'Message is not shown when no non-default matches in pattern'); # Bug 1065 - CmdShow should not display the unrecognized message if no non-default in matched elements. $output = qx{../src/task rc:bug.rc show notrecog 2>&1}; ok ($? == 0, 'Exit status check'); like ($output, qr/Your .taskrc file contains these unrecognized variables:/, 'Message is shown when unrecognized matches in pattern'); $output = qx{../src/task rc:bug.rc show 2>&1}; ok ($? == 0, 'Exit status check'); like ($output, qr/Your .taskrc file contains these unrecognized variables:/, 'Message is shown when unrecognized matches in all'); $output = qx{../src/task rc:bug.rc show report.overdue 2>&1}; ok ($? == 0, 'Exit status check'); unlike ($output, qr/unrecognized variables/, 'Message is not shown when no non-default matches in pattern'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.1104.t000075500000000000000000000152631213035135600147670ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use File::Copy; use File::Path; use Test::More tests => 33; mkdir("1", 0755); mkdir("2", 0755); mkdir("3", 0755); mkdir("dropbox", 0755); ok (-e "1", 'Created directory 1/'); ok (-e "2", 'Created directory 2/'); ok (-e "3", 'Created directory 3/'); ok (-e "dropbox", 'Created directory dropbox/'); # Create the rc file. if (open my $fh, '>', '1.rc') { print $fh "data.location=1/\n"; print $fh "confirmation=no\n"; print $fh "merge.autopush=yes\n"; print $fh "merge.default.uri=./dropbox/\n"; print $fh "push.default.uri=./dropbox/\n"; print $fh "pull.default.uri=./dropbox/\n"; close $fh; ok (-r '1.rc', 'Created 1.rc'); } # Create the rc file. if (open my $fh, '>', '2.rc') { print $fh "data.location=2/\n"; print $fh "confirmation=no\n"; print $fh "merge.autopush=yes\n"; print $fh "merge.default.uri=./dropbox/\n"; print $fh "push.default.uri=./dropbox/\n"; print $fh "pull.default.uri=./dropbox/\n"; close $fh; ok (-r '2.rc', 'Created 2.rc'); } # Create the rc file. if (open my $fh, '>', '3.rc') { print $fh "data.location=3/\n"; print $fh "confirmation=no\n"; print $fh "merge.autopush=yes\n"; print $fh "merge.default.uri=./dropbox/\n"; print $fh "push.default.uri=./dropbox/\n"; print $fh "pull.default.uri=./dropbox/\n"; close $fh; ok (-r '3.rc', 'Created 3.rc'); } # Once-only push from 1 --> dropbox my $output = qx{../src/task rc:1.rc add one 2>&1}; ok ($? == 0, 'Exit status check'); $output = qx{../src/task rc:1.rc add two 2>&1}; ok ($? == 0, 'Exit status check'); $output = qx{../src/task rc:1.rc add three 2>&1}; ok ($? == 0, 'Exit status check'); $output = qx{../src/task rc:1.rc push 2>&1}; ok ($? == 0, 'Exit status check'); # Merges to 2 and 3 $output = qx{../src/task rc:2.rc merge 2>&1}; ok ($? == 0, 'Exit status check'); $output = qx{../src/task rc:3.rc merge 2>&1}; ok ($? == 0, 'Exit status check'); # Make a different change in both locations $output = qx{../src/task rc:1.rc add four 2>&1}; ok ($? == 0, 'Exit status check'); $output = qx{../src/task rc:1.rc four done 2>&1}; ok ($? == 0, 'Exit status check'); $output = qx{../src/task rc:2.rc one done 2>&1}; ok ($? == 0, 'Exit status check'); $output = qx{../src/task rc:3.rc three delete 2>&1}; ok ($? == 0, 'Exit status check'); # Merges 1 and 2 $output = qx{../src/task rc:1.rc merge 2>&1}; ok ($? == 0, 'Exit status check'); $output = qx{../src/task rc:2.rc merge 2>&1}; ok ($? == 0, 'Exit status check'); # see if undo.data is corrupt $output = qx{cat 2/undo.data}; unlike ($output, qr/time 0/, "undo.data corrupt"); # merge again in order to stimulate duplications $output = qx{../src/task rc:1.rc merge 2>&1}; ok ($? == 0, 'Exit status check'); $output = qx{../src/task rc:1.rc diag 2>&1}; unlike ($output, qr/Found duplicate/, "Found duplicate"); # Merges 3 $output = qx{../src/task rc:3.rc merge 2>&1}; ok ($? == 0, 'Exit status check'); unlike ($output, qr/Retaining/, "Must not retain changes"); # Merges 1 $output = qx{../src/task rc:1.rc merge 2>&1}; ok ($? == 0, 'Exit status check'); unlike ($output, qr/Retaining/, "Must not retain changes"); # Merges 1 $output = qx{../src/task rc:2.rc merge 2>&1}; ok ($? == 0, 'Exit status check'); unlike ($output, qr/Retaining/, "Must not retain changes"); # now all three instances must be in sync $output = qx{diff 1/undo.data dropbox/undo.data}; ok ($? == 0, 'Resource 1 up-to-date check'); $output = qx{diff 2/undo.data dropbox/undo.data}; ok ($? == 0, 'Resource 2 up-to-date check'); $output = qx{diff 3/undo.data dropbox/undo.data}; ok ($? == 0, 'Resource 3 up-to-date check'); ## Merges 3 #$output = qx{../src/task rc:3.rc merge 2>&1}; #ok ($? == 0, 'Exit status check'); #unlike ($output, qr/Retaining/, "Must not retain changes"); # ## Merges 1 #$output = qx{../src/task rc:1.rc merge 2>&1}; #ok ($? == 0, 'Exit status check'); #unlike ($output, qr/Retaining/, "Must not retain changes"); # ## Merges 1 #$output = qx{../src/task rc:2.rc merge 2>&1}; #ok ($? == 0, 'Exit status check'); #unlike ($output, qr/Retaining/, "Must not retain changes"); # Cleanup. unlink qw(1.rc 1/pending.data 1/completed.data 1/undo.data 1/backlog.data 1/synch.key 2/pending.data 2/completed.data 2/undo.data 2.rc 2/backlog.data 2/synch.key dropbox/completed.data dropbox/pending.data dropbox/undo.data 3/pending.data 3/undo.data 3/completed.data 3/backlog.data 3/synch.key 3.rc); ok (! -r '1/pending.data' && ! -r '1/completed.data' && ! -r '1/undo.data' && ! -r '1/backlog.data' && ! -r '1/synch.key' && ! -r '1.rc' && ! -r '2/pending.data' && ! -r '2/completed.data' && ! -r '2/undo.data' && ! -r '2/backlog.data' && ! -r '2/synch.key' && ! -r '2.rc' && ! -r '3/pending.data' && ! -r '3/completed.data' && ! -r '3/undo.data' && ! -r '3/backlog.data' && ! -r '3/synch.key' && ! -r '3.rc' && ! -r 'dropbox/pending.data' && ! -r 'dropbox/completed.data' && ! -r 'dropbox/undo.data' , 'Cleanup'); rmtree (['1', '2', '3', 'dropbox'], 0, 1); ok (! -e '1' && ! -e '2' && ! -e '3' && ! -e 'dropbox', 'Removed directories'); exit 0; task-2.2.0-test/bug.1110.t000075500000000000000000000044631213035135600147640ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 1110: reports print "Completed" but "Completed" != "completed" qx{../src/task rc:bug.rc add ToBeCompleted 2>&1}; qx{../src/task rc:bug.rc 1 done 2>&1}; my $output = qx{../src/task all status:Completed rc:bug.rc 2>&1}; like ($output, qr/ToBeCompleted/, 'status:Completed returns completed tasks'); $output = qx{../src/task all status:completed rc:bug.rc 2>&1}; like ($output, qr/ToBeCompleted/, 'status:completed returns completed tasks'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.1117.t000075500000000000000000000073651213035135600147770ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use File::Copy; use File::Path; use Test::More tests => 13; mkdir("1", 0755); mkdir("2", 0755); mkdir("merge", 0755); ok (-e "1", 'Created directory 1/'); ok (-e "2", 'Created directory 2/'); ok (-e "merge", 'Created directory merge/'); # Create the rc file. if (open my $fh, '>', '1.rc') { print $fh "data.location=1/\n"; print $fh "confirmation=no\n"; print $fh "merge.autopush=yes\n"; print $fh "merge.default.uri=./merge/\n"; print $fh "push.default.uri=./merge/\n"; close $fh; ok (-r '1.rc', 'Created 1.rc'); } # Create the rc file. if (open my $fh, '>', '2.rc') { print $fh "data.location=2/\n"; print $fh "confirmation=no\n"; print $fh "merge.autopush=yes\n"; print $fh "merge.default.uri=./merge/\n"; print $fh "push.default.uri=./merge/\n"; close $fh; ok (-r '2.rc', 'Created 2.rc'); } # add and push on 1 my $output = qx{../src/task rc:1.rc add foo1 2>&1}; ok ($? == 0, 'Exit status check'); $output = qx{../src/task rc:1.rc push}; ok ($? == 0, 'Exit status check'); # add and merge on 2 $output = qx{../src/task rc:2.rc add foo2 2>&1}; ok ($? == 0, 'Exit status check'); $output = qx{../src/task rc:2.rc merge 2>&1}; ok ($? == 0, 'Exit status check'); # merge 1 $output = qx{../src/task rc:1.rc merge 2>&1}; ok ($? == 0, 'Exit status check'); # undo.data files must not differ $output = qx{diff 1/undo.data 2/undo.data}; ok ($? == 0, 'undo.data diff result'); # Cleanup. unlink qw(1.rc 1/pending.data 1/completed.data 1/undo.data 1/backlog.data 1/synch.key 2/pending.data 2/completed.data 2/undo.data 2.rc 2/backlog.data 2/synch.key merge/completed.data merge/pending.data merge/undo.data); ok (! -r '1/pending.data' && ! -r '1/completed.data' && ! -r '1/undo.data' && ! -r '1/backlog.data' && ! -r '1/synch.key' && ! -r '1.rc' && ! -r '2/pending.data' && ! -r '2/completed.data' && ! -r '2/undo.data' && ! -r '2/backlog.data' && ! -r '2/synch.key' && ! -r '2.rc' && ! -r 'merge/pending.data' && ! -r 'merge/completed.data' && ! -r 'merge/undo.data' , 'Cleanup'); rmtree (['1', '2', 'merge'], 0, 1); ok (! -e '1' && ! -e '2' && ! -e 'merge', 'Removed directories'); exit 0; task-2.2.0-test/bug.1192.t000075500000000000000000000050511213035135600147700ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; mkdir("localcopy", 0755); ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 1192 - Push fails with POSIX shell that does not do brace expansion. # Test push. qx{../src/task rc:bug.rc add foo 2>&1}; # completed.data doesn't get created until required. qx{touch completed.data 2>&1}; my $output = qx{../src/task rc:bug.rc push sh+cp://localcopy/ 2>&1}; #unlike ($output, qr/_user/ms, '_user in there'); unlike ($output, qr/No such file or directory/ms, 'Local push to sh+cp://path/'); # Test pull. $output = qx{../src/task rc:bug.rc pull sh+cp://localcopy/ 2>&1}; unlike ($output, qr/No such file or directory/ms, 'Local pull from sh+cp://path/'); ## Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); qx(rm -rf localcopy/); ok (! -d 'localcopy' && ! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.299.t000075500000000000000000000050261213035135600147210ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Setup: Add three unique tasks with different project names. qx{../src/task rc:bug.rc add project:one foo 2>&1}; qx{../src/task rc:bug.rc add project:two bar 2>&1}; qx{../src/task rc:bug.rc add project:three baz 2>&1}; # Result: Run list but exclude two of the three projects names using # project.hasnt: my $output = qx{../src/task rc:bug.rc list project.isnt:one project.isnt:two 2>&1}; unlike ($output, qr/one.*foo/ms, 'project.isnt:one project.isnt:two - no foo'); unlike ($output, qr/two.*bar/ms, 'project.isnt:one project.isnt:two - no bar'); like ($output, qr/three.*baz/ms, 'project.isnt:one project.isnt:two - yes baz'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.327.t000075500000000000000000000045561213035135600147200ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Setup: Add a recurring task then remove the due date. qx{../src/task rc:bug.rc add foo recur:yearly due:eoy 2>&1}; qx{../src/task rc:bug.rc li 2>&1}; qx{../src/task rc:bug.rc 2 modify due: 2>&1}; # Result: Somehow the due date is incremented and wraps around to 12/31/1969, # then keeps going back to today. my $output = qx{../src/task rc:bug.rc li 2>&1}; like ($output, qr/^1 task$/ms, 'task foo shown'); unlike ($output, qr/1969/ms, 'Should not display 12/31/1969'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.360.t000075500000000000000000000073331213035135600147110ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 10; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Setup: Add a recurring task, generate an instance, then add a project. qx{../src/task rc:bug.rc add foo due:tomorrow recur:daily 2>&1}; qx{../src/task rc:bug.rc ls 2>&1}; # Result: trying to add the project generates an error about removing # recurrence from a task. my $output = qx{echo 'y' | ../src/task rc:bug.rc 1 modify project:bar 2>&1}; like ($output, qr/^Modified 2 tasks.$/ms, '2 tasks modified'); unlike ($output, qr/^You cannot remove the recurrence from a recurring task.$/ms, 'No recurrence removal error'); # Now try to generate the error above via regular means - ie, is it actually # doing what it should? # TODO Removing recur: from a recurring task should also remove imask and parent. $output = qx{../src/task rc:bug.rc 2 modify recur: 2>&1 >/dev/null}; like ($output, qr/^You cannot remove the recurrence from a recurring task.$/ms, 'Recurrence removal error'); # Prevent removal of the due date from a recurring task. # TODO Removing due: from a recurring task should also remove recur, imask and parent $output = qx{../src/task rc:bug.rc 2 modify due: 2>&1 >/dev/null}; like ($output, qr/^You cannot remove the due date from a recurring task.$/ms, 'Cannot remove due date from a recurring task'); # Allow removal of the due date from a non-recurring task. qx{../src/task rc:bug.rc add nonrecurring due:today 2>&1}; $output = qx{../src/task rc:bug.rc ls 2>&1}; like ($output, qr/^2 task.$/ms, '2 tasks shown'); my ($id) = $output =~ /(\d+)\s+nonrecurring/; $output = qx{../src/task rc:bug.rc $id modify due: 2>&1}; like ($output, qr/^Modified 1 task.$/ms, 'no task modified'); unlike ($output, qr/^You cannot remove the due date from a recurring task.$/ms, 'Can remove due date from a non-recurring task'); $output = qx{../src/task rc:bug.rc diag 2>&1}; like ($output, qr/^\s+No duplicates found$/m, 'No duplicate UUIDs detected'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.368.t000075500000000000000000000045441213035135600147220ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "dateformat=m/d/Y\n", "confirmation=no\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Setup: Add a recurring task, generate an instance, then add a project. qx{../src/task rc:bug.rc add foo due:today recur:daily until:eom 2>&1}; my $output = qx{../src/task rc:bug.rc info 1 2>&1}; # Result: Make sure the 'until' date is rendered as a date, not an epoch. unlike ($output, qr/Until\s+\d{10}/, 'until is not shown as an epoch'); like ($output, qr/Until\s+\d+\/\d+\/\d{4}/, 'until is shown as a date'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.414.t000075500000000000000000000050571213035135600147120ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 7; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug #414: Tags filtering not working with unicode characters # Add a task with a UTF-8 tag. qx{../src/task rc:bug.rc add one +osobní 2>&1}; my $output = qx{../src/task rc:bug.rc ls +osobní 2>&1}; like ($output, qr/one/, 'found UTF8 tag osobní'); $output = qx{../src/task rc:bug.rc ls -osobní 2>&1}; like ($output, qr/^No matches.$/m, 'not found UTF8 tag osobní'); # And a different one qx{../src/task rc:bug.rc add two +föo 2>&1}; $output = qx{../src/task rc:bug.rc ls +föo 2>&1}; like ($output, qr/two/, 'found UTF8 tag föo'); $output = qx{../src/task rc:bug.rc ls -föo 2>&1}; like ($output, qr/one/, 'found UTF8 tag osobní'); unlike ($output, qr/two/, 'not found UTF8 tag föo'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.417.t000075500000000000000000000046401213035135600147120ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "defaultwidth=100\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug #417: Sorting by countdown_compact not working qx{../src/task rc:bug.rc add due:yesterday before 2>&1}; qx{../src/task rc:bug.rc add due:today now 2>&1}; qx{../src/task rc:bug.rc add due:tomorrow after 2>&1}; my $output = qx{../src/task rc:bug.rc rc.report.long.sort:due+ long 2>&1}; like ($output, qr/before.+now.+after/ms, 'rc.report.long.sort:due+ works'); $output = qx{../src/task rc:bug.rc rc.report.long.sort:due- long 2>&1}; like ($output, qr/after.+now.+before/ms, 'rc.report.long.sort:due- works'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.418.t000075500000000000000000000073231213035135600147140ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 20; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "dateformat=m/d/Y\n", "report.foo.description=Sample\n", "report.foo.columns=id,due,description\n", "report.foo.labels=ID,Due,Description\n", "report.foo.sort=due+\n", "report.foo.filter=status:pending\n", "report.foo.dateformat=MD\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug #418: due.before:eow not working # - with dateformat 'MD' qx{../src/task rc:bug.rc add one due:6/28/2010 2>&1}; qx{../src/task rc:bug.rc add two due:6/29/2010 2>&1}; qx{../src/task rc:bug.rc add three due:6/30/2010 2>&1}; qx{../src/task rc:bug.rc add four due:7/1/2010 2>&1}; qx{../src/task rc:bug.rc add five due:7/2/2010 2>&1}; qx{../src/task rc:bug.rc add six due:7/3/2010 2>&1}; qx{../src/task rc:bug.rc add seven due:7/4/2010 2>&1}; qx{../src/task rc:bug.rc add eight due:7/5/2010 2>&1}; qx{../src/task rc:bug.rc add nine due:7/6/2010 2>&1}; my $output = qx{../src/task rc:bug.rc foo 2>&1}; like ($output, qr/one/ms, 'task 1 listed'); like ($output, qr/two/ms, 'task 2 listed'); like ($output, qr/three/ms, 'task 3 listed'); like ($output, qr/four/ms, 'task 4 listed'); like ($output, qr/five/ms, 'task 5 listed'); like ($output, qr/six/ms, 'task 6 listed'); like ($output, qr/seven/ms, 'task 7 listed'); like ($output, qr/eight/ms, 'task 8 listed'); like ($output, qr/nine/ms, 'task 9 listed'); $output = qx{../src/task rc:bug.rc foo due.before:7/2/2010 2>&1}; like ($output, qr/one/ms, 'task 1 listed'); like ($output, qr/two/ms, 'task 2 listed'); like ($output, qr/three/ms, 'task 3 listed'); like ($output, qr/four/ms, 'task 4 listed'); unlike ($output, qr/five/ms, 'task 5 not listed'); unlike ($output, qr/six/ms, 'task 6 not listed'); unlike ($output, qr/seven/ms, 'task 7 not listed'); unlike ($output, qr/eight/ms, 'task 8 not listed'); unlike ($output, qr/nine/ms, 'task 9 not listed'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.425.t000075500000000000000000000045001213035135600147040ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', '425.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r '425.rc', 'Created 425.rc'); } # Bug #425: Parser preventing editing of an existing task depending on description # Create a task and attempt to revise the description to include the word 'in' # (this breaks in 1.9.3 and earlier) qx{../src/task rc:425.rc add Foo 2>&1}; qx{../src/task rc:425.rc 1 modify Bar in Bar 2>&1}; my $output = qx{../src/task rc:425.rc 1 ls 2>&1}; like ($output, qr/1\s+Bar in Bar/m, 'parser - interpret \'in\' in description'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key 425.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r '425.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.434.t000075500000000000000000000043001213035135600147020ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug #434: Task shouldn't prevent users from marking as done tasks with status:waiting # Add a task that is waiting qx{../src/task rc:bug.rc add One wait:tomorrow 2>&1}; my $output = qx{../src/task rc:bug.rc 1 done 2>&1}; like ($output, qr/Completed 1 task\./, 'Waiting task marked completed'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.438.t000075500000000000000000000067221213035135600147200ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 8; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "dateformat=SNHDMY\n", "report.foo.columns=entry,start,end,description\n", "report.foo.dateformat=SNHDMY\n", "confirmation=off\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug #438: Reports sorting by end, start, and entry are ordered incorrectly, if # time is included. # Ensure the two tasks have a 1 second delta in entry. qx{../src/task rc:bug.rc add older 2>&1}; diag ("1 second delay"); sleep 1; qx{../src/task rc:bug.rc add newer 2>&1}; my $output = qx{../src/task rc:bug.rc rc.report.foo.sort:entry+ foo 2>&1}; like ($output, qr/older.+newer/ms, 'sort:entry+ -> older newer'); $output = qx{../src/task rc:bug.rc rc.report.foo.sort:entry- foo 2>&1}; like ($output, qr/newer.+older/ms, 'sort:entry- -> newer older'); # Ensure the two tasks have a 1 second delta in start. qx{../src/task rc:bug.rc 1 start 2>&1}; diag ("1 second delay"); sleep 1; qx{../src/task rc:bug.rc 2 start 2>&1}; $output = qx{../src/task rc:bug.rc rc.report.foo.sort:start+ foo 2>&1}; like ($output, qr/older.+newer/ms, 'sort:start+ -> older newer'); $output = qx{../src/task rc:bug.rc rc.report.foo.sort:start- foo 2>&1}; like ($output, qr/newer.+older/ms, 'sort:start- -> newer older'); # Ensure the two tasks have a 1 second delta in end. qx{../src/task rc:bug.rc 1 done 2>&1}; diag ("1 second delay"); sleep 1; qx{../src/task rc:bug.rc 2 done 2>&1}; $output = qx{../src/task rc:bug.rc rc.report.foo.sort:end+ foo 2>&1}; like ($output, qr/older.+newer/ms, 'sort:end+ -> older newer'); $output = qx{../src/task rc:bug.rc rc.report.foo.sort:end- foo 2>&1}; like ($output, qr/newer.+older/ms, 'sort:end- -> newer older'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.440.t000075500000000000000000000052441213035135600147070ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', '440.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r '440.rc', 'Created 440.rc'); } # Bug #440: Parser recognizes an attempt to simultaneously subst and append, but doesn't do it # Create a task and attempt simultaneous subst and appends, both permutations qx{../src/task rc:440.rc add Foo 2>&1}; qx{../src/task rc:440.rc add Foo 2>&1}; qx{../src/task rc:440.rc 1 append /Foo/Bar/ Appendtext 2>&1}; qx{../src/task rc:440.rc 2 append Appendtext /Foo/Bar/ 2>&1}; my $output1 = qx{../src/task rc:440.rc 1 ls 2>&1}; my $output2 = qx{../src/task rc:440.rc 2 ls 2>&1}; unlike ($output1, qr/Foo/, 'simultaneous subst and append - subst'); like ($output1, qr/\w+ Appendtext/, 'simultaneous subst and append - append'); unlike ($output2, qr/Foo/, 'simultaneous append and subst - subst'); like ($output2, qr/\w+ Appendtext/, 'simultaneous append and subst - append'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key 440.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r '440.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.441.t000075500000000000000000000042551213035135600147110ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', '441.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r '441.rc', 'Created 441.rc'); } # Bug #441: A colon messes up text replacement with /// qx{../src/task rc:441.rc add one two three 2>&1}; qx{../src/task rc:441.rc 1 modify /two/two:/ 2>&1}; my $output = qx{../src/task rc:441.rc ls 2>&1}; like ($output, qr/one two: three/ms, 'Substitution with colon worked'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key 441.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r '441.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.455.t000075500000000000000000000045251213035135600147160ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', '455.rc') { print $fh "data.location=.\n"; print $fh "print.empty.columns=yes\n"; close $fh; ok (-r '455.rc', 'Created 455.rc'); } # Bug #455 - Text alignment in reports is broken when text contains wide utf8 # characters qx{../src/task rc:455.rc add abc pro:Bar\x{263A} 2>&1}; qx{../src/task rc:455.rc add def pro:Foo! 2>&1}; my $output = qx{../src/task rc:455.rc ls 2>&1}; # ' ' + 'Pri' + ' ' == 5 like ($output, qr/\S\s{5}abc/ms, 'bug 455 - correct spacing in utf8 task'); like ($output, qr/\S\s{5}def/ms, 'bug 455 - correct spacing in non utf8 task'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key 455.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r '455.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.480.t000075500000000000000000000125431213035135600147130ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 40; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "defaultwidth=0\n", "confirmation=off\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug #480 - putting a '@' character in tags breaks filters. qx{../src/task rc:bug.rc add one +ordinary 2>&1}; qx{../src/task rc:bug.rc add two +\@strange 2>&1}; my $output = qx{../src/task rc:bug.rc long +ordinary 2>&1}; like ($output, qr/one/, '+ordinary explicitly included'); # 2 unlike ($output, qr/two/, '@strange implicitly excluded'); $output = qx{../src/task rc:bug.rc long -ordinary 2>&1}; unlike ($output, qr/one/, '-ordinary explicitly excluded'); like ($output, qr/two/, '@strange implicitly included'); # 5 $output = qx{../src/task rc:bug.rc long +\@strange 2>&1}; unlike ($output, qr/one/, '-ordinary implicitly excluded'); like ($output, qr/two/, '@strange explicitly included'); # 7 $output = qx{../src/task rc:bug.rc long -\@strange 2>&1}; like ($output, qr/one/, '+ordinary implicitly included'); # 8 unlike ($output, qr/two/, '@strange explicitly excluded'); # Bug #XXX - '-t1 -t2' doesn't seem to work, when @ characters are involved. unlink 'pending.data'; qx{../src/task rc:bug.rc add one +t1 2>&1}; qx{../src/task rc:bug.rc add two +t2 2>&1}; qx{../src/task rc:bug.rc add three +t3 2>&1}; $output = qx{../src/task rc:bug.rc list -t1 2>&1}; unlike ($output, qr/one/, 'Single: no t1'); like ($output, qr/two/, 'Single: yes t2'); like ($output, qr/three/, 'Single: yes t3'); $output = qx{../src/task rc:bug.rc list -t1 -t2 2>&1}; unlike ($output, qr/one/, 'Double: no t1'); unlike ($output, qr/two/, 'Double: no t2'); like ($output, qr/three/, 'Double: yes t3'); $output = qx{../src/task rc:bug.rc list -t1 -t2 -t3 2>&1}; like ($output, qr/^No matches.$/m, 'No task listed'); unlike ($output, qr/one/, 'Triple: no t1'); unlike ($output, qr/two/, 'Triple: no t2'); unlike ($output, qr/three/, 'Triple: no t3'); # Once again, with @ characters. qx{../src/task rc:bug.rc 1 modify +\@1 2>&1}; qx{../src/task rc:bug.rc 2 modify +\@2 2>&1}; qx{../src/task rc:bug.rc 3 modify +\@3 2>&1}; $output = qx{../src/task rc:bug.rc list -\@1 2>&1}; unlike ($output, qr/one/, 'Single: no @1'); # 19 like ($output, qr/two/, 'Single: yes @2'); like ($output, qr/three/, 'Single: yes @3'); $output = qx{../src/task rc:bug.rc list -\@1 -\@2 2>&1}; unlike ($output, qr/one/, 'Double: no @1'); unlike ($output, qr/two/, 'Double: no @2'); like ($output, qr/three/, 'Double: yes @3'); $output = qx{../src/task rc:bug.rc list -\@1 -\@2 -\@3 2>&1}; like ($output, qr/^No matches.$/m, 'No task listed'); unlike ($output, qr/one/, 'Triple: no @1'); unlike ($output, qr/two/, 'Triple: no @2'); unlike ($output, qr/three/, 'Triple: no @3'); # Once again, with @ characters and punctuation. qx{../src/task rc:bug.rc 1 modify +\@foo.1 2>&1}; qx{../src/task rc:bug.rc 2 modify +\@foo.2 2>&1}; qx{../src/task rc:bug.rc 3 modify +\@foo.3 2>&1}; $output = qx{../src/task rc:bug.rc list -\@foo.1 2>&1}; unlike ($output, qr/one/, 'Single: no @foo.1'); like ($output, qr/two/, 'Single: yes @foo.2'); like ($output, qr/three/, 'Single: yes @foo.3'); $output = qx{../src/task rc:bug.rc list -\@foo.1 -\@foo.2 2>&1}; unlike ($output, qr/one/, 'Double: no @foo.1'); unlike ($output, qr/two/, 'Double: no @foo.2'); like ($output, qr/three/, 'Double: yes @foo.3'); $output = qx{../src/task rc:bug.rc list -\@foo.1 -\@foo.2 -\@foo.3 2>&1}; like ($output, qr/^No matches.$/m, 'No task listed'); unlike ($output, qr/one/, 'Triple: no @foo.1'); unlike ($output, qr/two/, 'Triple: no @foo.2'); unlike ($output, qr/three/, 'Triple: no @foo.3'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.485.x000075500000000000000000000045471213035135600147310ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 9; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug #485 - 'task list recur:month' doesn't list monthly tasks qx{../src/task rc:bug.rc add one due:tomorrow recur:monthly}; qx{../src/task rc:bug.rc add two due:tomorrow recur:month}; my $output = qx{../src/task rc:bug.rc list recur:monthly}; like ($output, qr/one/, 'monthly -> monthly'); like ($output, qr/two/, 'month -> monthly'); $output = qx{../src/task rc:bug.rc list recur:month}; like ($output, qr/one/, 'monthly -> month'); like ($output, qr/two/, 'month -> month'); # 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 'bug.rc'; ok (!-r 'bug.rc', 'Removed bug.rc'); exit 0; task-2.2.0-test/bug.489.t000075500000000000000000000042701213035135600147220ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug #489 - tags.none: is not filtering tagless tasks qx{../src/task rc:bug.rc add with +tag 2>&1}; qx{../src/task rc:bug.rc add without 2>&1}; my $output = qx{../src/task rc:bug.rc list tags.none: 2>&1}; unlike ($output, qr/with /, 'tags.none: skips tagged'); like ($output, qr/without/, 'tags.none: finds tagless'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.495.t000075500000000000000000000043131213035135600147150ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug #495 - double hyphen mishandled for annotations. qx{../src/task rc:bug.rc add foo 2>&1}; qx{../src/task rc:bug.rc 1 annotate "This -- is -- a -- test" 2>&1}; my $output = qx{../src/task rc:bug.rc list 2>&1}; like ($output, qr/This is -- a -- test/, 'Double hyphens preserved, except the first ones.'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.555.t000075500000000000000000000041521213035135600147130ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug #555 - log with a project segfaults. my $output = qx{../src/task rc:bug.rc log description project:p 2>&1}; like ($output, qr/^Logged task.$/m, 'task logged'); unlike ($output, qr/Segmentation fault/, 'no segfault from log with project'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.580.t000075500000000000000000000066431213035135600147200ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 11; use File::Copy; use constant false => 0; use constant true => 1; # Create data locations mkdir("local", 0755); ok(-e 'local', "Created directory local"); mkdir("remote", 0755); ok(-e 'remote', "Created directory remote"); # Create the rc files. if (open my $fh, '>', 'local.rc') { print $fh "data.location=./local\n", "confirmation=no\n", "merge.default.uri=remote/\n", "merge.autopush=yes\n"; close $fh; ok (-r 'local.rc', 'Created local.rc'); } if (open my $fh, '>', 'remote.rc') { print $fh "data.location=./remote\n", "confirmation=no\n", "merge.autopush=no\n"; close $fh; ok (-r 'remote.rc', 'Created remote.rc'); } # add a remote task qx{../src/task rc:remote.rc add remote task 2>&1}; # add a local task qx{../src/task rc:local.rc add local task 2>&1}; # merge and autopush qx{../src/task rc:local.rc merge 2>&1}; my $output = qx{../src/task rc:remote.rc ls 2>&1}; like ($output, qr/local task/, "autopush failed"); # Cleanup. unlink qw(local/pending.data local/completed.data local/undo.data local/undo.save local/backlog.data local/synch.key local.rc); ok (! -r 'local/pending.data' && ! -r 'local/completed.data' && ! -r 'local/undo.data' && ! -r 'local/undo.save' && ! -r 'local/backlog.data' && ! -r 'local/synch.key' && ! -r 'local.rc', 'Cleanup'); unlink qw(remote/pending.data remote/completed.data remote/undo.data remote/backlog.data remote/synch.key remote.rc); ok (! -r 'remote/pending.data' && ! -r 'remote/completed.data' && ! -r 'remote/undo.data' && ! -r 'remote/backlog.data' && ! -r 'remote/synch.key' && ! -r 'remote.rc', 'Cleanup'); rmdir("remote/extensions"); ok (!-e "remote/extensions", "Removed dir remote/extensions"); rmdir("remote"); ok (!-e "remote", "Removed dir remote"); rmdir("local/extensions"); ok (!-e "local/extensions", "Removed dir local/extensions"); rmdir("local"); ok (!-e "local", "Removed dir local"); exit 0; task-2.2.0-test/bug.605.t000075500000000000000000000050511213035135600147060ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug #605 - project count zero bug? # Setup: Add a task and complete it qx{../src/task rc:bug.rc add One project:p1 2>&1}; # Delete the task and note the completion status of the project. my $output = qx{echo 'y' | ../src/task rc:bug.rc 1 delete 2>&1 >/dev/null}; like ($output, qr/is 0\% complete/ms, 'Empty project correctly reported as being 0% completed.'); # Add another task, complete it and note the completion status of hte project. qx{../src/task rc:bug.rc add Two project:p1 2>&1}; $output = qx{../src/task rc:bug.rc 2 done 2>&1 >/dev/null}; like ($output, qr/is 100\% complete/ms, 'Empty project correctly reported as being 100% completed.'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.628.t000075500000000000000000000044021213035135600147120ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=no\n", "dateformat=a b D Y\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 628: task wait: with non-standard dateformat bug # Setup: Add a task qx{../src/task rc:bug.rc add wait:\\"Wed Jan 01 2020\\" A buggy task 2>&1}; # Result: Immediately delete the created task my $output = qx{../src/task rc:bug.rc waiting 2>&1}; like ($output, qr/1\/1\/2020/ms, 'a b D Y dateformat correctly parsed.'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.634.t000075500000000000000000000044121213035135600147100ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 634: confirmation=off not honored by undo # Setup: Add a task qx{../src/task rc:bug.rc add Test 2>&1}; # Result: Attempt to undo add with confirmation=off my $output = qx{echo 'n' | ../src/task rc:bug.rc rc.confirmation=off undo 2>&1}; like ($output, qr/^Task removed.$/ms, 'Task removed.'); unlike ($output, qr/Are you sure/ms, 'Undo honours confirmation=off.'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.635.t000075500000000000000000000044701213035135600147150ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 635: /OLD/NEW/g is broken? # Setup: Add a task with two identical spelling mistakes qx{../src/task rc:bug.rc add Pay teh rent on teh 31st 2>&1}; # Process: Global replace incorrect text qx{../src/task rc:bug.rc 1 modify /teh/the/g 2>&1}; # Result: Verify corrected output my $output = qx{../src/task rc:bug.rc ls 1 2>&1}; like ($output, qr/Pay the rent on the 31st/ms, 'Global replace performed correctly.'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.649.t000075500000000000000000000045331213035135600147220ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 649: 1.9.4 commit ae4e286 - Recurring tasks can't be immediately # marked completed # Setup: Add a recurring task qx{../src/task rc:bug.rc add Test due:3d rec:1w 2>&1}; # Result: Immediately delete the created task my $output = qx{../src/task rc:bug.rc 1 done 2>&1}; like ($output, qr/is neither pending nor waiting/, 'Parent task not completable'); unlike ($output, qr/Completed 1/ms, 'New recurring task cannot be immediately completed.'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.656.t000075500000000000000000000050511213035135600147140ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 656: Recurring task continually spawns new tasks # Setup: Add a pair of recurring tasks qx{../src/task rc:bug.rc add First recurring task due:tomorrow rec:daily 2>&1}; qx{../src/task rc:bug.rc add Second recurring task due:tomorrow rec:daily 2>&1}; # Bug describes that each time task is executed, another child task of the # Second recurring task is created. qx{../src/task rc:bug.rc ls 2>&1}; # Result: Check for an extra task the second time task ls is executed my $output = qx{../src/task rc:bug.rc ls 2>&1}; like ($output, qr/^2 tasks$/ms, '2 tasks shown.'); unlike ($output, qr/^\s3\s*Second recurring task\s*$/ms, 'Extra task detected.'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.668.t000075500000000000000000000047651213035135600147320ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 8; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 668: URL should allow users with dot character my $output = qx{../src/task rc:bug.rc merge user.name\@taskwarrior.org:undo.data 2>&1}; like ($output, qr/ssh failed/, 'ssh does not connect'); unlike ($output, qr/not a valid modifier/, 'scp syntax with dots'); unlike ($output, qr/not in the expected format/, 'scp syntax with dots'); $output = qx{../src/task rc:bug.rc merge ssh://user.name\@taskwarrior.org/undo.data 2>&1}; like ($output, qr/ssh failed/, 'ssh does not connect'); unlike ($output, qr/not a valid modifier/, 'standard syntax with dots'); unlike ($output, qr/not in the expected format/, 'standard syntax with dots'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.674.t000075500000000000000000000045321213035135600147170ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 674: ID numbers change between reports when marking tasks as done # Setup: Add a few tasks qx{../src/task rc:bug.rc add One 2>&1}; qx{../src/task rc:bug.rc add Two 2>&1}; qx{../src/task rc:bug.rc add Three 2>&1}; # Complete task 1 and then attempt to complete task 2 qx{../src/task rc:bug.rc 1 done 2>&1}; # Result: Immediately delete the created task my $output = qx{../src/task rc:bug.rc 2 done 2>&1}; like ($output, qr/Two/ms, 'IDs correctly remain unchanged after done'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.694.t000075500000000000000000000043741213035135600147250ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 694: Potential bug for "due" and "annotate" # Setup: Add a tasks, annotate with long word. qx{../src/task rc:bug.rc add One 2>&1}; qx{../src/task rc:bug.rc 1 annotate foo due:today 2>&1}; # List with rc.hyphenate=on. my $output = qx{../src/task rc:bug.rc 1 info 2>&1}; like ($output, qr/One/, 'found One'); like ($output, qr/foo/, 'found foo'); like ($output, qr/Due/, 'found Due'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.697.x000075500000000000000000000066121213035135600147310ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 697: Making a blocking task recur breaks dependency. # 1. Create 2 tasks: "foo" and "bar". # 2. Give "bar" a due date. # 3. Make "foo" depend on "bar". # 4. Make "bar" recur yearly. qx{../src/task rc:bug.rc add foo 2>&1}; qx{../src/task rc:bug.rc add bar 2>&1}; qx{../src/task rc:bug.rc 2 modify due:eom 2>&1}; qx{../src/task rc:bug.rc 1 modify depends:2 2>&1}; qx{../src/task rc:bug.rc 2 modify recur:yearly 2>&1}; qx{../src/task rc:bug.rc ls}; # Generate child recurring tasks. # Here is the pending.data: # # [depends:"0e200da3-7d73-44e8-9a51-6b0263414db6" description:"foo" entry:"1330839054" status:"pending" uuid:"dcd04ff6-c074-47d3-9346-211a1b739bdd"] # [description:"bar" due:"1333166400" entry:"1330839054" mask:"-" recur:"yearly" status:"recurring" uuid:"0e200da3-7d73-44e8-9a51-6b0263414db6"] # [description:"bar" due:"1333166400" entry:"1330839054" imask:"0" parent:"0e200da3-7d73-44e8-9a51-6b0263414db6" recur:"yearly" status:"pending" uuid:"538daa82-d481-4033-b98e-06e98fbe1073"] # # The problem is that although 1 --> 2, 2 is now a recurring parent, and as 1 # depends on the parent's UUID, it is not something transferred to the child on # generation, because the dependency belongs with 1, not 2. my $output = qx{../src/task rc:bug.rc 1 info 2>&1}; like ($output, qr/is blocked by\s+2/, 'verified 1 --> 2'); $output = qx{../src/task rc:bug.rc 2 info 2>&1}; like ($output, qr/is blocking\s+1/, 'verified 2 <-- 1'); $output = qx{../src/task rc:bug.rc 3 info 2>&1}; like ($output, qr/is blocked by\s+2/, 'verified 1 --> 2'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.703.t000075500000000000000000000055271213035135600147150ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 10; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; print $fh "confirmation=no\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 703: /from/t/g fails to make all changes to annotations # Setup: Add a few tasks qx{../src/task rc:bug.rc add This is a test 2>&1}; qx{../src/task rc:bug.rc 1 annotate Annotation one 2>&1}; qx{../src/task rc:bug.rc 1 annotate Annotation two 2>&1}; qx{../src/task rc:bug.rc 1 annotate Annotation three 2>&1}; my $output = qx{../src/task rc:bug.rc list 2>&1}; like ($output, qr/This is a test/, 'original description'); like ($output, qr/Annotation one/, 'original annotation one'); like ($output, qr/Annotation two/, 'original annotation two'); like ($output, qr/Annotation three/, 'original annotation three'); qx{../src/task rc:bug.rc 1 modify /i/I/g 2>&1}; $output = qx{../src/task rc:bug.rc list 2>&1}; like ($output, qr/ThIs Is a test/, 'new description'); like ($output, qr/AnnotatIon one/, 'new annotation one'); like ($output, qr/AnnotatIon two/, 'new annotation two'); like ($output, qr/AnnotatIon three/, 'new annotation three'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.708.t000075500000000000000000000067031213035135600147170ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; print $fh "bulk=100\n"; print $fh "confirmation=no\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 708: Bad Math in Project is % Complete # Setup: Add a few tasks qx{../src/task rc:bug.rc add One pro:p1 2>&1}; qx{../src/task rc:bug.rc add Two pro:p1 2>&1}; qx{../src/task rc:bug.rc add Three pro:p1 2>&1}; qx{../src/task rc:bug.rc add Four pro:p1 2>&1}; qx{../src/task rc:bug.rc add Five pro:p1 2>&1}; qx{../src/task rc:bug.rc add Six pro:p1 2>&1}; qx{../src/task rc:bug.rc add Seven pro:p1 2>&1}; qx{../src/task rc:bug.rc add Eight pro:p1 2>&1}; qx{../src/task rc:bug.rc add Nine pro:p1 2>&1}; qx{../src/task rc:bug.rc add Ten pro:p1 2>&1}; # Complete three tasks and ensure pending and done counts are updated correctly. my $output = qx{../src/task rc:bug.rc 1-3 do 2>&1 >/dev/null}; like ($output, qr/Project 'p1' is 30% complete \(7 of 10 tasks remaining\)\./ms, 'Project counts correct for a multiple done'); # Change three projects and ensure pending and done counts are updated correctly. $output = qx{../src/task rc:bug.rc 4-6 modify pro:p2 2>&1 >/dev/null}; like ($output, qr/Project 'p1' is 42% complete \(4 of 7 tasks remaining\)\./ms, 'Project counts correct for a multiple project reassignment part a'); like ($output, qr/Project 'p2' is 0% complete \(3 of 3 tasks remaining\)\./ms, 'Project counts correct for a multiple project reassignment part b'); # Delete three tasks and ensure pending and done counts are updated correctly. $output = qx{../src/task rc:bug.rc 7-9 del 2>&1 >/dev/null}; like ($output, qr/Project 'p1' is 75% complete \(1 of 4 tasks remaining\)\./ms, 'Project counts correct for a multiple delete'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.804.t000075500000000000000000000052221213035135600147070ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "bulk=100\n", "confirmation=no\n", "print.empty.columns=yes\n", "report.ls.labels=ID,Project,Pri,Description\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 804: URL link and break line # Setup: Add a tasks, annotate with long word. qx{../src/task rc:bug.rc add One 2>&1}; qx{../src/task rc:bug.rc 1 annotate abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz 2>&1}; # List with rc.hyphenate=on. my $output = qx{../src/task rc:bug.rc rc.defaultwidth:40 rc.hyphenate:on ls 2>&1}; like ($output, qr/vwx-\n/ms, 'hyphenated 1'); like ($output, qr/tuv-\n/ms, 'hyphenated 2'); # List with rc.hyphenate=off. $output = qx{../src/task rc:bug.rc rc.defaultwidth:40 rc.hyphenate:off ls 2>&1}; like ($output, qr/vwxy\n/ms, 'not hyphenated 1'); like ($output, qr/uvwx\n/ms, 'not hyphenated 2'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.818.t000075500000000000000000000057451213035135600147260ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 10; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug #818: Filtering by tag counter-intuitively uses partial match qx{../src/task rc:bug.rc add +hannah +anna Buy some bananas 2>&1}; my $output = qx{../src/task rc:bug.rc list +hannah 2>&1}; like ($output, qr/bananas/, 'Containing tag query'); $output = qx{../src/task rc:bug.rc list +anna 2>&1}; like ($output, qr/bananas/, 'Contained tag query'); qx{../src/task rc:bug.rc add +anna +hannah Buy tickets to Santana 2>&1}; $output = qx{../src/task rc:bug.rc list +anna 2>&1}; like ($output, qr/Santana/, 'Contained tag query'); $output = qx{../src/task rc:bug.rc list +hannah 2>&1}; like ($output, qr/Santana/, 'Containing tag query'); # Buy some bananas +hannah +anna # Buy tickets to Santana +anna +hannah # AAA +hannah # BBB +anna qx{../src/task rc:bug.rc add +hannah AAA 2>&1}; qx{../src/task rc:bug.rc add +anna BBB 2>&1}; $output = qx{../src/task rc:bug.rc long +anna 2>&1}; like ($output, qr/bananas/, '+anna --> bananas'); like ($output, qr/Santana/, '+anna --> Santana'); unlike ($output, qr/AAA/, '+anna !-> AAA'); like ($output, qr/BBB/, '+anna --> BBB'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.819.t000075500000000000000000000046201213035135600147160ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 819: When I run "task add foo\'s bar." the description of the new task is "foo 's bar .". qx{../src/task rc:bug.rc add foo\\'s bar. 2>&1}; qx{../src/task rc:bug.rc add foo \\(bar\\) 2>&1}; qx{../src/task rc:bug.rc add \\'baz \\(qux\\)\\' 2>&1}; my $output = qx{../src/task rc:bug.rc ls 2>&1}; like ($output, qr/foo's bar\./, "foo's bar. --> preserved"); #like ($output, qr/foo \(bar\)/, "foo \(bar\) -- preserved"); pass ("foo \(bar\) -- preserved -- TEST SKIPPED --"); like ($output, qr/baz \(qux\)/, "baz \(qux\) -- preserved"); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.835.t000075500000000000000000000043701213035135600147160ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } qx{../src/task rc:bug.rc add pro:main.subproject Test 2>&1}; my $output = qx{../src/task rc:bug.rc ls 2>&1}; like ($output, qr/main\.subproject/, "hierarchical project ok"); qx{../src/task rc:bug.rc \\(pro:main.subproject\\) ls 2>&1}; like ($output, qr/main\.subproject/, "Parens tolerated"); unlike ($output, qr/Mismatched parentheses in expression/, "No 'mismatch' error generated"); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.837.t000075500000000000000000000050001213035135600147070ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 837: When a task is completed, tasks that depended upon it don't have # correct urgency and depend on 0 when edited qx{../src/task rc:bug.rc add one 2>&1}; qx{../src/task rc:bug.rc add two dep:1 2>&1}; qx{../src/task rc:bug.rc long 2>&1}; my $output = qx{../src/task rc:bug.rc 1 _urgency 2>&1}; like ($output, qr/ 8\n/, 'blocking urgency == 8'); $output = qx{../src/task rc:bug.rc 2 _urgency 2>&1}; like ($output, qr/ -5\n/, 'blocked urgency == -5'); qx{../src/task rc:bug.rc 1 done 2>&1}; qx{../src/task rc:bug.rc list 2>&1}; $output = qx{../src/task rc:bug.rc 1 _urgency 2>&1}; like ($output, qr/ 0\n/, 'unblocked urgency == 0'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.839.t000075500000000000000000000044571213035135600147300ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } if (open my $fh, '>', 'pending.data') { print $fh "[description:\"One\" entry:\"1200871621\" due:\"1200871621\" recur:\"1m\" status:\"recurring\" uuid:\"ebeeab00-ccf8-464b-8b58-f7f2d606edfb\"]\n"; close $fh; ok (-r 'pending.data', 'Created pending.data'); } my $output = qx{../src/task rc:bug.rc list 2>&1}; like ($output, qr/One/, 'task listed'); unlike ($output, qr/The recurrence value '1m' is not valid\./, 'recu:1m => no error'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.851.t000075500000000000000000000051111213035135600147060ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 8; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 851: Filtering by due dates with ordinal and d/wks/etc. doesn't work qx{../src/task rc:bug.rc add yesterday due:-2days 2>&1}; qx{../src/task rc:bug.rc add tomorrow due:2days 2>&1}; my $output = qx{../src/task rc:bug.rc ls 2>&1}; like ($output, qr/yesterday/, "yesterday - task added"); like ($output, qr/tomorrow/, "tomorrow - task added"); $output = qx{../src/task rc:bug.rc list due.before:1d 2>&1}; like ($output, qr/yesterday/, "yesterday - found before:1d"); unlike ($output, qr/tomorrow/, "tomorrow - not found before:1d"); $output = qx{../src/task rc:bug.rc list due.after:1d 2>&1}; unlike ($output, qr/yesterday/, "yesterday - not found after:1d"); like ($output, qr/tomorrow/, "tomorrow - found after:1d"); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.856.t000075500000000000000000000052551213035135600147240ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 8; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 856: "task list project.none:" does not work. # Note: Not using "assigned" and "unassigned" because one is a subset of the # other. qx{../src/task rc:bug.rc add assigned project:X 2>&1}; qx{../src/task rc:bug.rc add floating 2>&1}; my $output = qx{../src/task rc:bug.rc ls project: 2>&1}; like ($output, qr/floating/, 'project: matches floating'); unlike ($output, qr/assigned/, 'project: does not match assigned'); $output = qx{../src/task rc:bug.rc ls project:'' 2>&1}; like ($output, qr/floating/, 'project:\'\' matches floating'); unlike ($output, qr/assigned/, 'project:\'\' does not match assigned'); $output = qx{../src/task rc:bug.rc ls project.none: 2>&1}; like ($output, qr/floating/, 'project.none: matches floating'); unlike ($output, qr/assigned/, 'project.none: does not match assigned'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.860.t000075500000000000000000000040761213035135600147170ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 869: lower case priorities aren't accepted. qx{../src/task rc:bug.rc add foo pri:h 2>&1}; my $output = qx{../src/task rc:bug.rc 1 info 2>&1}; like ($output, qr/Priority\s+H/, "pri:h --> pri:H"); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.879.t000075500000000000000000000051511213035135600147240ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 8; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 879: Backslash at end of description/annotation causes problems. qx{../src/task rc:bug.rc add one\\\\ 2>&1}; my $output = qx{../src/task rc:bug.rc list 2>&1}; like ($output, qr/one\\/, 'Backslash preserved in description'); qx{../src/task rc:bug.rc 1 annotate foo\\\\ 2>&1}; $output = qx{../src/task rc:bug.rc list 2>&1}; like ($output, qr/one\\/, 'Backslash preserved in description'); like ($output, qr/foo\\/, 'Backslash preserved in annotation 1'); qx{../src/task rc:bug.rc 1 annotate bar\\\\ 2>&1}; $output = qx{../src/task rc:bug.rc list 2>&1}; like ($output, qr/one\\/, 'Backslash preserved in description'); like ($output, qr/foo\\/, 'Backslash preserved in annotation 1'); like ($output, qr/bar\\/, 'Backslash preserved in annotation 2'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.884.t000075500000000000000000000044121213035135600147170ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 884: Extra space in path name. qx{../src/task rc:bug.rc add /one/two/three/ 2>&1}; qx{../src/task rc:bug.rc add \\'/four/five/six/\\' 2>&1}; my $output = qx{../src/task rc:bug.rc ls 2>&1}; #like ($output, qr/\/one\/two\/three\//, "/one/two/three/ --> preserved"); pass ("/one/two/three/ --> preserved -- TEST SKIPPED --"); like ($output, qr/\/four\/five\/six\//, "/four/five/six/ --> preserved"); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.886.t000075500000000000000000000043201213035135600147170ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 886: tw doesn't warn the user if, e.g., a weekday cannot be resolved properly my $output = qx{../src/task rc:bug.rc add one due:sund 2>&1}; like ($output, qr/Created task 1\./, 'sund --> valid date'); $output = qx{../src/task rc:bug.rc add two due:donkey 2>&1 >/dev/null}; like ($output, qr/was not recognized/, 'donkey --> invalid date'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.899.t000075500000000000000000000050361213035135600147300ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 899: task log does not behave correctly when logging into a project my $output = qx{../src/task rc:bug.rc add one pro:A 2>&1 >/dev/null}; like ($output, qr/ 0% complete \(1 of 1 /, '1 of 1 tasks remaining - 0%'); $output = qx{../src/task rc:bug.rc add two pro:A 2>&1 >/dev/null}; like ($output, qr/ 0% complete \(2 of 2 /, '2 of 2 tasks remaining - 0%'); $output = qx{../src/task rc:bug.rc 1 done 2>&1 >/dev/null}; like ($output, qr/ 50% complete \(1 of 2 /, '1 of 2 tasks remaining - 50%'); $output = qx{../src/task rc:bug.rc log three pro:A 2>&1 >/dev/null}; like ($output, qr/ 66% complete \(1 of 3 /, '1 of 3 tasks remaining - 66%'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.906.t000075500000000000000000000061271213035135600147170ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 17; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 906: escaping runs amok qx{../src/task rc:bug.rc add zero 2>&1}; qx{../src/task rc:bug.rc add one pro:a.b 2>&1}; qx{../src/task rc:bug.rc add two pro:a 2>&1}; my $output = qx{../src/task rc:bug.rc list 2>&1}; like ($output, qr/zero/, 'list - zero included'); like ($output, qr/one/, 'list - one included'); like ($output, qr/two/, 'list - two included'); $output = qx{../src/task rc:bug.rc list pro:a 2>&1}; unlike ($output, qr/zero/, 'list - zero excluded'); like ($output, qr/one/, 'list - one included'); like ($output, qr/two/, 'list - two included'); $output = qx{../src/task rc:bug.rc list pro:a.b 2>&1}; unlike ($output, qr/zero/, 'list - zero included'); like ($output, qr/one/, 'list - one excluded'); unlike ($output, qr/two/, 'list - two included'); $output = qx{../src/task rc:bug.rc list pro.not:a 2>&1}; like ($output, qr/zero/, 'list - zero included'); unlike ($output, qr/one/, 'list - one excluded'); unlike ($output, qr/two/, 'list - two excluded'); $output = qx{../src/task rc:bug.rc list pro.not:a.b 2>&1}; like ($output, qr/zero/, 'list - zero included'); unlike ($output, qr/one/, 'list - one excluded'); like ($output, qr/two/, 'list - two included'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.917.t000075500000000000000000000047261213035135600147240ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 917: escaping runs amok qx{../src/task rc:bug.rc add one \\'two\\' three 2>&1}; qx{../src/task rc:bug.rc add four \\"five\\" six 2>&1}; my $output = qx{../src/task rc:bug.rc list 2>&1}; like ($output, qr/one 'two' three/, 'Single quote preserved'); like ($output, qr/four "five" six/, 'Double quote preserved'); qx{../src/task rc:bug.rc 1,2 mod +tag 2>&1}; $output = qx{../src/task rc:bug.rc list 2>&1}; like ($output, qr/one 'two' three/, 'Single quote preserved after modification'); like ($output, qr/four "five" six/, 'Double quote preserved after modification'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.924.t000075500000000000000000000044571213035135600147230ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 924: '1.0' --> '1.0000' qx{../src/task rc:bug.rc add release 1.0 2>&1}; qx{../src/task rc:bug.rc add 'release 2.0' 2>&1}; qx{../src/task rc:bug.rc add "release 3.0" 2>&1}; my $output = qx{../src/task rc:bug.rc list 2>&1}; like ($output, qr/\s1.0\n/ms, 'Plain text floating point preserved'); like ($output, qr/\s2.0\n/ms, 'Single quote floating point preserved'); like ($output, qr/\s3.0\n/ms, 'Double quote floating point preserved'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.932.t000075500000000000000000000062311213035135600147120ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 12; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 932: Modifying recurring task's recurrence period - strange outcome # - add a recurring task with multiple child tasks # - modify a child task and test for propagation # - modify the parent task and test for propagation qx{../src/task rc:bug.rc add R due:yesterday recur:daily 2>&1}; my $output = qx{../src/task rc:bug.rc list 2>&1}; like ($output, qr/2.+R/ms, 'Found child 0'); like ($output, qr/3.+R/ms, 'Found child 1'); like ($output, qr/4.+R/ms, 'Found child 2'); qx{echo 'y' | ../src/task rc:bug.rc 2 mod project:P 2>&1}; $output = qx{../src/task rc:bug.rc list 2>&1}; like ($output, qr/2\s+P.+R/ms, 'Found modified child 0'); like ($output, qr/3\s+P.+R/ms, 'Found modified child 1 (propagated from 0)'); like ($output, qr/4\s+P.+R/ms, 'Found modified child 2 (propagated from 0)'); qx{echo 'y' | ../src/task rc:bug.rc 1 mod priority:H 2>&1}; $output = qx{../src/task rc:bug.rc list 2>&1}; like ($output, qr/2\s+P.+H.+R/ms, 'Found modified child 0 (propagated from parent'); like ($output, qr/3\s+P.+H.+R/ms, 'Found modified child 1 (propagated from parent)'); like ($output, qr/4\s+P.+H.+R/ms, 'Found modified child 2 (propagated from parent)'); $output = qx{../src/task rc:bug.rc diag 2>&1}; like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.954.t000075500000000000000000000051251213035135600147170ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 954 - Deleting task by uuid attempts deleting all tasks # - adding two tasks "foo" and "bar" # - deleting task with UUID 874e146d-07a2-2d2c-7808-a76e74b1a332 # - searching for tasks "foo" and "bar" qx{../src/task rc:bug.rc add foo 2>&1}; qx{../src/task rc:bug.rc add bar 2>&1}; my $output = qx{../src/task rc:bug.rc list 2>&1}; like ($output, qr/foo/ms, 'Task foo added'); like ($output, qr/bar/ms, 'Task bar added'); qx{../src/task rc:bug.rc rc.confirmation=off rc.verbose=nothing rc.bulk=1000 874e146d-07a2-2d2c-7808-a76e74b1a332 delete 2>&1}; $output = qx{../src/task rc:bug.rc list 2>&1}; like ($output, qr/foo/ms, 'Task foo not deleted'); like ($output, qr/bar/ms, 'Task bar not deleted'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.955.t000075500000000000000000000047771213035135600147340ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=on\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 955: When deleting the child of a recurring task, taskwarrior does not ask # whether it should delete the parent. qx{../src/task rc:bug.rc add foo due:now recur:1day 2>&1}; my $output = qx{../src/task rc:bug.rc ls 2>&1}; like ($output, qr/^2 tasks/ms, '2 child tasks created'); qx{printf 'y\nn\n' | ../src/task rc:bug.rc 2 delete 2>&1}; $output = qx{../src/task rc:bug.rc ls 2>&1}; like ($output, qr/^1 task/ms, '1 child task remaining'); qx{printf 'y\ny\n' | ../src/task rc:bug.rc 2 delete 2>&1}; $output = qx{../src/task rc:bug.rc ls 2>&1}; like ($output, qr/^No matches/ms, 'No tasks remaining'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.956.t000075500000000000000000000065211213035135600147220ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 14; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 956 - 'task ids' prints the header, which prevents using the command in # external script (it applies also for 'uuids' and helper subcommands). qx{../src/task rc:bug.rc add test 2>&1}; # Solution 1: rc.verbose=nothing my $output = qx{TASKRC=bug.rc ../src/task rc:bug.rc rc.verbose=nothing ids 2>&1}; like ($output, qr/^1$/m, 'ID 1 shown'); unlike ($output, qr/TASKRC/ms, 'The header does not appear with "ids" (rc.verbose=nothing)'); $output = qx{TASKRC=bug.rc ../src/task rc.verbose=nothing uuids 2>&1}; like ($output, qr/^[0-9a-f-]*$/m, 'UUID shown'); unlike ($output, qr/TASKRC/ms, 'The header does not appear with "uuids" (rc.verbose=nothing)'); $output = qx{TASKRC=bug.rc ../src/task rc.verbose=nothing uuids 2>&1}; like ($output, qr/^[0-9a-f-]*$/m, 'UUID shown'); unlike ($output, qr/TASKRC/ms, 'The header does not appear with "uuids" (rc.verbose=nothing)'); # Solution 2: task ... 2>/dev/null $output = qx{TASKRC=bug.rc ../src/task rc:bug.rc ids 2>/dev/null}; like ($output, qr/^1$/m, 'ID 1 shown'); unlike ($output, qr/TASKRC/ms, 'The header does not appear with "ids" (2>/dev/null)'); $output = qx{TASKRC=bug.rc ../src/task _ids 2>/dev/null}; like ($output, qr/^[0-9a-f-]*$/m, 'UUID shown'); unlike ($output, qr/TASKRC/ms, 'The header does not appear with "_ids" (2>/dev/null)'); $output = qx{TASKRC=bug.rc ../src/task _ids 2>/dev/null}; like ($output, qr/^[0-9a-f-]*$/m, 'UUID shown'); unlike ($output, qr/TASKRC/ms, 'The header does not appear with "_ids" (2>/dev/null)'); ### Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.972.t000075500000000000000000000041741213035135600147220ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "recurrence.limit=1\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 972: A recurrence period of "7" is interpreted as "7s", not "7d" as # intended. my $output = qx{../src/task rc:bug.rc add foo due:now recur:2 2>&1}; like ($output, qr/ not recognized as valid, /, 'recur:2 is not valid'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.982.x000075500000000000000000000042211213035135600147200ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'minus.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'minus.rc', 'Created minus.rc'); } # Bug 982: Missing words when adding a description with NUMBER-SOMETHING qx{../src/task rc:minus.rc add 1-test 1+tag 2>&1}; my $output = qx{../src/task rc:minus.rc 1 info 2>&1}; like ($output, qr/^Description 1-test 1\+tag$/ms, 'Description contains plus and minus signs'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key minus.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'minus.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.986.t000075500000000000000000000053731213035135600147310ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "verbose=nothing\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 986 - 'task info' does not format date using dateformat.report # Rely on the assumption that the default date format is 'm/d/Y' # Create one task (with a creation date) and one journal entry (with a # timestamp and a date inside the entry) qx{../src/task rc:bug.rc add test 2>&1}; qx{../src/task rc:bug.rc test start 2>&1}; # Test that dateformat.info has precedence over dateformat and that no other # format is applied my $output = qx{../src/task rc:bug.rc test info rc.dateformat:m/d/Y rc.dateformat.info:__ 2>&1}; like ($output, qr/__/ms, 'Date formatted according to dateformat.info'); unlike ($output, qr/[0-9]*\/[0-9]*\/20[0-9]*/ms, 'No date is incorrectly formatted'); # Similar for dateformat $output = qx{../src/task rc:bug.rc test info rc.dateformat:__ rc.dateformat.info: 2>&1}; like ($output, qr/__/ms, 'Date formatted according to dateformat'); ### Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.987.x000075500000000000000000000113061213035135600147270ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 9; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 987 - 'Total active time' is still increasing when a task is done # Test all cases for which the active duration must be close to zero and # constant: # - start (a), stop (o), done (d) and none (n) # (none disallows the name of each task to be the prefix of any other) qx{../src/task rc:bug.rc add test_aodn}; qx{../src/task rc:bug.rc test_aodn start}; qx{faketime -f '+1s' ../src/task rc:bug.rc test_aodn stop}; qx{faketime -f '+2s' ../src/task rc:bug.rc test_aodn done}; check_constant_close_zero("test_aodn"); # - start and done qx{../src/task rc:bug.rc add test_adn}; qx{../src/task rc:bug.rc test_adn start}; qx{faketime -f '+1s' ../src/task rc:bug.rc test_adn done}; check_constant_close_zero("test_adn"); # - start, done and stop qx{../src/task rc:bug.rc add test_adon}; qx{../src/task rc:bug.rc test_adon start}; qx{faketime -f '+1s' ../src/task rc:bug.rc test_adon done}; qx{faketime -f '+2s' ../src/task rc:bug.rc test_adon stop}; check_constant_close_zero("test_adon"); # - done, start and stop (XXX whether this should be allowed is questionable) qx{../src/task rc:bug.rc add test_daon}; qx{../src/task rc:bug.rc test_daon done}; qx{faketime -f '+1s' ../src/task rc:bug.rc test_daon start}; qx{faketime -f '+2s' ../src/task rc:bug.rc test_daon stop}; check_constant_close_zero("test_daon"); # Test all cases for which the active duration must not be shown: # - done qx{../src/task rc:bug.rc add test_dn}; qx{../src/task rc:bug.rc test_dn done}; check_no_summary("test_dn"); # Test all case for which the active duration must be close to zero and # increasing: # - start qx{../src/task rc:bug.rc add test_sn}; qx{../src/task rc:bug.rc test_sn start}; check_running_close_zero("test_sn"); # - done and start (XXX whether this should be allowed is questionable) qx{../src/task rc:bug.rc add test_dsn}; qx{../src/task rc:bug.rc test_dsn start}; check_running_close_zero("test_dsn"); ### Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; ################################################################################ # Check that the active time is not above one minute after waiting for one minute sub check_constant_close_zero { my ($task) = @_; my $output = qx{faketime -f '+60s' ../src/task rc:bug.rc $task info}; like ($output, qr/Total active time 0:00:/ms, 'Total active duration is not increasing and is close to zeo'); } # Check that there is no active time summary sub check_no_summary { my ($task) = @_; my $output = qx{faketime -f '+10s' ../src/task rc:bug.rc $task info}; unlike ($output, qr/Total active time/ms, 'No total active duration summary'); } # Check that the active time is above one minute after waiting for one minute sub check_running_close_zero { my ($task) = @_; my $output = qx{faketime -f '+60s' ../src/task rc:bug.rc $task info}; like ($output, qr/Total active time 0:01:/ms, 'Total active duration is increasing and is close to zero'); } task-2.2.0-test/bug.990.t000075500000000000000000000045601213035135600147210ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "color.pri.L=green\n", "color.tagged=red\n", "_forcecolor=1\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } # Bug that colored any task with both priority:L and a tag as though # rc.color.tagged had a higher precedence than rc.color.pri.L, which it is not. qx{../src/task rc:color.rc add test +test pri:L 2>&1}; my $output = qx{../src/task rc:color.rc list 2>&1}; like ($output, qr/ \033\[32m .* test .* \033\[0m /x, 'Colored with the priority color, which has precedence over the tagged color'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key color.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'color.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.991.t000075500000000000000000000047111213035135600147200ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Bug 991 - A deprecated configuration variable is checked # - showing the list of default configuration variables # - checking that there is no error, no deprecated variable and no unrecognized variables qx{../src/task rc:bug.rc add foo 2>&1}; my $output = qx{../src/task rc:bug.rc show 2>&1}; like ($output, qr/^Config Variable\s+Value$/m, 'Variables shown'); unlike ($output, qr/Configuration error/ms, 'No configuration error'); unlike ($output, qr/deprecated/ms, 'No deprecated variable'); unlike ($output, qr/unrecognized/ms, 'No unrecognized variable'); ## Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.annotate.t000075500000000000000000000047111213035135600162070ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Attempt a blank annotation. qx{../src/task rc:bug.rc add foo 2>&1}; my $output = qx{../src/task rc:bug.rc 1 annotate 2>&1 >/dev/null}; like ($output, qr/Additional text must be provided/, 'failed on blank annotation'); # Attempt an annotation without ID $output = qx{echo "n" | ../src/task rc:bug.rc annotate bar 2>&1 >/dev/null}; like ($output, qr/Command prevented from running/, 'Filter-less write command inhibited'); $output = qx{echo "y" | ../src/task rc:bug.rc annotate bar 2>&1 >/dev/null}; unlike ($output, qr/Command prevented from running/, 'Filter-less write command permitted'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.annual.t000075500000000000000000000072121213035135600156530ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 13; # Create the rc file. if (open my $fh, '>', 'annual.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'annual.rc', 'Created annual.rc'); } # If a task is added with a due date ten years ago, with an annual recurrence, # then the synthetic tasks in between then and now have a due date that creeps. # # ID Project Pri Due Active Description # -- ------- --- ---------- ------ ----------- # 2 1/1/2000 foo # 3 12/31/2000 foo # 4 12/31/2001 foo # 5 12/31/2002 foo # 6 12/31/2003 foo # 7 12/30/2004 foo # 8 12/30/2005 foo # 9 12/30/2006 foo # 10 12/30/2007 foo # 11 13/29/2008 foo # 12 12/29/2009 foo qx{../src/task rc:annual.rc add foo due:1/1/2000 recur:annual until:1/1/2009 2>&1}; my $output = qx{../src/task rc:annual.rc list 2>&1}; like ($output, qr/2\s+1\/1\/2000\s+(?:\d+\ssecs?\s+)?foo/, 'synthetic 2 no creep'); like ($output, qr/3\s+1\/1\/2001\s+(?:\d+\ssecs?\s+)?foo/, 'synthetic 3 no creep'); like ($output, qr/4\s+1\/1\/2002\s+(?:\d+\ssecs?\s+)?foo/, 'synthetic 4 no creep'); like ($output, qr/5\s+1\/1\/2003\s+(?:\d+\ssecs?\s+)?foo/, 'synthetic 5 no creep'); like ($output, qr/6\s+1\/1\/2004\s+(?:\d+\ssecs?\s+)?foo/, 'synthetic 6 no creep'); like ($output, qr/7\s+1\/1\/2005\s+(?:\d+\ssecs?\s+)?foo/, 'synthetic 7 no creep'); like ($output, qr/8\s+1\/1\/2006\s+(?:\d+\ssecs?\s+)?foo/, 'synthetic 8 no creep'); like ($output, qr/9\s+1\/1\/2007\s+(?:\d+\ssecs?\s+)?foo/, 'synthetic 9 no creep'); like ($output, qr/10\s+1\/1\/2008\s+(?:\d+\ssecs?\s+)?foo/, 'synthetic 10 no creep'); like ($output, qr/11\s+1\/1\/2009\s+(?:\d+\ssecs?\s+)?foo/, 'synthetic 11 no creep'); $output = qx{../src/task rc:annual.rc diag 2>&1}; like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key annual.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'annual.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.before.t000075500000000000000000000073471213035135600156500ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Time::Local; use Test::More tests => 17; # Create the rc file. if (open my $fh, '>', 'before.rc') { print $fh "data.location=.\n", "confirmation=no\n", "dateformat=m/d/Y\n"; close $fh; ok (-r 'before.rc', 'Created before.rc'); } # Create some example data directly. if (open my $fh, '>', 'pending.data') { my $timeA = timegm (00,00,12,22,11,2008); my $timeB = timegm (00,00,12,17,03,2009); print $fh <&1}; like ($output, qr/Start\s+12\/22\/2008/, 'task 1 start date as expected'); $output = qx{../src/task rc:before.rc 2 info 2>&1}; like ($output, qr/Start\s+4\/17\/2009/, 'task 2 start date as expected'); $output = qx{../src/task rc:before.rc ls start.before:12/1/2008 2>&1}; unlike ($output, qr/foo/, 'no foo before 12/1/2008'); unlike ($output, qr/bar/, 'no bar before 12/1/2008'); $output = qx{../src/task rc:before.rc ls start.before:1/1/2009 2>&1}; like ($output, qr/foo/, 'foo before 1/1/2009'); unlike ($output, qr/bar/, 'no bar before 1/1/2009'); $output = qx{../src/task rc:before.rc ls start.before:5/1/2009 2>&1}; like ($output, qr/foo/, 'foo before 5/1/2009'); like ($output, qr/bar/, 'bar before 5/1/2009'); $output = qx{../src/task rc:before.rc ls start.after:12/1/2008 2>&1}; like ($output, qr/foo/, 'foo after 12/1/2008'); like ($output, qr/bar/, 'bar after 12/1/2008'); $output = qx{../src/task rc:before.rc ls start.after:1/1/2009 2>&1}; unlike ($output, qr/foo/, 'no foo after 1/1/2009'); like ($output, qr/bar/, 'bar after 1/1/2009'); $output = qx{../src/task rc:before.rc ls start.after:5/1/2009 2>&1}; unlike ($output, qr/foo/, 'no foo after 5/1/2009'); unlike ($output, qr/bar/, 'no bar after 5/1/2009'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key before.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'before.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.bulk.t000075500000000000000000000066551213035135600153440ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 12; # Create the rc file. if (open my $fh, '>', 'bulk.rc') { print $fh "data.location=.\n", "confirmation=yes\n", "bulk=3\n"; close $fh; ok (-r 'bulk.rc', 'Created bulk.rc'); } # Add some tasks with project, prioriy and due date, some with only due date. # Bulk add a project and priority to the tasks that were without. qx{../src/task rc:bulk.rc add t1 pro:p1 pri:H due:monday 2>&1}; qx{../src/task rc:bulk.rc add t2 pro:p1 pri:M due:tuesday 2>&1}; qx{../src/task rc:bulk.rc add t3 pro:p1 pri:L due:wednesday 2>&1}; qx{../src/task rc:bulk.rc add t4 due:thursday 2>&1}; qx{../src/task rc:bulk.rc add t5 due:friday 2>&1}; qx{../src/task rc:bulk.rc add t6 due:saturday 2>&1}; my $output = qx{echo "quit"|../src/task rc:bulk.rc 4 5 6 modify pro:p1 pri:M 2>&1}; like ($output, qr/Modified 0 tasks/, '"quit" prevents any further modifications'); $output = qx{echo "All"|../src/task rc:bulk.rc 4 5 6 mod pro:p1 pri:M 2>&1}; unlike ($output, qr/Task 4 "t4"\n - No changes were made/, 'Task 4 modified'); unlike ($output, qr/Task 5 "t5"\n - No changes were made/, 'Task 5 modified'); unlike ($output, qr/Task 6 "t6"\n - No changes were made/, 'Task 6 modified'); $output = qx{../src/task rc:bulk.rc info 4 2>&1}; like ($output, qr/Project\s+p1/, 'project applied to 4'); like ($output, qr/Priority\s+M/, 'priority applied to 4'); $output = qx{../src/task rc:bulk.rc info 5 2>&1}; like ($output, qr/Project\s+p1/, 'project applied to 5'); like ($output, qr/Priority\s+M/, 'priority applied to 5'); $output = qx{../src/task rc:bulk.rc info 6 2>&1}; like ($output, qr/Project\s+p1/, 'project applied to 6'); like ($output, qr/Priority\s+M/, 'priority applied to 6'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bulk.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bulk.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.c001.t000075500000000000000000000046121213035135600150410ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Unreported Bug c01: Entering two recurring tasks back to back fails to increment # the ID returned to the user # # First noticed in 1.9.4 commit 2d50d1c # Setup: Add a recurring task qx{../src/task rc:bug.rc add First recurring task due:tomorrow rec:daily 2>&1}; # Result: Ensure the second recurring task has an ID of 2 my $output = qx{../src/task rc:bug.rc add Second recurring task due:tomorrow rec:daily 2>&1}; like ($output, qr/Created task 2\./ms, 'Recurring task assigned correct ID.'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.cal.t000075500000000000000000000136731213035135600151440ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 29; # Create the rc file. if (open my $fh, '>', 'cal.rc') { print $fh "data.location=."; close $fh; ok (-r 'cal.rc', 'Created cal.rc'); } # Bug: The 'cal' command can fail when provided with challenging arguments. # Should not fail (because they are correct): my $output = qx{../src/task rc:cal.rc cal 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal'); # y due 2010 donkey 8 $output = qx{../src/task rc:cal.rc cal y 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y'); $output = qx{../src/task rc:cal.rc cal 8 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal 8'); $output = qx{../src/task rc:cal.rc cal due 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal due'); $output = qx{../src/task rc:cal.rc cal 2010 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal 2010'); $output = qx{../src/task rc:cal.rc cal donkey 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal donkey'); # y due 2010 donkey 8 $output = qx{../src/task rc:cal.rc cal y due 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y due'); $output = qx{../src/task rc:cal.rc cal y 8 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y 8'); $output = qx{../src/task rc:cal.rc cal y 2010 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y 2010'); $output = qx{../src/task rc:cal.rc cal y donkey 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y donkey'); $output = qx{../src/task rc:cal.rc cal 8 due 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal 8 due'); $output = qx{../src/task rc:cal.rc cal 8 2010 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal 8 2010'); $output = qx{../src/task rc:cal.rc cal 8 donkey 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal 8 donkey'); $output = qx{../src/task rc:cal.rc cal due 2010 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal due 2010'); $output = qx{../src/task rc:cal.rc cal due donkey 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal due donkey'); $output = qx{../src/task rc:cal.rc cal 2010 donkey 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal 2010 donkey'); # y 8 due 2010 donkey $output = qx{../src/task rc:cal.rc cal y 8 due 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y 8 due'); $output = qx{../src/task rc:cal.rc cal y 8 2010 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y 8 2010'); $output = qx{../src/task rc:cal.rc cal y 8 donkey 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y 8 donkey'); $output = qx{../src/task rc:cal.rc cal y due 2010 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y due 2010'); $output = qx{../src/task rc:cal.rc cal y due donkey 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y due donkey'); $output = qx{../src/task rc:cal.rc cal y 2010 donkey 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal y 2010 donkey'); $output = qx{../src/task rc:cal.rc cal 8 due 2010 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal 8 due 2010'); $output = qx{../src/task rc:cal.rc cal 8 due donkey 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal 8 due donkey'); $output = qx{../src/task rc:cal.rc cal 8 2010 donkey 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal 8 2010 donkey'); $output = qx{../src/task rc:cal.rc cal due 2010 8 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal due 2010 8'); $output = qx{../src/task rc:cal.rc cal due 2010 donkey 2>&1}; unlike ($output, qr/(?:Assertion failed|Could note recognize|not a valid)/, 'cal due 2010 donkey'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key cal.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'cal.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.concat.t000075500000000000000000000053631213035135600156510ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # When a task is modified like this: # # % task 1 modify This is a new description # # The arguments are concatenated thus: # # Thisisanewdescription qx{../src/task rc:bug.rc add This is the original text 2>&1}; my $output = qx{../src/task rc:bug.rc info 1 2>&1}; like ($output, qr/Description\s+This is the original text/, 'original correct'); qx{../src/task rc:bug.rc 1 modify This is the modified text 2>&1}; $output = qx{../src/task rc:bug.rc info 1 2>&1}; like ($output, qr/Description\s+This is the modified text\n/, 'modified correct'); # When a task is added like this: # # % task add aaa bbb:ccc ddd # # The description is concatenated thus: # # aaabbb:ccc ddd qx{../src/task rc:bug.rc add aaa bbb:ccc ddd 2>&1}; $output = qx{../src/task rc:bug.rc info 2 2>&1}; like ($output, qr/Description\s+aaa bbb:ccc ddd\n/, 'properly concatenated'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.hang.t000075500000000000000000000061051213035135600153120ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'hang.rc') { print $fh "data.location=.\n", "shadow.file=shadow.txt\n", "shadow.command=list\n"; close $fh; ok (-r 'hang.rc', 'Created hang.rc'); } =pod I found a bug in the current version of task. Using recur and a shadow file will lead to an infinite loop. To reproduce it, define a shadow file in the .taskrc, set a command for it that rebuilds the database, e.g. "list", and then add a task with a recurrence set, e.g. "task add due:today recur:1d infinite loop". Task will then loop forever and add the same recurring task until it runs out of memory. So I checked the source and I believe I found the cause. handleRecurrence() in task.cpp will modify the mask, but writes it only after it has added all new tasks. Adding the task will, however, invoke onChangeCallback, which starts the same process all over again. =cut eval { $SIG{'ALRM'} = sub {die "alarm\n"}; alarm 10; my $output = qx{../src/task rc:hang.rc list 2>&1; ../src/task rc:hang.rc add due:today recur:1d infinite loop 2>&1; ../src/task rc:hang.rc info 1 2>&1}; alarm 0; like ($output, qr/^Description\s+infinite loop\n/m, 'no hang'); }; if ($@ eq "alarm\n") { fail ('task hang on add or recurring task, with shadow file, for 10s'); } # Cleanup. unlink qw(shadow.txt pending.data completed.data undo.data backlog.data synch.key hang.rc); ok (! -r 'shadow.txt' && ! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'hang.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.hasnt.t000075500000000000000000000066671213035135600155270ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 16; # Create the rc file. if (open my $fh, '>', 'hasnt.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'hasnt.rc', 'Created hasnt.rc'); } # 1 qx{../src/task rc:hasnt.rc add foo 2>&1}; # 2 qx{../src/task rc:hasnt.rc add foo 2>&1}; qx{../src/task rc:hasnt.rc 2 annotate bar 2>&1}; # 3 qx{../src/task rc:hasnt.rc add foo 2>&1}; qx{../src/task rc:hasnt.rc 3 annotate bar 2>&1}; qx{../src/task rc:hasnt.rc 3 annotate baz 2>&1}; # 4 qx{../src/task rc:hasnt.rc add bar 2>&1}; # 5 qx{../src/task rc:hasnt.rc add bar 2>&1}; qx{../src/task rc:hasnt.rc 5 annotate foo 2>&1}; # 6 qx{../src/task rc:hasnt.rc add bar 2>&1}; qx{../src/task rc:hasnt.rc 6 annotate foo 2>&1}; qx{../src/task rc:hasnt.rc 6 annotate baz 2>&1}; #7 qx{../src/task rc:hasnt.rc add one 2>&1}; qx{../src/task rc:hasnt.rc 7 annotate two 2>&1}; qx{../src/task rc:hasnt.rc 7 annotate three 2>&1}; my $output = qx{../src/task rc:hasnt.rc ls description.has:foo 2>&1}; like ($output, qr/\n 1/, '1 has foo -> yes'); like ($output, qr/\n 2/, '2 has foo -> yes'); like ($output, qr/\n 3/, '3 has foo -> yes'); unlike ($output, qr/\n 4/, '4 has foo -> no'); # 5 like ($output, qr/\n 5/, '5 has foo -> yes'); like ($output, qr/\n 6/, '6 has foo -> yes'); unlike ($output, qr/\n 7/, '7 has foo -> no'); $output = qx{../src/task rc:hasnt.rc ls description.hasnt:foo 2>&1}; unlike ($output, qr/\n 1/, '1 hasnt foo -> no'); unlike ($output, qr/\n 2/, '2 hasnt foo -> no'); # 10 unlike ($output, qr/\n 3/, '3 hasnt foo -> no'); like ($output, qr/\n 4/, '4 hasnt foo -> yes'); unlike ($output, qr/\n 5/, '5 hasnt foo -> no'); unlike ($output, qr/\n 6/, '6 hasnt foo -> no'); like ($output, qr/\n 7/, '7 hasnt foo -> yes'); # 15 # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key hasnt.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'hasnt.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.mergedeps.t.postponed000075500000000000000000000107211213035135600203610ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 19; use File::Copy; use constant false => 0; use constant true => 1; # Create data locations mkdir("local", 0755); ok(-e 'local', "Created directory local"); mkdir("remote", 0755); ok(-e 'remote', "Created directory remote"); # Create the rc files. if (open my $fh, '>', 'local.rc') { print $fh "data.location=./local\n", "confirmation=no\n", "merge.autopush=no\n", "report.list.description=DESC\n", "report.list.columns=id,project,active,priority,description,tags\n", "report.list.labels=id,pro,a,pri,d,t\n", "report.list.sort=id+\n", "report.list.filter=status:pending depends.none:\n"; close $fh; ok (-r 'local.rc', 'Created local.rc'); } if (open my $fh, '>', 'remote.rc') { print $fh "data.location=./remote\n", "confirmation=no\n", "merge.autopush=no\n", "report.list.description=DESC\n", "report.list.columns=id,project,active,priority,description,tags\n", "report.list.labels=id,pro,a,pri,d,t\n", "report.list.sort=id+\n", "report.list.filter=status:pending depends.none:\n"; close $fh; ok (-r 'remote.rc', 'Created remote.rc'); } # Create some basic tasks on both sides qx{../src/task rc:local.rc add both}; qx{faketime -f '+1s' ../src/task rc:local.rc add blocked}; qx{faketime -f '+2s' ../src/task rc:local.rc add blocking}; qx{faketime -f '+3s' ../src/task rc:local.rc 2 dep:3}; # run gc qx{../src/task rc:remote.rc}; # push to remote qx{../src/task rc:local.rc push ./remote/}; # make remote modifications #qx{faketime -f '+10s' ../src/task rc:remote.rc add right}; qx{faketime -f '+11s' ../src/task rc:remote.rc done 3}; #blocking # run gc qx{../src/task rc:remote.rc}; my $output_l = qx{../src/task rc:local.rc merge remote/}; #check output unlike ($output_l, qr/Missing/, "merge: no missing entry"); unlike ($output_l, qr/Not adding duplicate/, "merge: no duplicates"); # check reports my $report_l = qx{../src/task rc:local.rc}; like ($report_l, qr/blocked/, 'merge: "blocked" pending'); unlike ($report_l, qr/blocking/, 'merge: "blocking" not pending'); $report_l = qx{../src/task rc:local.rc blocked}; unlike ($report_l, qr/blocked/, 'merge: "blocked" unblocked'); #exit # Cleanup. unlink 'local/pending.data'; ok (!-r 'local/pending.data', 'Removed local/pending.data'); unlink 'local/completed.data'; ok (!-r 'local/completed.data', 'Removed local/completed.data'); unlink 'local/undo.data'; ok (!-r 'local/undo.data', 'Removed local/undo.data'); unlink 'local.rc'; ok (!-r 'local.rc', 'Removed local.rc'); unlink 'remote/pending.data'; ok (!-r 'remote/pending.data', 'Removed remote/pending.data'); unlink 'remote/completed.data'; ok (!-r 'remote/completed.data', 'Removed remote/completed.data'); unlink 'remote/undo.data'; ok (!-r 'remote/undo.data', 'Removed remote/undo.data'); unlink 'remote.rc'; ok (!-r 'remote.rc', 'Removed remote.rc'); rmdir("remote"); ok (!-e "remote", "Removed dir remote"); rmdir("local"); ok (!-e "local", "Removed dir local"); exit 0; task-2.2.0-test/bug.period.t000075500000000000000000000156231213035135600156640ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 41; # Create the rc file. if (open my $fh, '>', 'period.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'period.rc', 'Created period.rc'); } =pod http://github.com/pbeckingham/task/blob/857f813a24f7ce15fea9f2c28aadad84cb5c8847/src/task.cpp 619 // If the period is an 'easy' one, add it to current, and we're done. 620 int days = convertDuration (period); Date getNextRecurrence (Date& current, std::string& period) starting at line 509 special cases several possibilities for period, '\d\s?m' 'monthly', 'quarterly', 'semiannual', 'bimonthly', 'biannual', 'biyearly'. Everything else falls through with period being passed to convertDuration. convertDuration doesn't know about 'daily' though so it seems to be returning 0. Confirmed: getNextRecurrence convertDuration ----------------- --------------- daily day weekly sennight biweekly fortnight monthly monthly quarterly quarterly semiannual semiannual bimonthly bimonthly biannual biannual biyearly biyearly annual yearly *m *m *q *q *d *w *y =cut my $output = qx{../src/task rc:period.rc add daily due:tomorrow recur:daily 2>&1}; unlike ($output, qr/was not recognized/, 'recur:daily'); $output = qx{../src/task rc:period.rc add day due:tomorrow recur:day 2>&1}; unlike ($output, qr/was not recognized/, 'recur:day'); $output = qx{../src/task rc:period.rc add weekly due:tomorrow recur:weekly 2>&1}; unlike ($output, qr/was not recognized/, 'recur:weekly'); $output = qx{../src/task rc:period.rc add sennight due:tomorrow recur:sennight 2>&1}; unlike ($output, qr/was not recognized/, 'recur:sennight'); $output = qx{../src/task rc:period.rc add biweekly due:tomorrow recur:biweekly 2>&1}; unlike ($output, qr/was not recognized/, 'recur:biweekly'); $output = qx{../src/task rc:period.rc add fortnight due:tomorrow recur:fortnight 2>&1}; unlike ($output, qr/was not recognized/, 'recur:fortnight'); $output = qx{../src/task rc:period.rc add monthly due:tomorrow recur:monthly 2>&1}; unlike ($output, qr/was not recognized/, 'recur:monthly'); $output = qx{../src/task rc:period.rc add quarterly due:tomorrow recur:quarterly 2>&1}; unlike ($output, qr/was not recognized/, 'recur:quarterly'); $output = qx{../src/task rc:period.rc add semiannual due:tomorrow recur:semiannual 2>&1}; unlike ($output, qr/was not recognized/, 'recur:semiannual'); $output = qx{../src/task rc:period.rc add bimonthly due:tomorrow recur:bimonthly 2>&1}; unlike ($output, qr/was not recognized/, 'recur:bimonthly'); $output = qx{../src/task rc:period.rc add biannual due:tomorrow recur:biannual 2>&1}; unlike ($output, qr/was not recognized/, 'recur:biannual'); $output = qx{../src/task rc:period.rc add biyearly due:tomorrow recur:biyearly 2>&1}; unlike ($output, qr/was not recognized/, 'recur:biyearly'); $output = qx{../src/task rc:period.rc add annual due:tomorrow recur:annual 2>&1}; unlike ($output, qr/was not recognized/, 'recur:annual'); $output = qx{../src/task rc:period.rc add yearly due:tomorrow recur:yearly 2>&1}; unlike ($output, qr/was not recognized/, 'recur:yearly'); $output = qx{../src/task rc:period.rc add 2d due:tomorrow recur:2d 2>&1}; unlike ($output, qr/was not recognized/, 'recur:2d'); $output = qx{../src/task rc:period.rc add 2w due:tomorrow recur:2w 2>&1}; unlike ($output, qr/was not recognized/, 'recur:2w'); $output = qx{../src/task rc:period.rc add 2m due:tomorrow recur:2mo 2>&1}; unlike ($output, qr/was not recognized/, 'recur:2m'); $output = qx{../src/task rc:period.rc add 2q due:tomorrow recur:2q 2>&1}; unlike ($output, qr/was not recognized/, 'recur:2q'); $output = qx{../src/task rc:period.rc add 2y due:tomorrow recur:2y 2>&1}; unlike ($output, qr/was not recognized/, 'recur:2y'); # Verify that the recurring task instances get created. One of each. $output = qx{../src/task rc:period.rc list 2>&1}; like ($output, qr/\bdaily\b/, 'verify daily'); like ($output, qr/\bday\b/, 'verify day'); like ($output, qr/\bweekly\b/, 'verify weekly'); like ($output, qr/\bsennight\b/, 'verify sennight'); like ($output, qr/\bbiweekly\b/, 'verify biweekly'); like ($output, qr/\bfortnight\b/, 'verify fortnight'); like ($output, qr/\bmonthly\b/, 'verify monthly'); like ($output, qr/\bquarterly\b/, 'verify quarterly'); like ($output, qr/\bsemiannual\b/, 'verify semiannual'); like ($output, qr/\bbimonthly\b/, 'verify bimonthly'); like ($output, qr/\bbiannual\b/, 'verify biannual'); like ($output, qr/\bbiyearly\b/, 'verify biyearly'); like ($output, qr/\bannual\b/, 'verify annual'); like ($output, qr/\byearly\b/, 'verify yearly'); like ($output, qr/\b2d\b/, 'verify 2d'); like ($output, qr/\b2w\b/, 'verify 2w'); like ($output, qr/\b2m\b/, 'verify 2m'); like ($output, qr/\b2q\b/, 'verify 2q'); like ($output, qr/\b2y\b/, 'verify 2y'); $output = qx{../src/task rc:period.rc diag 2>&1}; like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key period.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'period.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.range.t000075500000000000000000000046041213035135600154730ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'range.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'range.rc', 'Created range.rc'); } # Add three tasks, and attempt to list the middle one within a range. qx{../src/task rc:range.rc add one due:8/1/2009 2>&1}; qx{../src/task rc:range.rc add two due:8/3/2009 2>&1}; qx{../src/task rc:range.rc add three due:8/5/2009 2>&1}; my $output = qx{../src/task rc:range.rc ls due.after:8/2/2009 due.before:8/4/2009 2>&1}; unlike ($output, qr/one/, 'Missing prior to range'); like ($output, qr/two/, 'Found within range'); unlike ($output, qr/three/, 'Missing after range'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key range.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'range.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.recur.t000075500000000000000000000042361213035135600155200ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'recur.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'recur.rc', 'Created recur.rc'); } # Add a recurring task with no due date, look for expected error. qx{../src/task rc:recur.rc add foo recur:daily 2>&1}; my $output = qx{../src/task rc:recur.rc info 1 2>&1}; unlike ($output, qr/Description\s+foo/, 'task not created - missing due date'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key recur.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'recur.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.sort.t000075500000000000000000000046241213035135600153700ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug_sort.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug_sort.rc', 'Created bug_sort.rc'); } my $setup = "../src/task rc:bug_sort.rc add one 2>&1;" . "../src/task rc:bug_sort.rc add two 2>&1;" . "../src/task rc:bug_sort.rc add three recur:daily due:eom 2>&1;"; qx{$setup}; my $output = qx{../src/task rc:bug_sort.rc list 2>&1}; like ($output, qr/three.*(?:one.*two|two.*one)/msi, 'list did not hang'); qx{../src/task rc:bug_sort.rc 1 modify priority:H 2>&1}; $output = qx{../src/task rc:bug_sort.rc list 2>&1}; like ($output, qr/three.*one.*two/msi, 'list did not hang after pri:H on 1'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug_sort.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug_sort.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.start.extra.t000075500000000000000000000044301213035135600166530ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'extra.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'extra.rc', 'Created extra.rc'); } qx{../src/task rc:extra.rc add foo 2>&1}; qx{../src/task rc:extra.rc 1 start pri:L 2>&1}; qx{../src/task rc:extra.rc 1 stop pro:bar 2>&1}; my $output = qx{../src/task rc:extra.rc list 2>&1}; like ($output, qr/foo/, 'Task shown'); like ($output, qr/1 task/, 'Correct count'); like ($output, qr/L/, 'Correct priority'); like ($output, qr/bar/, 'Correct annotation'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key extra.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'extra.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.summary.t000075500000000000000000000051341213035135600160730ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'summary.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'summary.rc', 'Created summary.rc'); } # Add three tasks. Do 1, delete 1, leave 1 pending. Summary should depict a # 50% completion. qx{../src/task rc:summary.rc add project:A one 2>&1}; qx{../src/task rc:summary.rc add project:A two 2>&1}; qx{../src/task rc:summary.rc add project:A three 2>&1}; qx{../src/task rc:summary.rc 1 do 2>&1}; qx{../src/task rc:summary.rc 2 delete 2>&1}; my $output = qx{../src/task rc:summary.rc summary 2>&1}; like ($output, qr/A\s+1\s+(?:-|\d\ssecs?)\s+50%/, 'summary correctly shows 50% before report'); qx{../src/task rc:summary.rc list 2>&1}; $output = qx{../src/task rc:summary.rc summary 2>&1}; like ($output, qr/A\s+1\s+(?:-|\d\ssecs?)\s+50%/, 'summary correctly shows 50% after report'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key summary.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'summary.rc', 'Cleanup'); exit 0; task-2.2.0-test/bug.uuid.t000075500000000000000000000064421213035135600153470ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'uuid.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'uuid.rc', 'Created uuid.rc'); } # Add a task, dup it, add a recurring task, list. Then make sure they all have # unique UUID values. qx{../src/task rc:uuid.rc add simple 2>&1}; qx{../src/task rc:uuid.rc 1 duplicate 2>&1}; qx{../src/task rc:uuid.rc add periodic recur:daily due:yesterday 2>&1}; qx{../src/task rc:uuid.rc ls 2>&1}; my @all_uuids; my %unique_uuids; my $output = qx{../src/task rc:uuid.rc 1 info 2>&1}; my ($uuid) = $output =~ /UUID\s+(\S+)/; push @all_uuids, $uuid; $unique_uuids{$uuid} = undef; $output = qx{../src/task rc:uuid.rc 2 info 2>&1}; ($uuid) = $output =~ /UUID\s+(\S+)/; push @all_uuids, $uuid; $unique_uuids{$uuid} = undef; $output = qx{../src/task rc:uuid.rc 3 info 2>&1}; ($uuid) = $output =~ /UUID\s+(\S+)/; push @all_uuids, $uuid; $unique_uuids{$uuid} = undef; $output = qx{../src/task rc:uuid.rc 4 info 2>&1}; ($uuid) = $output =~ /UUID\s+(\S+)/; push @all_uuids, $uuid; $unique_uuids{$uuid} = undef; $output = qx{../src/task rc:uuid.rc 5 info 2>&1}; ($uuid) = $output =~ /UUID\s+(\S+)/; push @all_uuids, $uuid; $unique_uuids{$uuid} = undef; $output = qx{../src/task rc:uuid.rc 6 info 2>&1}; ($uuid) = $output =~ /UUID\s+(\S+)/; push @all_uuids, $uuid; $unique_uuids{$uuid} = undef; is (scalar (@all_uuids), 6, '6 tasks created'); is (scalar (keys %unique_uuids), 6, '6 unique UUIDs'); $output = qx{../src/task rc:uuid.rc diag 2>&1}; like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key uuid.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'uuid.rc', 'Cleanup'); exit 0; task-2.2.0-test/bulk.t000075500000000000000000000166011213035135600145600ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 44; # Create the rc file. if (open my $fh, '>', 'bulk.rc') { print $fh "data.location=.\n", "bulk=3\n"; close $fh; ok (-r 'bulk.rc', 'Created bulk.rc'); } # Exercise bulk and non-bulk confirmations for 'delete' and 'modify'. qx{../src/task rc:bulk.rc add one 2>&1}; qx{../src/task rc:bulk.rc add two 2>&1}; qx{../src/task rc:bulk.rc add three 2>&1}; qx{../src/task rc:bulk.rc add four 2>&1}; qx{../src/task rc:bulk.rc add five 2>&1}; qx{../src/task rc:bulk.rc add six 2>&1}; qx{../src/task rc:bulk.rc add seven 2>&1}; qx{../src/task rc:bulk.rc add eight 2>&1}; qx{../src/task rc:bulk.rc add nine 2>&1}; qx{../src/task rc:bulk.rc add ten 2>&1}; qx{../src/task rc:bulk.rc add eleven 2>&1}; qx{../src/task rc:bulk.rc add twelve 2>&1}; qx{../src/task rc:bulk.rc add thirteen 2>&1}; qx{../src/task rc:bulk.rc add fourteen 2>&1}; qx{../src/task rc:bulk.rc add fifteen 2>&1}; qx{../src/task rc:bulk.rc add sixteen 2>&1}; qx{../src/task rc:bulk.rc add seventeen 2>&1}; qx{../src/task rc:bulk.rc add eighteen 2>&1}; # The 'delete' command is used, but it could be any write command. # Note that 'y' is passed to task despite rc.confirmation=off. This allows # failing tests to complete without blocking on input. # 'yes' tests: # Test with 1 task. 1 is a special case. my $output = qx{echo 'y' | ../src/task rc:bulk.rc rc.confirmation=off 1 delete 2>&1}; unlike ($output, qr/\(yes\/no\)/, 'Single delete with no confirmation'); unlike ($output, qr/\(yes\/no\/all\/quit\)/, 'Single delete with no bulk confirmation'); like ($output, qr/Deleting task 1/, 'Verified delete 1'); $output = qx{echo 'y' | ../src/task rc:bulk.rc rc.confirmation=on 2 delete 2>&1}; like ($output, qr/\(yes\/no\)/, 'Single delete with confirmation'); unlike ($output, qr/\(yes\/no\/all\/quit\)/, 'Single delete with no bulk confirmation'); like ($output, qr/Deleting task 2/, 'Verified delete 2'); # Test with 2 tasks. 2 is greater than 1 and less than bulk. $output = qx{echo 'y' | ../src/task rc:bulk.rc rc.confirmation=off 3-4 delete 2>&1}; unlike ($output, qr/\(yes\/no\)/, 'Multiple delete with no confirmation'); unlike ($output, qr/\(yes\/no\/all\/quit\)/, 'Multiple delete with no bulk confirmation'); like ($output, qr/Deleting task 3/, 'Verified delete 3'); like ($output, qr/Deleting task 4/, 'Verified delete 4'); $output = qx{printf 'y\ny\n' | ../src/task rc:bulk.rc rc.confirmation=on 5-6 delete 2>&1}; unlike ($output, qr/\(yes\/no\)/, 'Multiple delete with confirmation'); like ($output, qr/\(yes\/no\/all\/quit\)/, 'Multiple delete with bulk confirmation'); like ($output, qr/Deleting task 5/, 'Verified delete 5'); like ($output, qr/Deleting task 6/, 'Verified delete 6'); # Test with 3 tasks. 3 is considered bulk. $output = qx{printf 'y\ny\ny\n' | ../src/task rc:bulk.rc rc.confirmation=off 7-9 delete 2>&1}; unlike ($output, qr/\(yes\/no\)/, 'Bulk delete with no confirmation'); like ($output, qr/\(yes\/no\/all\/quit\)/, 'Bulk delete with no bulk confirmation'); like ($output, qr/Deleting task 7/, 'Verified delete 7'); like ($output, qr/Deleting task 8/, 'Verified delete 8'); like ($output, qr/Deleting task 9/, 'Verified delete 9'); $output = qx{printf 'y\ny\ny\n' | ../src/task rc:bulk.rc rc.confirmation=on 10-12 delete 2>&1}; unlike ($output, qr/\(yes\/no\)/, 'Bulk delete with confirmation'); like ($output, qr/\(yes\/no\/all\/quit\)/, 'Bulk delete with bulk confirmation'); like ($output, qr/Deleting task 10/, 'Verified delete 10'); like ($output, qr/Deleting task 11/, 'Verified delete 11'); like ($output, qr/Deleting task 12/, 'Verified delete 12'); # 'no' tests: # Test with 1 task, denying delete. $output = qx{echo 'n' | ../src/task rc:bulk.rc rc.confirmation=on 13 delete 2>&1}; like ($output, qr/\(yes\/no\)/, 'Single delete with confirmation'); unlike ($output, qr/\(yes\/no\/all\/quit\)/, 'Single delete with no bulk confirmation'); unlike ($output, qr/Deleting task/, 'Verified no delete 13'); # Test with 2 tasks, denying delete. $output = qx{printf 'n\nn\n' | ../src/task rc:bulk.rc rc.confirmation=on 13-14 delete 2>&1}; unlike ($output, qr/\(yes\/no\)/, 'Multiple delete with confirmation'); like ($output, qr/\(yes\/no\/all\/quit\)/, 'Multiple delete with no bulk confirmation'); unlike ($output, qr/Deleting task/, 'Verified no delete 13-14'); # Test with 3 tasks, denying delete. $output = qx{printf 'n\nn\nn\n' | ../src/task rc:bulk.rc rc.confirmation=on 13-15 delete 2>&1}; unlike ($output, qr/\(yes\/no\)/, 'Bulk delete with confirmation'); like ($output, qr/\(yes\/no\/all\/quit\)/, 'Bulk delete with no bulk confirmation'); unlike ($output, qr/Deleting task/, 'Verified no delete 13-15'); # 'all' tests: $output = qx{echo 'all' | ../src/task rc:bulk.rc rc.confirmation=on 13-15 delete 2>&1}; unlike ($output, qr/\(yes\/no\)/, 'Bulk delete with confirmation'); like ($output, qr/\(yes\/no\/all\/quit\)/, 'Bulk delete with bulk confirmation'); like ($output, qr/Deleting task 13/, 'Verified delete 13'); like ($output, qr/Deleting task 14/, 'Verified delete 14'); like ($output, qr/Deleting task 15/, 'Verified delete 15'); # 'quit' tests: $output = qx{echo 'quit' | ../src/task rc:bulk.rc rc.confirmation=on 16-18 delete 2>&1}; unlike ($output, qr/\(yes\/no\)/, 'Bulk delete with no confirmation'); like ($output, qr/\(yes\/no\/all\/quit\)/, 'Bulk delete with no bulk confirmation'); like ($output, qr/Deleted 0 tasks./, 'No task deleted'); unlike ($output, qr/delete task 17/, 'No question asked for subsequent tasks'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bulk.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bulk.rc', 'Cleanup'); exit 0; task-2.2.0-test/cal.t000075500000000000000000000305151213035135600143620ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ ## ################################################################################ use strict; use warnings; use Test::More tests => 84; # Create the rc file. if (open my $fh, '>', 'cal.rc') { print $fh "data.location=.\n", "dateformat=YMD\n", "color=on\n", "color.calendar.today=black on cyan\n", "color.calendar.due=black on green\n", "color.calendar.weeknumber=black on white\n", "color.calendar.overdue=black on red\n", "color.calendar.weekend=white on bright black\n", "confirmation=off\n", "bulk=10\n"; close $fh; ok (-r 'cal.rc', 'Created cal.rc'); } my @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); my ($nday, $nmon, $nyear, $wday) = (localtime)[3,4,5,6]; my $day = $nday; my $prevmonth = $months[($nmon-1) % 12]; my $month = $months[($nmon) % 12]; my $nextmonth = $months[($nmon+1) % 12]; my $prevyear = $nyear + 1899; my $year = $nyear + 1900; my $nextyear = $nyear + 1901; if ($day <= 9) { $day = " ".$day; } # task cal and task cal y my $output = qx{../src/task rc:cal.rc rc._forcecolor:on cal 2>&1}; if ($wday == 6 || $wday == 0) { like ($output, qr/\[30;106m$day/, 'Current day is highlighted'); } else { like ($output, qr/\[30;46m$day/, 'Current day is highlighted'); } like ($output, qr/$month\S*?\s+?$year/, 'Current month and year are displayed'); $output = qx{../src/task rc:cal.rc add zero 2>&1}; unlike ($output, qr/\[41m\d+/, 'No overdue tasks are present'); unlike ($output, qr/\[43m\d+/, 'No due tasks are present'); $output = qx{../src/task rc:cal.rc rc.weekstart:Sunday cal 2>&1}; like ($output, qr/Su Mo Tu/, 'Week starts on Sunday'); $output = qx{../src/task rc:cal.rc rc.weekstart:Monday cal 2>&1}; like ($output, qr/Fr Sa Su/, 'Week starts on Monday'); $output = qx{../src/task rc:cal.rc cal y 2>&1}; like ($output, qr/$month\S*?\s+?$year/, 'Current month and year are displayed'); if ($month eq "Jan") { $nextyear = $nextyear - 1; } like ($output, qr/$prevmonth\S*?\s+?$nextyear/, 'Month and year one year ahead are displayed'); if ($month eq "Jan") { $nextyear = $nextyear + 1; } unlike ($output, qr/$month\S*?\s+?$nextyear/, 'Current month and year ahead are not displayed'); # task cal due and task cal due y qx{../src/task rc:cal.rc add due:20190515 one 2>&1}; qx{../src/task rc:cal.rc add due:20200123 two 2>&1}; $output = qx{../src/task rc:cal.rc rc._forcecolor:on cal due 2>&1}; unlike ($output, qr/April 2019/, 'April 2019 is not displayed'); like ($output, qr/May 2019/, 'May 2019 is displayed'); unlike ($output, qr/January 2020/, 'January 2020 is not displayed'); like ($output, qr/30;42m15/, 'Task 1 is color-coded due'); $output = qx{../src/task rc:cal.rc rc._forcecolor:on cal due y 2>&1}; like ($output, qr/30;42m23/, 'Task 2 is color-coded due'); like ($output, qr/April 2020/, 'April 2020 is displayed'); unlike ($output, qr/May 2020/, 'May 2020 is not displayed'); qx{../src/task rc:cal.rc ls 2>&1}; qx{../src/task rc:cal.rc 1-3 del 2>&1}; qx{../src/task rc:cal.rc add due:20080408 three 2>&1}; $output = qx{../src/task rc:cal.rc rc._forcecolor:on cal due 2>&1}; like ($output, qr/April 2008/, 'April 2008 is displayed'); like ($output, qr/41m 8/, 'Task 3 is color-coded overdue'); like ($output, qr/37;100m19/, 'Saturday April 19, 2008 is color-coded'); like ($output, qr/37;100m20/, 'Sunday April 20, 2008 is color-coded'); like ($output, qr/30;47m 1/, 'Weeknumbers are color-coded'); # task cal 2016 $output = qx{../src/task rc:cal.rc rc.weekstart:Monday cal 2016 2>&1}; unlike ($output, qr/2015/, 'Year 2015 is not displayed'); unlike ($output, qr/2017/, 'Year 2017 is not displayed'); like ($output, qr/January 2016/, 'January 2016 is displayed'); like ($output, qr/December 2016/, 'December 2016 is displayed'); like ($output, qr/53 +1/, '2015 has 53 weeks (ISO)'); like ($output, qr/1 +4/, 'First week in 2016 starts with Mon Jan 4 (ISO)'); like ($output, qr/52 +26/, 'Last week in 2016 starts with Mon Dec 26 (ISO)'); like ($output, qr/9 +29/, 'Leap year - Feb 29 is Monday in week 9 (ISO)'); $output = qx{../src/task rc:cal.rc rc.weekstart:Sunday cal 2016 2>&1}; like ($output, qr/1 +1/, 'First week in 2016 starts with Fri Jan 1 (US)'); like ($output, qr/53 +25/, 'Last week in 2016 starts with Sun Dec 25 (US)'); $output = qx{../src/task rc:cal.rc rc.weekstart:Monday rc.displayweeknumber:off cal 2016 2>&1}; unlike ($output, qr/53/, 'Weeknumbers are not displayed'); # task cal 4 2010 $output = qx{../src/task rc:cal.rc rc.monthsperline:1 cal 4 2010 2>&1}; unlike ($output, qr/March 2010/, 'March 2010 is not displayed'); like ($output, qr/April 2010/, 'April 2010 is displayed'); unlike ($output, qr/May 2010/, 'May 2010 is not displayed'); # calendar offsets $output = qx{../src/task rc:cal.rc rc.calendar.offset:on rc.monthsperline:1 cal 1 2011 2>&1}; unlike ($output, qr/November 2010/, 'November 2010 is not displayed'); like ($output, qr/December 2010/, 'December 2010 is displayed'); unlike ($output, qr/January 2011/, 'January 2011 is not displayed'); $output = qx{../src/task rc:cal.rc rc.calendar.offset:on rc.calendar.offset.value:2 rc.monthsperline:1 cal 1 2011 2>&1}; unlike ($output, qr/January 2011/, 'January 2011 is not displayed'); unlike ($output, qr/February 2011/, 'February 2011 is not displayed'); like ($output, qr/March 2011/, 'March 2011 is displayed'); unlike ($output, qr/April 2011/, 'April 2011 is not displayed'); $output = qx{../src/task rc:cal.rc rc.calendar.offset:on rc.calendar.offset.value:-12 rc.monthsperline:1 cal 2>&1}; like ($output, qr/$month\S*?\s+?$prevyear/, 'Current month and year ahead are displayed'); unlike ($output, qr/$month\S*?\s+?$year/, 'Current month and year are not displayed'); $output = qx{../src/task rc:cal.rc rc.calendar.offset:on rc.calendar.offset.value:12 rc.monthsperline:1 cal 2>&1}; unlike ($output, qr/$month\S*?\s+?$year/, 'Current month and year are not displayed'); like ($output, qr/$month\S*?\s+?$nextyear/, 'Current month and year ahead are displayed'); # Cleanup. unlink 'pending.data'; ok (!-r 'pending.data', 'Removed pending.data'); unlink 'undo.data'; ok (!-r 'undo.data', 'Removed undo.data'); unlink 'cal.rc'; ok (!-r 'cal.rc', 'Removed cal.rc'); # Create the rc file. if (open my $fh, '>', 'details.rc') { print $fh "data.location=.\n", "dateformat=YMD\n", "dateformat.holiday=YMD\n", "dateformat.report=YMD\n", "calendar.details=full\n", "calendar.details.report=list\n", "calendar.holidays=full\n", "color=on\n", "color.alternate=\n", "color.calendar.weekend=\n", "color.calendar.holiday=black on bright yellow\n", "confirmation=no\n", "holiday.AAAA.name=AAAA\n", "holiday.AAAA.date=20150101\n", "holiday.BBBBBB.name=BBBBBB\n", "holiday.BBBBBB.date=20150115\n", "holiday.åäö.name=åäö\n", "holiday.åäö.date=20150125\n"; close $fh; ok (-r 'details.rc', 'Created details.rc'); } # task calendar details qx{../src/task rc:details.rc add due:20150105 one 2>&1}; qx{../src/task rc:details.rc add due:20150110 two 2>&1}; qx{../src/task rc:details.rc add due:20150210 three 2>&1}; qx{../src/task rc:details.rc add due:20150410 four 2>&1}; qx{../src/task rc:details.rc add due:20151225 five 2>&1}; qx{../src/task rc:details.rc add due:20141231 six 2>&1}; qx{../src/task rc:details.rc add due:20160101 seven 2>&1}; qx{../src/task rc:details.rc add due:20081231 eight 2>&1}; $output = qx{../src/task rc:details.rc rc.calendar.legend:no cal 2>&1}; unlike ($output, qr/Legend:/, 'Legend is not displayed'); $output = qx{../src/task rc:details.rc cal rc.monthsperline:3 1 2015 2>&1}; like ($output, qr/January 2015/, 'January 2015 is displayed'); like ($output, qr/20150105/, 'Due date 20150105 is displayed'); like ($output, qr/20150110/, 'Due date 20150110 is displayed'); like ($output, qr/20150210/, 'Due date 20150210 is displayed'); unlike ($output, qr/20141231/, 'Due date 20141231 is not displayed'); unlike ($output, qr/20150410/, 'Due date 20150410 is not displayed'); like ($output, qr/3 tasks/, '3 due tasks are displayed'); $output = qx{../src/task rc:details.rc cal due 2>&1}; like ($output, qr/December 2008/, 'December 2008 is displayed'); like ($output, qr/20081231/, 'Due date 20081231 is displayed'); like ($output, qr/1 task/, '1 due task is displayed'); $output = qx{../src/task rc:details.rc cal 2015 2>&1}; like ($output, qr/January 2015/, 'January 2015 is displayed'); like ($output, qr/December 2015/, 'December 2015 is displayed'); unlike ($output, qr/20141231/, 'Due date 20141231 is not displayed'); unlike ($output, qr/20160101/, 'Due date 20160101 is not displayed'); like ($output, qr/5 tasks/, '5 due tasks are displayed'); $day = $nday; if ( $day <= 9) { $day = "0".$day; } my $mon = $nmon + 1; if ( $mon <= 9) { $mon = "0".$mon; } my $duedate = $year.$mon.$day; qx{../src/task rc:details.rc add due:$duedate rc.monthsperline:1 nine 2>&1}; $output = qx{../src/task rc:details.rc cal 2>&1}; like ($output, qr/$month\S*?\s+?$year/, 'Current month and year are displayed'); like ($output, qr/$duedate/, 'Due date on current day is displayed'); like ($output, qr/1 task/, '1 due task is displayed'); $output = qx{../src/task rc:details.rc cal rc.monthsperline:1 1 2015 2>&1}; like ($output, qr/Date/, 'Word Date is displayed'); like ($output, qr/Holiday/, 'Word Holiday is displayed'); like ($output, qr/20150101/, 'Holiday 20150101 is displayed'); like ($output, qr/20150115/, 'Holiday 20150115 is displayed'); like ($output, qr/20150125/, 'Holiday 20150125 is displayed'); like ($output, qr/AAAA/, 'Holiday name AAAA is displayed'); like ($output, qr/BBBBBB/, 'Holiday name BBBBBB is displayed'); like ($output, qr/åäö/, 'Holiday name åäö is displayed'); $output = qx{../src/task rc:details.rc cal rc._forcecolor:on rc.monthsperline:1 rc.calendar.details:sparse rc.calendar.holidays:sparse 1 2015 2>&1}; unlike ($output, qr/Date/, 'Word Date is not displayed'); unlike ($output, qr/Holiday/, 'Word Holiday is not displayed'); like ($output, qr/30;103m 1/, 'Holiday AAAA is color-coded'); like ($output, qr/30;103m15/, 'Holiday BBBBBB is color-coded'); like ($output, qr/30;103m25/, 'Holiday åäö is color-coded'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key details.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'details.rc', 'Cleanup'); exit 0; task-2.2.0-test/caseless.t000075500000000000000000000131761213035135600154310ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 18; # Create the rc file. if (open my $fh, '>', 'caseless.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'caseless.rc', 'Created caseless.rc'); } # Attempt case-sensitive and case-insensitive substitutions and filters. qx{../src/task rc:caseless.rc add one two three 2>&1}; qx{../src/task rc:caseless.rc 1 annotate four five six 2>&1}; # Description substitution. # 2 qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes 1 modify /One/ONE/ 2>&1}; my $output = qx{../src/task rc:caseless.rc info 1 2>&1}; unlike ($output, qr/One two three/, 'one two three\nfour five six -> /One/ONE/ = fail'); # 3 qx{../src/task rc:caseless.rc rc.search.case.sensitive:no 1 modify /One/ONE/ 2>&1}; $output = qx{../src/task rc:caseless.rc info 1 2>&1}; like ($output, qr/ONE two three/, 'one two three\nfour five six -> /One/ONE/ = caseless succeed'); # 4 qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes 1 modify /one/One/ 2>&1}; $output = qx{../src/task rc:caseless.rc info 1 2>&1}; unlike ($output, qr/One two three/, 'ONE two three\nfour five six -> /one/ONE/ = fail'); # 5 qx{../src/task rc:caseless.rc rc.search.case.sensitive:no 1 modify /one/one/ 2>&1}; $output = qx{../src/task rc:caseless.rc info 1 2>&1}; like ($output, qr/one two three/, 'ONE two three\nfour five six -> /one/one/ = caseless succeed'); # Annotation substitution. # 6 qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes 1 modify /Five/FIVE/ 2>&1}; $output = qx{../src/task rc:caseless.rc info 1 2>&1}; unlike ($output, qr/four FIVE six/, 'one two three\nfour five six -> /Five/FIVE/ = fail'); # 7 qx{../src/task rc:caseless.rc rc.search.case.sensitive:no 1 modify /Five/FIVE/ 2>&1}; $output = qx{../src/task rc:caseless.rc info 1 2>&1}; like ($output, qr/four FIVE six/, 'one two three\nfour five six -> /Five/FIVE/ = caseless succeed'); # 8 qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes 1 modify /five/Five/ 2>&1}; $output = qx{../src/task rc:caseless.rc info 1 2>&1}; unlike ($output, qr/four Five six/, 'one two three\nfour FIVE six -> /five/Five/ = fail'); # 9 qx{../src/task rc:caseless.rc rc.search.case.sensitive:no 1 modify /five/five/ 2>&1}; $output = qx{../src/task rc:caseless.rc info 1 2>&1}; like ($output, qr/four five six/, 'one two three\nfour FIVE six -> /five/five/ = caseless succeed'); # Description filter. # 10 $output = qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes ls One 2>&1}; unlike ($output, qr/one two three/, 'one two three\nfour five six -> ls One = fail'); # 11 $output = qx{../src/task rc:caseless.rc rc.search.case.sensitive:no ls One 2>&1}; like ($output, qr/one two three/, 'one two three\nfour five six -> ls One caseless = succeed'); # 12 $output = qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes ls Five 2>&1}; unlike ($output, qr/four five six/, 'one two three\nfour five six -> ls Five = fail'); # 13 $output = qx{../src/task rc:caseless.rc rc.search.case.sensitive:no ls Five 2>&1}; like ($output, qr/four five six/, 'one two three\nfour five six -> ls Five caseless = succeed'); # Annotation filter. # 14 $output = qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes ls description.contains:Three 2>&1}; unlike ($output, qr/one two three/, 'one two three\nfour five six -> ls description.contains:Three = fail'); # 15 $output = qx{../src/task rc:caseless.rc rc.search.case.sensitive:no ls description.contains:Three 2>&1}; like ($output, qr/one two three/, 'one two three\nfour five six -> ls description.contains:Three caseless = succeed'); # 16 $output = qx{../src/task rc:caseless.rc rc.search.case.sensitive:yes ls description.contains:Six 2>&1}; unlike ($output, qr/four five six/, 'one two three\nfour five six -> ls description.contains:Six = fail'); # 17 $output = qx{../src/task rc:caseless.rc rc.search.case.sensitive:no ls description.contains:Six 2>&1}; like ($output, qr/four five six/, 'one two three\nfour five six -> ls description.contains:Six caseless = succeed'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key caseless.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'caseless.rc', 'Cleanup'); exit 0; task-2.2.0-test/color.active.t000075500000000000000000000044541213035135600162160ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "color.active=red\n", "_forcecolor=1\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } # Test the add command. qx{../src/task rc:color.rc add nothing 2>&1}; qx{../src/task rc:color.rc add red 2>&1}; qx{../src/task rc:color.rc 2 start 2>&1}; my $output = qx{../src/task rc:color.rc list 2>&1}; like ($output, qr/ (?!<\033\[\d\dm) .* nothing .* (?!>\033\[0m) /x, 'none'); like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.active'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key color.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'color.rc', 'Cleanup'); exit 0; task-2.2.0-test/color.blocked.t000075500000000000000000000045331213035135600163440ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "color.blocked=red\n", "color.alternate=\n", "_forcecolor=1\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } # Test the add command. qx{../src/task rc:color.rc add red 2>&1}; qx{../src/task rc:color.rc add nothing 2>&1}; qx{../src/task rc:color.rc 1 modify depends:2 2>&1}; my $output = qx{../src/task rc:color.rc list 2>&1}; like ($output, qr/ (?!<\033\[\d\dm) .* nothing .* (?!>\033\[0m) /x, 'none'); like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.blocked'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key color.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'color.rc', 'Cleanup'); exit 0; task-2.2.0-test/color.deprecated.t000075500000000000000000000041661213035135600170430ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "color.pri.H=red on black\n", "color.pri.M=red on_black\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } # Test the add command. my $output = qx{../src/task rc:color.rc show 2>&1}; like ($output, qr/that use deprecated underscores/ms, 'Deprecated color detected'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key color.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'color.rc', 'Cleanup'); exit 0; task-2.2.0-test/color.disable.t000075500000000000000000000044061213035135600163430ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "color.pri.H=red\n", "fontunderline=no\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } # Test the add command. qx{../src/task rc:color.rc add priority:H red 2>&1}; my $output = qx{../src/task rc:color.rc list 2>&1}; like ($output, qr/red/, 'color.disable - found red'); unlike ($output, qr/\033\[31m/, 'color.disable - no color red'); unlike ($output, qr/\033\[0m/, 'color.disable - no color reset'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key color.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'color.rc', 'Cleanup'); exit 0; task-2.2.0-test/color.due.t000075500000000000000000000044501213035135600155140ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "color.due=red\n", "_forcecolor=1\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } # Test the add command. qx{../src/task rc:color.rc add due:12/31/2037 nothing 2>&1}; qx{../src/task rc:color.rc add due:tomorrow red 2>&1}; my $output = qx{../src/task rc:color.rc list 2>&1}; like ($output, qr/ (?!<\033\[\d\dm) \d{1,2}\/\d{1,2}\/\d{4} (?!>\033\[0m) .* nothing /x, 'none'); like ($output, qr/ \033\[31m .* red .* \033\[0m/x, 'color.due'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key color.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'color.rc', 'Cleanup'); exit 0; task-2.2.0-test/color.duetoday.t000075500000000000000000000045061213035135600165570ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "color.due.today=red\n", "_forcecolor=1\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } # Test the add command. qx{../src/task rc:color.rc add due:12/31/2037 nothing 2>&1}; qx{../src/task rc:color.rc add due:5minutes red 2>&1}; my $output = qx{../src/task rc:color.rc list 2>&1}; like ($output, qr/ (?!<\033\[\d\dm) \d{1,2}\/\d{1,2}\/\d{4} (?!>\033\[0m) .* nothing /x, 'none'); like ($output, qr/ (?:\033\[31m|\033\[38;5;9m) .* red .* \033\[0m/x, 'color.due.today'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key color.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'color.rc', 'Cleanup'); exit 0; task-2.2.0-test/color.err.t000075500000000000000000000051241213035135600155260ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "color.header=blue\n", "color.footnote=red\n", "color.error=yellow\n", "color.debug=green\n", "_forcecolor=1\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } # Test the errors colors my $output = qx{../src/task rc:color.rc rc.debug:on add due:__ 2>&1 >/dev/null}; like ($output, qr/^\033\[33mThe\ duration\ '__'\ was\ not\ recognized\ as\ valid,\ with\ correct\ units\ like\ '3days'\.\033\[0m$/xms, 'color.error'); like ($output, qr/^\033\[32mTimer\ Config::load\ \(color.rc\) .* \033\[0m$/xms, 'color.debug'); like ($output, qr/^\033\[34mUsing\ alternate\ .taskrc\ file\ color.rc\033\[0m$/xms, 'color.header'); like ($output, qr/^\033\[31mConfiguration\ override\ rc.debug:on\033\[0m$/xms, 'color.footnote'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key color.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'color.rc', 'Cleanup'); exit 0; task-2.2.0-test/color.keyword.t000075500000000000000000000054661213035135600164330ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "search.case.sensitive=yes\n", "color=on\n", "color.alternate=\n", "color.keyword.red=red\n", "color.keyword.green=green\n", "color.keyword.yellow=yellow\n", "_forcecolor=1\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } # Test the add command. qx{../src/task rc:color.rc add nothing 2>&1}; qx{../src/task rc:color.rc add red 2>&1}; qx{../src/task rc:color.rc add green 2>&1}; qx{../src/task rc:color.rc add -- annotation 2>&1}; qx{../src/task rc:color.rc 4 annotate yellow 2>&1}; my $output = qx{../src/task rc:color.rc list 2>&1}; like ($output, qr/ (?!<\033\[\d\dm) .* nothing .* (?!>\033\[0m) /x, 'none'); like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.keyword.red'); like ($output, qr/ \033\[32m .* green .* \033\[0m /x, 'color.keyword.green'); like ($output, qr/ \033\[33m .* annotation .* \033\[0m /x, 'color.keyword.yellow (annotation)'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key color.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'color.rc', 'Cleanup'); exit 0; task-2.2.0-test/color.overdue.t000075500000000000000000000044571213035135600164170ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "color.overdue=red\n", "_forcecolor=1\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } # Test the add command. qx{../src/task rc:color.rc add due:tomorrow nothing 2>&1}; qx{../src/task rc:color.rc add due:yesterday red 2>&1}; my $output = qx{../src/task rc:color.rc list 2>&1}; like ($output, qr/ (?!<\033\[\d\dm) \d{1,2}\/\d{1,2}\/\d{4} (?!>\033\[0m) .* nothing /x, 'none'); like ($output, qr/ \033\[31m .* red .* \033\[0m/x, 'color.overdue'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key color.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'color.rc', 'Cleanup'); exit 0; task-2.2.0-test/color.pri.t000075500000000000000000000052101213035135600155240ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "color.pri.H=red\n", "color.pri.M=green\n", "color.pri.L=blue\n", "color.pri.none=yellow\n", "color.alternate=\n", "_forcecolor=1\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } # Test the add command. qx{../src/task rc:color.rc add priority:H red 2>&1}; qx{../src/task rc:color.rc add priority:M green 2>&1}; qx{../src/task rc:color.rc add priority:L blue 2>&1}; qx{../src/task rc:color.rc add yellow 2>&1}; my $output = qx{../src/task rc:color.rc list 2>&1}; like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.pri.H'); like ($output, qr/ \033\[32m .* green .* \033\[0m /x, 'color.pri.M'); like ($output, qr/ \033\[34m .* blue .* \033\[0m /x, 'color.pri.L'); like ($output, qr/ \033\[33m .* yellow .* \033\[0m /x, 'color.pri.none'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key color.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'color.rc', 'Cleanup'); exit 0; task-2.2.0-test/color.project.t000075500000000000000000000045511213035135600164070ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "color.project.x=red\n", "color.project.none=green\n", "color.alternate=\n", "_forcecolor=1\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } # Test the add command. qx{../src/task rc:color.rc add nothing 2>&1}; qx{../src/task rc:color.rc add project:x red 2>&1}; my $output = qx{../src/task rc:color.rc list 2>&1}; like ($output, qr/ \033\[32m .* nothing .* \033\[0m /x, 'color.project.none'); like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.project.red'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key color.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'color.rc', 'Cleanup'); exit 0; task-2.2.0-test/color.recurring.t000075500000000000000000000044771213035135600167500ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "color.recurring=red\n", "color.due=\n", "_forcecolor=1\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } # Test the add command. qx{../src/task rc:color.rc add nothing 2>&1}; qx{../src/task rc:color.rc add due:tomorrow recur:1w red 2>&1}; my $output = qx{../src/task rc:color.rc list 2>&1}; like ($output, qr/ (?!<\033\[\d\dm) .* nothing .* (?!>\033\[0m) /x, 'none'); like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.recurring'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key color.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'color.rc', 'Cleanup'); exit 0; task-2.2.0-test/color.t.cpp000064400000000000000000000226061213035135600155210ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { UnitTest t (1036); // Names matched to values. t.is ((int) Color (""), (int) Color (Color::nocolor), "'' == Color::nocolor"); t.is ((int) Color ("black"), (int) Color (Color::black), "'black' == Color::black"); t.is ((int) Color ("red"), (int) Color (Color::red), "'red' == Color::red"); t.is ((int) Color ("green"), (int) Color (Color::green), "'green' == Color::green"); t.is ((int) Color ("yellow"), (int) Color (Color::yellow), "'yellow' == Color::yellow"); t.is ((int) Color ("blue"), (int) Color (Color::blue), "'blue' == Color::blue"); t.is ((int) Color ("magenta"), (int) Color (Color::magenta), "'magenta' == Color::magenta"); t.is ((int) Color ("cyan"), (int) Color (Color::cyan), "'cyan' == Color::cyan"); t.is ((int) Color ("white"), (int) Color (Color::white), "'white' == Color::white"); // Auto upgrades. Color c ("red on color0"); t.is ((std::string) c, "color1 on color0", "upgrade red on color0 -> color1 on color0"); c = Color ("color1 on black"); t.is ((std::string) c, "color1 on color0", "upgrade color1 on black -> color1 on color0"); c = Color ("bold red on color0"); t.is ((std::string) c, "color9 on color0", "upgrade bold red on color0 -> color9 on color0"); c = Color ("color1 on bright black"); t.is ((std::string) c, "color1 on color8", "upgrade color1 on bright black -> color1 on color8"); // Simple blending. c = Color ("red"); c.blend (Color ("on white")); t.is ((std::string) c, "red on white", "red + on white -> red on white"); c = Color ("bold underline red"); c.blend (Color ("on bright white")); t.is ((std::string) c, "bold underline red on bright white", "bold underline red + on bright white -> bold underline red on bright white"); // Blending with conflicts. c = Color ("red on white"); c.blend (Color ("on blue")); t.is ((std::string) c, "red on blue", "red on white + on blue -> red on blue"); c = Color ("red on white"); c.blend (Color ("blue on magenta")); t.is ((std::string) c, "blue on magenta", "red on white + blue on magenta -> blue on magenta"); // Blending with upgrades. c = Color ("color1 on color0"); c.blend (Color ("blue")); t.is ((std::string) c, "color4 on color0", "color1 on color0 + blue -> color4 on color0"); // Now the dumb show of every color and its code. t.is (Color::colorize ("foo", "red"), std::string ("\033[31mfoo\033[0m"), "red -> ^[[31m"); t.is (Color::colorize ("foo", "bold red"), std::string ("\033[1;31mfoo\033[0m"), "bold red -> ^[[1;31m"); t.is (Color::colorize ("foo", "underline red"), std::string ("\033[4;31mfoo\033[0m"), "underline red -> ^[[4;31m"); t.is (Color::colorize ("foo", "underline bold red"), std::string ("\033[1;4;31mfoo\033[0m"), "underline bold red -> ^[[1;4;31m"); // 16-color foregrounds. t.is (Color::colorize ("foo", ""), std::string ("foo"), "'' -> ''"); t.is (Color::colorize ("foo", "black"), std::string ("\033[30mfoo\033[0m"), "black -> ^[[30m"); t.is (Color::colorize ("foo", "red"), std::string ("\033[31mfoo\033[0m"), "red -> ^[[31m"); t.is (Color::colorize ("foo", "green"), std::string ("\033[32mfoo\033[0m"), "green -> ^[[32m"); t.is (Color::colorize ("foo", "yellow"), std::string ("\033[33mfoo\033[0m"), "yellow -> ^[[33m"); t.is (Color::colorize ("foo", "blue"), std::string ("\033[34mfoo\033[0m"), "blue -> ^[[34m"); t.is (Color::colorize ("foo", "magenta"), std::string ("\033[35mfoo\033[0m"), "magenta -> ^[[35m"); t.is (Color::colorize ("foo", "cyan"), std::string ("\033[36mfoo\033[0m"), "cyan -> ^[[36m"); t.is (Color::colorize ("foo", "white"), std::string ("\033[37mfoo\033[0m"), "white -> ^[[37m"); // 16-color backgrounds. t.is (Color::colorize ("foo", "on bright black"), std::string ("\033[100mfoo\033[0m"), "on bright black -> ^[[100m"); t.is (Color::colorize ("foo", "on black"), std::string ("\033[40mfoo\033[0m"), "on black -> ^[[40m"); t.is (Color::colorize ("foo", "on red"), std::string ("\033[41mfoo\033[0m"), "on red -> ^[[41m"); t.is (Color::colorize ("foo", "on green"), std::string ("\033[42mfoo\033[0m"), "on green -> ^[[42m"); t.is (Color::colorize ("foo", "on yellow"), std::string ("\033[43mfoo\033[0m"), "on yellow -> ^[[43m"); t.is (Color::colorize ("foo", "on blue"), std::string ("\033[44mfoo\033[0m"), "on blue -> ^[[44m"); t.is (Color::colorize ("foo", "on magenta"), std::string ("\033[45mfoo\033[0m"), "on magenta -> ^[[45m"); t.is (Color::colorize ("foo", "on cyan"), std::string ("\033[46mfoo\033[0m"), "on cyan -> ^[[46m"); t.is (Color::colorize ("foo", "on white"), std::string ("\033[47mfoo\033[0m"), "on white -> ^[[47m"); // 256-color, basic colors. char color [24]; char codes [64]; char description [64]; for (int i = 0; i < 256; ++i) { sprintf (color, "color%d", i); sprintf (codes, "\033[38;5;%dmfoo\033[0m", i); sprintf (description, "color%d -> ^[[38;5;%dm", i, i); t.is (Color::colorize ("foo", color), std::string (codes), description); } for (int i = 0; i < 256; ++i) { sprintf (color, "on color%d", i); sprintf (codes, "\033[48;5;%dmfoo\033[0m", i); sprintf (description, "on color%d -> ^[[48;5;%dm", i, i); t.is (Color::colorize ("foo", color), std::string (codes), description); } // RGB Color Cube. for (int r = 0; r < 6; ++r) for (int g = 0; g < 6; ++g) for (int b = 0; b < 6; ++b) { int code = 16 + (r*36 + g*6 + b); sprintf (color, "rgb%d%d%d", r, g, b); sprintf (codes, "\033[38;5;%dmfoo\033[0m", code); sprintf (description, "rgb%d%d%d -> ^[[38;5;%dm", r, g, b, code); t.is (Color::colorize ("foo", color), std::string (codes), description); } for (int r = 0; r < 6; ++r) for (int g = 0; g < 6; ++g) for (int b = 0; b < 6; ++b) { int code = 16 + (r*36 + g*6 + b); sprintf (color, "on rgb%d%d%d", r, g, b); sprintf (codes, "\033[48;5;%dmfoo\033[0m", code); sprintf (description, "on rgb%d%d%d -> ^[[48;5;%dm", r, g, b, code); t.is (Color::colorize ("foo", color), std::string (codes), description); } // 256-color, grays. // grey == gray. t.is (Color::colorize ("foo", "grey0"), std::string ("\033[38;5;232mfoo\033[0m"), "grey0 -> ^[[38;5;232m"); for (int i = 0; i < 24; ++i) { sprintf (color, "gray%d", i); sprintf (codes, "\033[38;5;%dmfoo\033[0m", i + 232); sprintf (description, "gray%d -> ^[[38;5;%dm", i + 232, i + 232); t.is (Color::colorize ("foo", color), std::string (codes), description); } for (int i = 0; i < 24; ++i) { sprintf (color, "on gray%d", i); sprintf (codes, "\033[48;5;%dmfoo\033[0m", i + 232); sprintf (description, "on gray%d -> ^[[48;5;%dm", i + 232, i + 232); t.is (Color::colorize ("foo", color), std::string (codes), description); } // std::string Color::strip (const std::string&); t.is (Color::strip (""), "", "Color::strip '' -> ''"); t.is (Color::strip ("foo"), "foo", "Color::strip 'foo' -> 'foo'"); t.is (Color::strip ("f\033[1mo\033[0mo"), "foo", "Color::strip 'foo' -> 'foo'"); return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/color.tag.t000075500000000000000000000050431213035135600155110ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "color.tagged=\n", "color.alternate=\n", "color.tag.none=yellow\n", "color.tag.red=red\n", "color.tag.green=green\n", "_forcecolor=1\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } # Test the add command. qx{../src/task rc:color.rc add nothing 2>&1}; qx{../src/task rc:color.rc add +red red 2>&1}; qx{../src/task rc:color.rc add +green green 2>&1}; my $output = qx{../src/task rc:color.rc list 2>&1}; like ($output, qr/ \033\[33m .* nothing .* \033\[0m /x, 'color.tag.none'); like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.tag.red'); like ($output, qr/ \033\[32m .* green .* \033\[0m /x, 'color.tag.green'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key color.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'color.rc', 'Cleanup'); exit 0; task-2.2.0-test/color.tagged.t000075500000000000000000000045621213035135600161760ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; unlink 'pending.data'; ok (!-r 'pending.data', 'Removed pending.data'); # Create the rc file. if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "color.tagged=red\n", "color.alternate=\n", "_forcecolor=1\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } # Test the add command. qx{../src/task rc:color.rc add nothing 2>&1}; qx{../src/task rc:color.rc add +tag red 2>&1}; my $output = qx{../src/task rc:color.rc list 2>&1}; like ($output, qr/ (?!<\033\[\d\dm) .* nothing .* (?!>\033\[0m) /x, 'none'); like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.tagged'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key color.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'color.rc', 'Cleanup'); exit 0; task-2.2.0-test/color.uda.t000075500000000000000000000045111213035135600155060ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "color.uda.x=red\n", "uda.x.type=numeric\n", "uda.x.label=X\n", "color.alternate=\n", "_forcecolor=1\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } qx{../src/task rc:color.rc add one 2>&1}; qx{../src/task rc:color.rc add two x:3 2>&1}; my $output = qx{../src/task rc:color.rc list 2>/dev/null}; unlike ($output, qr/ \033\[32m .* one .* \033\[0m /x, 'No color.uda'); like ($output, qr/ \033\[31m .* two .* \033\[0m /x, 'Found color.uda'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key color.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'color.rc', 'Cleanup'); exit 0; task-2.2.0-test/completed.t000075500000000000000000000045301213035135600155750ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'completed.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'completed.rc', 'Created completed.rc'); } # Add two tasks, mark 1 as done, the other as deleted. qx{../src/task rc:completed.rc add one 2>&1}; qx{../src/task rc:completed.rc add two 2>&1}; qx{../src/task rc:completed.rc 1 done 2>&1}; qx{../src/task rc:completed.rc 2 delete 2>&1}; # Generate completed report. my $output = qx{../src/task rc:completed.rc completed 2>&1}; like ($output, qr/one/, 'one -> completed'); unlike ($output, qr/two/, 'two -> deleted'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key completed.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'completed.rc', 'Cleanup'); exit 0; task-2.2.0-test/config.obsolete.t000075500000000000000000000042751213035135600167070ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'obsolete.rc') { print $fh "data.location=.\n", "foo=1\n"; close $fh; ok (-r 'obsolete.rc', 'Created obsolete.rc'); } # Test the add command. my $output = qx{../src/task rc:obsolete.rc show 2>&1}; like ($output, qr/Your .taskrc file contains these unrecognized variables:\n/, 'unsupported configuration variable'); like ($output, qr/ foo\n/, 'unsupported configuration variable'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key obsolete.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'obsolete.rc', 'Cleanup'); exit 0; task-2.2.0-test/config.t.cpp000064400000000000000000000065071213035135600156520ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006 - 2013, Paul Beckingham, Federico Hernandez. // All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { UnitTest t (11); Config c; // void set (const std::string&, const std::string&); // const std::string get (const std::string&); c.set ("str1", "one"); t.is (c.get ("str1"), "one", "Config::set/get std::string"); c.set ("str1", ""); t.is (c.get ("str1"), "", "Config::set/get std::string"); // void set (const std::string&, const int); // const int getInteger (const std::string&); c.set ("int1", 1); t.is (c.getInteger ("int1"), 1, "Config::set/get int"); c.set ("int2", 3); t.is (c.getInteger ("int2"), 3, "Config::set/get int"); c.set ("int3", -9); t.is (c.getInteger ("int3"), -9, "Config::set/get int"); // void set (const std::string&, const double); // const double getReal (const std::string&); c.set ("double1", 1.0); t.is (c.getReal ("double1"), 1.0, "Config::set/get double"); c.set ("double2", 3.0); t.is (c.getReal ("double2"), 3.0, "Config::set/get double"); c.set ("double3", -9.0); t.is (c.getReal ("double3"), -9.0, "Config::set/get double"); // void set (const std::string&, const bool); // const bool getBoolean (const std::string&); c.set ("bool1", false); t.is (c.getBoolean ("bool1"), false, "Config::set/get bool"); c.set ("bool1", true); t.is (c.getBoolean ("bool1"), true, "Config::set/get bool"); // void all (std::vector &); std::vector all; c.all (all); // 8 created in this test program. // 22 default report setting created in Config::Config. t.ok (all.size () >= 8, "Config::all"); // TODO Test includes // TODO Test included nesting limit // TODO Test included absolute vs relative // TODO Test included missing file return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/confirmation.t000075500000000000000000000112451213035135600163120ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 24; # Create the rc file. if (open my $fh, '>', 'confirm.rc') { print $fh "data.location=.\n", "confirmation=yes\n"; close $fh; ok (-r 'confirm.rc', 'Created confirm.rc'); } # Create the response file. if (open my $fh, '>', 'response.txt') { print $fh "\n\nn\n"; close $fh; ok (-r 'response.txt', 'Created response.txt'); } qx{../src/task rc:confirm.rc add foo 2>&1} for 1..10; # Test the various forms of "Yes". my $output = qx{echo "Yes" | ../src/task rc:confirm.rc 1 del 2>&1}; like ($output, qr/Permanently delete task 1 'foo'\? \(yes\/no\)/, 'confirmation - Yes works'); unlike ($output, qr/Task not deleted\./, 'confirmation - Yes works'); $output = qx{echo "ye" | ../src/task rc:confirm.rc 2 del 2>&1}; like ($output, qr/Permanently delete task 2 'foo'\? \(yes\/no\)/, 'confirmation - ye works'); unlike ($output, qr/Task not deleted\./, 'confirmation - ye works'); $output = qx{echo "y" | ../src/task rc:confirm.rc 3 del 2>&1}; like ($output, qr/Permanently delete task 3 'foo'\? \(yes\/no\)/, 'confirmation - y works'); unlike ($output, qr/Task not deleted\./, 'confirmation - y works'); $output = qx{echo "YES" | ../src/task rc:confirm.rc 4 del 2>&1}; like ($output, qr/Permanently delete task 4 'foo'\? \(yes\/no\)/, 'confirmation - YES works'); unlike ($output, qr/Task not deleted\./, 'confirmation - YES works'); # 10 $output = qx{echo "YE" | ../src/task rc:confirm.rc 5 del 2>&1}; like ($output, qr/Permanently delete task 5 'foo'\? \(yes\/no\)/, 'confirmation - YE works'); unlike ($output, qr/Task not deleted\./, 'confirmation - YE works'); $output = qx{echo "Y" | ../src/task rc:confirm.rc 6 del 2>&1}; like ($output, qr/Permanently delete task 6 'foo'\? \(yes\/no\)/, 'confirmation - Y works'); unlike ($output, qr/Task not deleted\./, 'confirmation - Y works'); # Test the various forms of "no". $output = qx{echo "no" | ../src/task rc:confirm.rc 7 del 2>&1}; like ($output, qr/Permanently delete task 7 'foo'\? \(yes\/no\)/, 'confirmation - no works'); like ($output, qr/Task not deleted\./, 'confirmation - no works'); $output = qx{echo "n" | ../src/task rc:confirm.rc 7 del 2>&1}; like ($output, qr/Permanently delete task 7 'foo'\? \(yes\/no\)/, 'confirmation - n works'); like ($output, qr/Task not deleted\./, 'confirmation - n works'); $output = qx{echo "NO" | ../src/task rc:confirm.rc 7 del 2>&1}; like ($output, qr/Permanently delete task 7 'foo'\? \(yes\/no\)/, 'confirmation - NO works'); like ($output, qr/Task not deleted\./, 'confirmation - NO works'); # 20 $output = qx{echo "N" | ../src/task rc:confirm.rc 7 del 2>&1}; like ($output, qr/Permanently delete task 7 'foo'\? \(yes\/no\)/, 'confirmation - N works'); like ($output, qr/Task not deleted\./, 'confirmation - N works'); # Test newlines. $output = qx{cat response.txt | ../src/task rc:confirm.rc 7 del 2>&1}; like ($output, qr/(Permanently delete task 7 'foo'\? \(yes\/no\)) \1 \1/, 'confirmation - \n re-prompt works'); # 43 # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key confirm.rc response.txt); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'confirm.rc' && ! -r 'response.txt', 'Cleanup'); exit 0; task-2.2.0-test/count.t000075500000000000000000000063471213035135600147610ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 7; # Create the rc file. if (open my $fh, '>', 'count.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'count.rc', 'Created count.rc'); } # Test the count command. qx{../src/task rc:count.rc add one 2>&1}; qx{../src/task rc:count.rc log two 2>&1}; qx{../src/task rc:count.rc add three 2>&1}; qx{../src/task rc:count.rc 2 delete 2>&1}; qx{../src/task rc:count.rc add four wait:eom 2>&1}; # TODO This fails when today == eom. For example, on 2013-04-30 at 8:00:00, the # value for 'eom' is 2013-04-30 0:00:00, which is already past due, which # means a second child task is generated. This would be fixed by 'eom' # expanding to 2013-04-30 24:00:00, as per ISO-8601. qx{../src/task rc:count.rc add five due:eom recur:monthly 2>&1}; diag ("Problem: the next test fails at EOM"); my $output = qx{../src/task rc:count.rc count 2>&1}; like ($output, qr/^5\n/ms, 'count'); $output = qx{../src/task rc:count.rc count status:deleted rc.debug:1 2>&1}; like ($output, qr/^1\n/ms, 'count status:deleted'); diag ("Problem: the next test fails at EOM"); $output = qx{../src/task rc:count.rc count e 2>&1}; like ($output, qr/^3\n/ms, 'count e'); diag ("Problem: the next test fails at EOM"); $output = qx{../src/task rc:count.rc count description.startswith:f 2>&1}; like ($output, qr/^2\n/ms, 'count description.startswith:f'); diag ("Problem: the next test fails at EOM"); $output = qx{../src/task rc:count.rc count due.any: 2>&1}; like ($output, qr/^1\n/ms, 'count due.any:'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key count.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'count.rc', 'Cleanup'); exit 0; task-2.2.0-test/countdown.t000075500000000000000000000243531213035135600156460ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 82; # Create the rc file. if (open my $fh, '>', 'countdown.rc') { print $fh "data.location=.\n"; print $fh "report.up.description=countdown+ report\n"; print $fh "report.up.columns=id,due.countdown,description\n"; print $fh "report.up.labels=ID,Countdown,Description\n"; print $fh "report.up.filter=status:pending\n"; print $fh "report.up.sort=due+\n"; print $fh "report.down.description=countdown- report\n"; print $fh "report.down.columns=id,due.countdown,description\n"; print $fh "report.down.labels=ID,Countdown,Description\n"; print $fh "report.down.filter=status:pending\n"; print $fh "report.down.sort=due-\n"; print $fh "report.upc.description=countdown_compact+ report\n"; print $fh "report.upc.columns=id,due.countdown,description\n"; print $fh "report.upc.labels=ID,Countdown,Description\n"; print $fh "report.upc.filter=status:pending\n"; print $fh "report.upc.sort=due+\n"; print $fh "report.downc.description=countdown_compact- report\n"; print $fh "report.downc.columns=id,due.countdown,description\n"; print $fh "report.downc.labels=ID,Countdown,Description\n"; print $fh "report.downc.filter=status:pending\n"; print $fh "report.downc.sort=due-\n"; close $fh; ok (-r 'countdown.rc', 'Created countdown.rc'); } # Create a variety of pending tasks with increasingly higher due dates # to ensure proper sort order. qx{../src/task rc:countdown.rc add one due:-1.2y 2>&1}; qx{../src/task rc:countdown.rc add two due:-9mo 2>&1}; qx{../src/task rc:countdown.rc add three due:-2mo 2>&1}; qx{../src/task rc:countdown.rc add four due:-3wk 2>&1}; qx{../src/task rc:countdown.rc add five due:-7d 2>&1}; qx{../src/task rc:countdown.rc add six due:-2d 2>&1}; qx{../src/task rc:countdown.rc add seven due:-1d 2>&1}; qx{../src/task rc:countdown.rc add eight due:-12h 2>&1}; qx{../src/task rc:countdown.rc add nine due:-6h 2>&1}; qx{../src/task rc:countdown.rc add ten due:-1h 2>&1}; qx{../src/task rc:countdown.rc add eleven due:-30s 2>&1}; qx{../src/task rc:countdown.rc add twelve due:1h 2>&1}; qx{../src/task rc:countdown.rc add thirteen due:6h 2>&1}; qx{../src/task rc:countdown.rc add fourteen due:12h 2>&1}; qx{../src/task rc:countdown.rc add fifteen due:1d 2>&1}; qx{../src/task rc:countdown.rc add sixteen due:2d 2>&1}; qx{../src/task rc:countdown.rc add seventeen due:7d 2>&1}; qx{../src/task rc:countdown.rc add eighteen due:3wk 2>&1}; qx{../src/task rc:countdown.rc add nineteen due:2mo 2>&1}; qx{../src/task rc:countdown.rc add twenty due:9mo 2>&1}; qx{../src/task rc:countdown.rc add twentyone due:1.2y 2>&1}; my $output = qx{../src/task rc:countdown.rc up 2>&1}; like ($output, qr/\bone\b.+\btwo\b/ms, 'up: one < two'); like ($output, qr/\btwo\b.+\bthree/ms, 'up: two < three'); like ($output, qr/\bthree\b.+\bfour/ms, 'up: three < four'); like ($output, qr/\bfour\b.+\bfive/ms, 'up: four < five'); like ($output, qr/\bfive\b.+\bsix/ms, 'up: five < six'); like ($output, qr/\bsix\b.+\bseven/ms, 'up: six < seven'); like ($output, qr/\bseven\b.+\beight/ms, 'up: seven < eight'); like ($output, qr/\beight\b.+\bnine/ms, 'up: eight < nine'); like ($output, qr/\bnine\b.+\bten/ms, 'up: nine < ten'); like ($output, qr/\bten\b.+\beleven/ms, 'up: ten < eleven'); like ($output, qr/\beleven\b.+\btwelve/ms, 'up: eleven < twelve'); like ($output, qr/\btwelve\b.+\bthirteen/ms, 'up: twelve < thirteen'); like ($output, qr/\bthirteen\b.+\bfourteen/ms, 'up: thirteen < fourteen'); like ($output, qr/\bfourteen\b.+\bfifteen/ms, 'up: fourteen < fifteen'); like ($output, qr/\bfifteen\b.+\bsixteen/ms, 'up: fifteen < sixteen'); like ($output, qr/\bsixteen\b.+\bseventeen/ms, 'up: sixteen < seventeen'); like ($output, qr/\bseventeen\b.+\beighteen/ms, 'up: seventeen < eighteen'); like ($output, qr/\beighteen\b.+\bnineteen/ms, 'up: eighteen < nineteen'); like ($output, qr/\bnineteen\b.+\btwenty/ms, 'up: nineteen < twenty'); like ($output, qr/\btwenty\b.+\btwentyone/ms, 'up: twenty < twentyone'); $output = qx{../src/task rc:countdown.rc down 2>&1}; like ($output, qr/\btwentyone\b.+\btwenty/ms, 'down: twentyone < twenty'); like ($output, qr/\btwenty\b.+\bnineteen/ms, 'down: twenty < nineteen'); like ($output, qr/\bnineteen\b.+\beighteen/ms, 'down: nineteen < eighteen'); like ($output, qr/\beighteen\b.+\bseventeen/ms, 'down: eighteen < seventeen'); like ($output, qr/\bseventeen\b.+\bsixteen/ms, 'down: seventeen < sixteen'); like ($output, qr/\bsixteen\b.+\bfifteen/ms, 'down: sixteen < fifteen'); like ($output, qr/\bfifteen\b.+\bfourteen/ms, 'down: fifteen < fourteen'); like ($output, qr/\bfourteen\b.+\bthirteen/ms, 'down: fourteen < thirteen'); like ($output, qr/\bthirteen\b.+\btwelve/ms, 'down: thirteen < twelve'); like ($output, qr/\btwelve\b.+\beleven/ms, 'down: twelve < eleven'); like ($output, qr/\beleven\b.+\bten/ms, 'down: eleven < ten'); like ($output, qr/\bten\b.+\bnine/ms, 'down: ten < nine'); like ($output, qr/\bnine\b.+\beight/ms, 'down: nine < eight'); like ($output, qr/\beight\b.+\bseven/ms, 'down: eight < seven'); like ($output, qr/\bseven\b.+\bsix/ms, 'down: seven < six'); like ($output, qr/\bsix\b.+\bfive/ms, 'down: six < five'); like ($output, qr/\bfive\b.+\bfour/ms, 'down: five < four'); like ($output, qr/\bfour\b.+\bthree/ms, 'down: four < three'); like ($output, qr/\bthree\b.+\btwo/ms, 'down: three < two'); like ($output, qr/\btwo\b.+\bone\b/ms, 'down: two < one'); $output = qx{../src/task rc:countdown.rc upc 2>&1}; like ($output, qr/\bone\b.+\btwo\b/ms, 'upc: one < two'); like ($output, qr/\btwo\b.+\bthree/ms, 'upc: two < three'); like ($output, qr/\bthree\b.+\bfour/ms, 'upc: three < four'); like ($output, qr/\bfour\b.+\bfive/ms, 'upc: four < five'); like ($output, qr/\bfive\b.+\bsix/ms, 'upc: five < six'); like ($output, qr/\bsix\b.+\bseven/ms, 'upc: six < seven'); like ($output, qr/\bseven\b.+\beight/ms, 'upc: seven < eight'); like ($output, qr/\beight\b.+\bnine/ms, 'upc: eight < nine'); like ($output, qr/\bnine\b.+\bten/ms, 'upc: nine < ten'); like ($output, qr/\bten\b.+\beleven/ms, 'upc: ten < eleven'); like ($output, qr/\beleven\b.+\btwelve/ms, 'upc: eleven < twelve'); like ($output, qr/\btwelve\b.+\bthirteen/ms, 'upc: twelve < thirteen'); like ($output, qr/\bthirteen\b.+\bfourteen/ms, 'upc: thirteen < fourteen'); like ($output, qr/\bfourteen\b.+\bfifteen/ms, 'upc: fourteen < fifteen'); like ($output, qr/\bfifteen\b.+\bsixteen/ms, 'upc: fifteen < sixteen'); like ($output, qr/\bsixteen\b.+\bseventeen/ms, 'upc: sixteen < seventeen'); like ($output, qr/\bseventeen\b.+\beighteen/ms, 'upc: seventeen < eighteen'); like ($output, qr/\beighteen\b.+\bnineteen/ms, 'upc: eighteen < nineteen'); like ($output, qr/\bnineteen\b.+\btwenty/ms, 'upc: nineteen < twenty'); like ($output, qr/\btwenty\b.+\btwentyone/ms, 'upc: twenty < twentyone'); $output = qx{../src/task rc:countdown.rc downc 2>&1}; like ($output, qr/\btwentyone\b.+\btwenty/ms, 'downc: twentyone < twenty'); like ($output, qr/\btwenty\b.+\bnineteen/ms, 'downc: twenty < nineteen'); like ($output, qr/\bnineteen\b.+\beighteen/ms, 'downc: nineteen < eighteen'); like ($output, qr/\beighteen\b.+\bseventeen/ms, 'downc: eighteen < seventeen'); like ($output, qr/\bseventeen\b.+\bsixteen/ms, 'downc: seventeen < sixteen'); like ($output, qr/\bsixteen\b.+\bfifteen/ms, 'downc: sixteen < fifteen'); like ($output, qr/\bfifteen\b.+\bfourteen/ms, 'downc: fifteen < fourteen'); like ($output, qr/\bfourteen\b.+\bthirteen/ms, 'downc: fourteen < thirteen'); like ($output, qr/\bthirteen\b.+\btwelve/ms, 'downc: thirteen < twelve'); like ($output, qr/\btwelve\b.+\beleven/ms, 'downc: twelve < eleven'); like ($output, qr/\beleven\b.+\bten/ms, 'downc: eleven < ten'); like ($output, qr/\bten\b.+\bnine/ms, 'downc: ten < nine'); like ($output, qr/\bnine\b.+\beight/ms, 'downc: nine < eight'); like ($output, qr/\beight\b.+\bseven/ms, 'downc: eight < seven'); like ($output, qr/\bseven\b.+\bsix/ms, 'downc: seven < six'); like ($output, qr/\bsix\b.+\bfive/ms, 'downc: six < five'); like ($output, qr/\bfive\b.+\bfour/ms, 'downc: five < four'); like ($output, qr/\bfour\b.+\bthree/ms, 'downc: four < three'); like ($output, qr/\bthree\b.+\btwo/ms, 'downc: three < two'); like ($output, qr/\btwo\b.+\bone\b/ms, 'downc: two < one'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key countdown.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'countdown.rc', 'Cleanup'); exit 0; task-2.2.0-test/custom.columns.t000075500000000000000000000044321213035135600166130ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'custom.rc') { print $fh "data.location=.\n", "report.foo.description=DESC\n", "report.foo.columns=id,foo,description\n", "report.foo.sort=id+\n", "report.foo.filter=project:A\n"; close $fh; ok (-r 'custom.rc', 'Created custom.rc'); } # Generate the usage screen, and locate the custom report on it. my $output = qx{../src/task rc:custom.rc foo 2>&1 >/dev/null}; like ($output, qr/Unrecognized column name 'foo'\.\n/, 'custom report spotted invalid column'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key custom.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'custom.rc', 'Cleanup'); exit 0; task-2.2.0-test/custom.priority_long.t000075500000000000000000000050271213035135600200340ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'pri.rc') { print $fh "data.location=.\n", "report.foo.description=DESC\n", "report.foo.columns=id,priority.long\n", "report.foo.labels=ID,Pri\n", "report.foo.sort=id+\n"; close $fh; ok (-r 'pri.rc', 'Created pri.rc'); } # Generate the usage screen, and locate the custom report on it. qx{../src/task rc:pri.rc add one pri:H 2>&1}; qx{../src/task rc:pri.rc add two pri:M 2>&1}; qx{../src/task rc:pri.rc add three pri:L 2>&1}; my $output = qx{../src/task rc:pri.rc foo 2>&1}; like ($output, qr/ID.+Pri/, 'priority.long indicator heading'); like ($output, qr/1\s+High/, 'priority.long High'); like ($output, qr/2\s+Medium/, 'priority.long Medium'); like ($output, qr/3\s+Low/, 'priority.long Low'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key pri.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'pri.rc', 'Cleanup'); exit 0; task-2.2.0-test/custom.recur_ind.t000075500000000000000000000052331213035135600171050ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 7; # Create the rc file. if (open my $fh, '>', 'custom.rc') { print $fh "data.location=.\n", "report.foo.description=DESC\n", "report.foo.columns=id,recur.indicator\n", "report.foo.labels=ID,R\n", "report.foo.sort=id+\n"; close $fh; ok (-r 'custom.rc', 'Created custom.rc'); } # Add a recurring and non-recurring task, look for the indicator. qx{../src/task rc:custom.rc add foo due:tomorrow recur:weekly 2>&1}; qx{../src/task rc:custom.rc add bar 2>&1}; my $output = qx{../src/task rc:custom.rc foo 2>&1}; like ($output, qr/ID.+R/, 'Recurrence indicator heading'); like ($output, qr/3\s+R/, 'Recurrence indicator t1'); unlike ($output, qr/2\s+R/, 'No recurrence indicator t2'); $output = qx{../src/task rc:custom.rc foo rc.recurrence.indicator=RE 2>&1}; like ($output, qr/3\s+RE/, 'Custom recurrence indicator t1'); unlike ($output, qr/2\s+RE/, 'No custom recurrence indicator t2'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key custom.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'custom.rc', 'Cleanup'); exit 0; task-2.2.0-test/custom.t000075500000000000000000000047441213035135600151420ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'custom.rc') { print $fh "data.location=.\n", "report.foo.description=DESC\n", "report.foo.columns=id,description\n", "report.foo.sort=id+\n", "report.foo.filter=project:A\n"; close $fh; ok (-r 'custom.rc', 'Created custom.rc'); } # Generate the help screen, and locate the custom report on it. my $output = qx{../src/task rc:custom.rc help 2>&1}; like ($output, qr/task foo\s+DESC\n/m, 'report.foo'); qx{../src/task rc:custom.rc add project:A one 2>&1}; qx{../src/task rc:custom.rc add two 2>&1}; $output = qx{../src/task rc:custom.rc foo 2>&1}; like ($output, qr/one/, 'custom filter included'); unlike ($output, qr/two/, 'custom filter excluded'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key custom.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'custom.rc', 'Cleanup'); exit 0; task-2.2.0-test/custom.tag_ind.t000075500000000000000000000051371213035135600165430ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 7; # Create the rc file. if (open my $fh, '>', 'custom.rc') { print $fh "data.location=.\n", "report.foo.description=DESC\n", "report.foo.columns=id,tags.indicator\n", "report.foo.labels=ID,T\n", "report.foo.sort=id+\n"; close $fh; ok (-r 'custom.rc', 'Created custom.rc'); } # Generate the usage screen, and locate the custom report on it. qx{../src/task rc:custom.rc add foo +tag 2>&1}; qx{../src/task rc:custom.rc add bar 2>&1}; my $output = qx{../src/task rc:custom.rc foo 2>&1}; like ($output, qr/ID.+T/, 'Tag indicator heading'); like ($output, qr/1\s+\+/, 'Tag indicator t1'); unlike ($output, qr/2\s+\+/, 'No tag indicator t2'); $output = qx{../src/task rc:custom.rc foo rc.tag.indicator=TAG 2>&1}; like ($output, qr/1\s+TAG/, 'Custom ag indicator t1'); unlike ($output, qr/2\s+TAG/, 'No custom tag indicator t2'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key custom.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'custom.rc', 'Cleanup'); exit 0; task-2.2.0-test/date.iso.t000075500000000000000000000045421213035135600153320ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'iso.rc') { print $fh "data.location=.\n", "dateformat=m/d/Y\n"; close $fh; ok (-r 'iso.rc', 'Created iso.rc'); } # Test use of ISO date format, despite rc.dateformat. qx{../src/task rc:iso.rc add one due:20110901T120000Z 2>&1}; my $output = qx{../src/task rc:iso.rc 1 info 2>&1}; like ($output, qr/Due\s+9\/1\/2011/, 'ISO format recognized.'); # Test use of epoch date format, despite rc.dateformat. qx{../src/task rc:iso.rc add one due:1234524690 2>&1}; $output = qx{../src/task rc:iso.rc 2 info 2>&1}; like ($output, qr/Due\s+2\/13\/2009/, 'Epoch format recognized.'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key iso.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'iso.rc', 'Cleanup'); exit 0; task-2.2.0-test/date.t.cpp000064400000000000000000000455341213035135600153250ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { UnitTest t (205); try { Date now; Date yesterday; yesterday -= 86400; Date tomorrow; tomorrow += 86400; t.ok (yesterday <= now, "yesterday <= now"); t.ok (yesterday < now, "yesterday < now"); t.notok (yesterday == now, "!(yesterday == now)"); t.ok (yesterday != now, "yesterday != now"); t.ok (now >= yesterday, "now >= yesterday"); t.ok (now > yesterday, "now > yesterday"); t.ok (tomorrow >= now, "tomorrow >= now"); t.ok (tomorrow > now, "tomorrow > now"); t.notok (tomorrow == now, "!(tomorrow == now)"); t.ok (tomorrow != now, "tomorrow != now"); t.ok (now <= tomorrow, "now <= tomorrow"); t.ok (now < tomorrow, "now < tomorrow"); // Date::Date ("now") Date relative_now ("now"); t.ok (relative_now.sameHour (now), "Date ().sameHour (Date (now))"); t.ok (relative_now.sameDay (now), "Date ().sameDay (Date (now))"); t.ok (relative_now.sameMonth (now), "Date ().sameMonth (Date (now))"); t.ok (relative_now.sameYear (now), "Date ().sameYear (Date (now))"); // Loose comparisons. Date left ("7/4/2008"); Date comp1 ("7/4/2008"); t.ok (left.sameDay (comp1), "7/4/2008 is on the same day as 7/4/2008"); t.ok (left.sameMonth (comp1), "7/4/2008 is in the same month as 7/4/2008"); t.ok (left.sameYear (comp1), "7/4/2008 is in the same year as 7/4/2008"); Date comp2 ("7/5/2008"); t.notok (left.sameDay (comp2), "7/4/2008 is not on the same day as 7/5/2008"); t.ok (left.sameMonth (comp2), "7/4/2008 is in the same month as 7/5/2008"); t.ok (left.sameYear (comp2), "7/4/2008 is in the same year as 7/5/2008"); Date comp3 ("8/4/2008"); t.notok (left.sameDay (comp3), "7/4/2008 is not on the same day as 8/4/2008"); t.notok (left.sameMonth (comp3), "7/4/2008 is not in the same month as 8/4/2008"); t.ok (left.sameYear (comp3), "7/4/2008 is in the same year as 8/4/2008"); Date comp4 ("7/4/2009"); t.notok (left.sameDay (comp4), "7/4/2008 is not on the same day as 7/4/2009"); t.notok (left.sameMonth (comp4), "7/4/2008 is not in the same month as 7/4/2009"); t.notok (left.sameYear (comp4), "7/4/2008 is not in the same year as 7/4/2009"); // Validity. t.ok (Date::valid (2, 29, 2008), "valid: 2/29/2008"); t.notok (Date::valid (2, 29, 2007), "invalid: 2/29/2007"); t.ok (Date::valid ("2/29/2008"), "valid: 2/29/2008"); t.notok (Date::valid ("2/29/2007"), "invalid: 2/29/2007"); t.ok (Date::valid (366, 2008), "valid: 366 days in 2008"); t.notok (Date::valid (366, 2007), "invalid: 366 days in 2007"); // Time validity. t.ok (Date::valid (2, 28, 2010, 0, 0, 0), "valid 2/28/2010 0:00:00"); t.ok (Date::valid (2, 28, 2010, 23, 59, 59), "valid 2/28/2010 23:59:59"); t.notok (Date::valid (2, 28, 2010, 24, 59, 59), "valid 2/28/2010 24:59:59"); t.notok (Date::valid (2, 28, 2010, -1, 0, 0), "valid 2/28/2010 -1:00:00"); // Leap year. t.ok (Date::leapYear (2008), "2008 is a leap year"); t.notok (Date::leapYear (2007), "2007 is not a leap year"); t.ok (Date::leapYear (2000), "2000 is a leap year"); t.notok (Date::leapYear (1900), "1900 is not a leap year"); // Days in month. t.is (Date::daysInMonth (2, 2008), 29, "29 days in February 2008"); t.is (Date::daysInMonth (2, 2007), 28, "28 days in February 2007"); // Names. t.is (Date::monthName (1), "January", "1 = January"); t.is (Date::monthName (2), "February", "2 = February"); t.is (Date::monthName (3), "March", "3 = March"); t.is (Date::monthName (4), "April", "4 = April"); t.is (Date::monthName (5), "May", "5 = May"); t.is (Date::monthName (6), "June", "6 = June"); t.is (Date::monthName (7), "July", "7 = July"); t.is (Date::monthName (8), "August", "8 = August"); t.is (Date::monthName (9), "September", "9 = September"); t.is (Date::monthName (10), "October", "10 = October"); t.is (Date::monthName (11), "November", "11 = November"); t.is (Date::monthName (12), "December", "12 = December"); t.is (Date::dayName (0), "Sunday", "0 == Sunday"); t.is (Date::dayName (1), "Monday", "1 == Monday"); t.is (Date::dayName (2), "Tuesday", "2 == Tuesday"); t.is (Date::dayName (3), "Wednesday", "3 == Wednesday"); t.is (Date::dayName (4), "Thursday", "4 == Thursday"); t.is (Date::dayName (5), "Friday", "5 == Friday"); t.is (Date::dayName (6), "Saturday", "6 == Saturday"); t.is (Date::dayOfWeek ("SUNDAY"), 0, "SUNDAY == 0"); t.is (Date::dayOfWeek ("sunday"), 0, "sunday == 0"); t.is (Date::dayOfWeek ("Sunday"), 0, "Sunday == 0"); t.is (Date::dayOfWeek ("Monday"), 1, "Monday == 1"); t.is (Date::dayOfWeek ("Tuesday"), 2, "Tuesday == 2"); t.is (Date::dayOfWeek ("Wednesday"), 3, "Wednesday == 3"); t.is (Date::dayOfWeek ("Thursday"), 4, "Thursday == 4"); t.is (Date::dayOfWeek ("Friday"), 5, "Friday == 5"); t.is (Date::dayOfWeek ("Saturday"), 6, "Saturday == 6"); Date happyNewYear (1, 1, 2008); t.is (happyNewYear.dayOfWeek (), 2, "1/1/2008 == Tuesday"); t.is (happyNewYear.month (), 1, "1/1/2008 == January"); t.is (happyNewYear.day (), 1, "1/1/2008 == 1"); t.is (happyNewYear.year (), 2008, "1/1/2008 == 2008"); t.is (happyNewYear.toString (), "1/1/2008", "toString 1/1/2008"); int m, d, y; happyNewYear.toMDY (m, d, y); t.is (m, 1, "1/1/2008 == January"); t.is (d, 1, "1/1/2008 == 1"); t.is (y, 2008, "1/1/2008 == 2008"); Date epoch (9, 8, 2001); t.ok ((int)epoch.toEpoch () < 1000000000, "9/8/2001 < 1,000,000,000"); epoch += 172800; t.ok ((int)epoch.toEpoch () > 1000000000, "9/10/2001 > 1,000,000,000"); Date fromEpoch (epoch.toEpoch ()); t.is (fromEpoch.toString (), epoch.toString (), "ctor (time_t)"); Date iso (1000000000); t.is (iso.toISO (), "20010909T014640Z", "1,000,000,000 -> 20010909T014640Z"); // Quantization. Date quant (1234526400); t.is (quant.startOfDay ().toString ("YMDHNS"), "20090213000000", "1234526400 -> 2/13/2009 12:00:00 UTC -> 2/13/2009 0:00:00"); t.is (quant.startOfWeek ().toString ("YMDHNS"), "20090208000000", "1234526400 -> 2/13/2009 12:00:00 UTC -> 2/8/2009 0:00:00"); t.is (quant.startOfMonth ().toString ("YMDHNS"), "20090201000000", "1234526400 -> 2/13/2009 12:00:00 UTC -> 2/1/2009 0:00:00"); t.is (quant.startOfYear ().toString ("YMDHNS"), "20090101000000", "1234526400 -> 2/13/2009 12:00:00 UTC -> 1/1/2009 0:00:00"); // Date parsing. Date fromString1 ("1/1/2008"); t.is (fromString1.month (), 1, "ctor (std::string) -> m"); t.is (fromString1.day (), 1, "ctor (std::string) -> d"); t.is (fromString1.year (), 2008, "ctor (std::string) -> y"); Date fromString2 ("1/1/2008", "m/d/Y"); t.is (fromString2.month (), 1, "ctor (std::string) -> m"); t.is (fromString2.day (), 1, "ctor (std::string) -> d"); t.is (fromString2.year (), 2008, "ctor (std::string) -> y"); Date fromString3 ("20080101", "YMD"); t.is (fromString3.month (), 1, "ctor (std::string) -> m"); t.is (fromString3.day (), 1, "ctor (std::string) -> d"); t.is (fromString3.year (), 2008, "ctor (std::string) -> y"); Date fromString4 ("12/31/2007"); t.is (fromString4.month (), 12, "ctor (std::string) -> m"); t.is (fromString4.day (), 31, "ctor (std::string) -> d"); t.is (fromString4.year (), 2007, "ctor (std::string) -> y"); Date fromString5 ("12/31/2007", "m/d/Y"); t.is (fromString5.month (), 12, "ctor (std::string) -> m"); t.is (fromString5.day (), 31, "ctor (std::string) -> d"); t.is (fromString5.year (), 2007, "ctor (std::string) -> y"); Date fromString6 ("20071231", "YMD"); t.is (fromString6.month (), 12, "ctor (std::string) -> m"); t.is (fromString6.day (), 31, "ctor (std::string) -> d"); t.is (fromString6.year (), 2007, "ctor (std::string) -> y"); Date fromString7 ("01/01/2008", "m/d/Y"); t.is (fromString7.month (), 1, "ctor (std::string) -> m"); t.is (fromString7.day (), 1, "ctor (std::string) -> d"); t.is (fromString7.year (), 2008, "ctor (std::string) -> y"); Date fromString8 ("Tue 05 Feb 2008 (06)", "a D b Y (V)"); t.is (fromString8.month (), 2, "ctor (std::string) -> m"); t.is (fromString8.day (), 5, "ctor (std::string) -> d"); t.is (fromString8.year (), 2008, "ctor (std::string) -> y"); Date fromString9 ("Tuesday, February 5, 2008", "A, B d, Y"); t.is (fromString9.month (), 2, "ctor (std::string) -> m"); t.is (fromString9.day (), 5, "ctor (std::string) -> d"); t.is (fromString9.year (), 2008, "ctor (std::string) -> y"); Date fromString10 ("w01 Tue 2008-01-01", "wV a Y-M-D"); t.is (fromString10.month (), 1, "ctor (std::string) -> m"); t.is (fromString10.day (), 1, "ctor (std::string) -> d"); t.is (fromString10.year (), 2008, "ctor (std::string) -> y"); Date fromString11 ("6/7/2010 1:23:45", "m/d/Y h:N:S"); t.is (fromString11.month (), 6, "ctor (std::string) -> m"); t.is (fromString11.day (), 7, "ctor (std::string) -> d"); t.is (fromString11.year (), 2010, "ctor (std::string) -> Y"); t.is (fromString11.hour (), 1, "ctor (std::string) -> h"); t.is (fromString11.minute (), 23, "ctor (std::string) -> N"); t.is (fromString11.second (), 45, "ctor (std::string) -> S"); Date fromString12 ("6/7/2010 01:23:45", "m/d/Y H:N:S"); t.is (fromString12.month (), 6, "ctor (std::string) -> m"); t.is (fromString12.day (), 7, "ctor (std::string) -> d"); t.is (fromString12.year (), 2010, "ctor (std::string) -> Y"); t.is (fromString12.hour (), 1, "ctor (std::string) -> h"); t.is (fromString12.minute (), 23, "ctor (std::string) -> N"); t.is (fromString12.second (), 45, "ctor (std::string) -> S"); Date fromString13 ("6/7/2010 12:34:56", "m/d/Y H:N:S"); t.is (fromString13.month (), 6, "ctor (std::string) -> m"); t.is (fromString13.day (), 7, "ctor (std::string) -> d"); t.is (fromString13.year (), 2010, "ctor (std::string) -> Y"); t.is (fromString13.hour (), 12, "ctor (std::string) -> h"); t.is (fromString13.minute (), 34, "ctor (std::string) -> N"); t.is (fromString13.second (), 56, "ctor (std::string) -> S"); // Day of year t.is (Date ("1/1/2011", "m/d/Y").dayOfYear (), 1, "dayOfYear (1/1/2011) -> 1"); t.is (Date ("5/1/2011", "m/d/Y").dayOfYear (), 121, "dayOfYear (5/1/2011) -> 121"); t.is (Date ("12/31/2011", "m/d/Y").dayOfYear (), 365, "dayOfYear (12/31/2011) -> 365"); // Easter Date e1 (Date::easter(1980)); t.is (e1.toString (), "4/6/1980", "Easter 4/6/1980"); Date e2 (Date::easter(1995)); t.is (e2.toString (), "4/16/1995", "Easter 4/16/1995"); Date e3 (Date::easter(2000)); t.is (e3.toString (), "4/23/2000", "Easter 4/23/2000"); Date e4 (Date::easter(2009)); t.is (e4.toString (), "4/12/2009", "Easter 4/12/2009"); Date e5 (Date::easter(2010)); t.is (e5.toString (), "4/4/2010", "Easter 4/4/2010"); Date e6 (Date::easter(2011)); t.is (e6.toString (), "4/24/2011", "Easter 4/24/2011"); Date e7 (Date::easter(2012)); t.is (e7.toString (), "4/8/2012", "Easter 4/8/2012"); Date e8 (Date::easter(2020)); t.is (e8.toString (), "4/12/2020", "Easter 4/12/2020"); // Relative dates. Date r1 ("today"); t.ok (r1.sameDay (now), "today = now"); Date r4 ("sunday"); if (now.dayOfWeek () >= 0) t.ok (r4.sameDay (now + (0 - now.dayOfWeek () + 7) * 86400), "next sunday"); else t.ok (r4.sameDay (now + (0 - now.dayOfWeek ()) * 86400), "next sunday");; Date r5 ("monday"); if (now.dayOfWeek () >= 1) t.ok (r5.sameDay (now + (1 - now.dayOfWeek () + 7) * 86400), "next monday"); else t.ok (r5.sameDay (now + (1 - now.dayOfWeek ()) * 86400), "next monday");; Date r6 ("tuesday"); if (now.dayOfWeek () >= 2) t.ok (r6.sameDay (now + (2 - now.dayOfWeek () + 7) * 86400), "next tuesday"); else t.ok (r6.sameDay (now + (2 - now.dayOfWeek ()) * 86400), "next tuesday");; Date r7 ("wednesday"); if (now.dayOfWeek () >= 3) t.ok (r7.sameDay (now + (3 - now.dayOfWeek () + 7) * 86400), "next wednesday"); else t.ok (r7.sameDay (now + (3 - now.dayOfWeek ()) * 86400), "next wednesday");; Date r8 ("thursday"); if (now.dayOfWeek () >= 4) t.ok (r8.sameDay (now + (4 - now.dayOfWeek () + 7) * 86400), "next thursday"); else t.ok (r8.sameDay (now + (4 - now.dayOfWeek ()) * 86400), "next thursday");; Date r9 ("friday"); if (now.dayOfWeek () >= 5) t.ok (r9.sameDay (now + (5 - now.dayOfWeek () + 7) * 86400), "next friday"); else t.ok (r9.sameDay (now + (5 - now.dayOfWeek ()) * 86400), "next friday");; Date r10 ("saturday"); if (now.dayOfWeek () >= 6) t.ok (r10.sameDay (now + (6 - now.dayOfWeek () + 7) * 86400), "next saturday"); else t.ok (r10.sameDay (now + (6 - now.dayOfWeek ()) * 86400), "next saturday");; Date r11 ("eow"); t.ok (r11 < now + (8 * 86400), "eow < 7 days away"); Date r12 ("eocw"); t.ok (r12 < now + (8 * 86400), "eocw < 7 days away"); Date r13 ("eom"); t.ok (r13.sameMonth (now), "eom in same month as now"); Date r14 ("eocm"); t.ok (r14.sameMonth (now), "eocm in same month as now"); Date r15 ("eoy"); t.ok (r15.sameYear (now), "eoy in same year as now"); Date r16 ("sow"); t.ok (r16 < now + (8 * 86400), "sow < 7 days away"); Date r23 ("socw"); t.ok (r23 < now + (8 * 86400), "sow < 7 days away"); Date r17 ("som"); t.notok (r17.sameMonth (now), "som not in same month as now"); Date r18 ("socm"); t.ok (r18.sameMonth (now), "socm in same month as now"); Date r19 ("soy"); t.notok (r19.sameYear (now), "soy not in same year as now"); Date first ("1st"); t.notok (first.sameMonth (now), "1st not in same month as now"); t.is (first.day (), 1, "1st day is 1"); Date FIRST ("1ST"); t.ok (FIRST == first, "1st == 1ST"); Date later ("later"); t.is (later.month (), 1, "later -> m = 1"); t.is (later.day (), 18, "later -> d = 18"); t.is (later.year (), 2038, "later -> y = 2038"); // Quarters Date soq ("soq"); Date eoq ("eoq"); t.is (soq.day (), 1, "soq is the first day of a month"); t.is (eoq.day () / 10, 3, "eoq is the 30th or 31th of a month"); t.is (soq.month () % 3, 1, "soq month is 1, 4, 7 or 10"); t.is (eoq.month () % 3, 0, "eoq month is 3, 6, 9 or 12"); // Note: these fail during the night of daylight savings end. t.ok (soq.sameYear (now) || (now.month () >= 10 && soq.year () == now.year () + 1), "soq is in same year as now"); t.ok (eoq.sameYear (now), "eoq is in same year as now"); // Date::sameHour Date r20 ("6/7/2010 01:00:00", "m/d/Y H:N:S"); Date r21 ("6/7/2010 01:59:59", "m/d/Y H:N:S"); t.ok (r20.sameHour (r21), "two dates within the same hour"); Date r22 ("6/7/2010 00:59:59", "m/d/Y H:N:S"); t.notok (r20.sameHour (r22), "two dates not within the same hour"); // Date::operator- Date r25 (1234567890); t.is ((r25 - 1).toEpoch (), 1234567889, "1234567890 - 1 = 1234567889"); // Date::operator-- Date r26 (11, 7, 2010, 23, 59, 59); r26--; t.is (r26.toString ("YMDHNS"), "20101106235959", "decrement across fall DST boundary"); Date r27 (3, 14, 2010, 23, 59, 59); r27--; t.is (r27.toString ("YMDHNS"), "20100313235959", "decrement across spring DST boundary"); // Date::operator++ Date r28 (11, 6, 2010, 23, 59, 59); r28++; t.is (r28.toString ("YMDHNS"), "20101107235959", "increment across fall DST boundary"); Date r29 (3, 13, 2010, 23, 59, 59); r29++; t.is (r29.toString ("YMDHNS"), "20100314235959", "increment across spring DST boundary"); // int Date::length (const std::string&); t.is (Date::length ("m"), 2, "length 'm' --> 2"); t.is (Date::length ("M"), 2, "length 'M' --> 2"); t.is (Date::length ("d"), 2, "length 'd' --> 2"); t.is (Date::length ("D"), 2, "length 'D' --> 2"); t.is (Date::length ("y"), 2, "length 'y' --> 2"); t.is (Date::length ("Y"), 4, "length 'Y' --> 4"); t.is (Date::length ("a"), 3, "length 'a' --> 3"); t.is (Date::length ("A"), 10, "length 'A' --> 10"); t.is (Date::length ("b"), 3, "length 'b' --> 3"); t.is (Date::length ("B"), 10, "length 'B' --> 10"); t.is (Date::length ("v"), 2, "length 'v' --> 2"); t.is (Date::length ("V"), 2, "length 'V' --> 2"); t.is (Date::length ("h"), 2, "length 'h' --> 2"); t.is (Date::length ("H"), 2, "length 'H' --> 2"); t.is (Date::length ("n"), 2, "length 'n' --> 2"); t.is (Date::length ("N"), 2, "length 'N' --> 2"); t.is (Date::length ("s"), 2, "length 's' --> 2"); t.is (Date::length ("S"), 2, "length 'S' --> 2"); t.is (Date::length ("j"), 3, "length 'j' --> 3"); t.is (Date::length ("J"), 3, "length 'J' --> 3"); t.is (Date::length (" "), 1, "length ' ' --> 1"); } catch (const std::string& e) { t.fail ("Exception thrown."); t.diag (e); } return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/dateformat.t000075500000000000000000000066471213035135600157620ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 10; # Create the rc file. if (open my $fh, '>', 'date1.rc') { print $fh "data.location=.\n", "dateformat=YMD\n", "dateformat.info=YMD\n", "dateformat.report=YMD\n"; close $fh; ok (-r 'date1.rc', 'Created date1.rc'); } if (open my $fh, '>', 'date2.rc') { print $fh "data.location=.\n", "dateformat=m/d/y\n", "dateformat.info=m/d/y\n", "dateformat.report=m/d/y\n"; close $fh; ok (-r 'date2.rc', 'Created date2.rc'); } if (open my $fh, '>', 'date3.rc') { print $fh "data.location=.\n", "dateformat=m/d/y\n", "dateformat=m/d/y\n", "weekstart=Monday\n", "dateformat.info=A D B Y (wV)\n", "dateformat.report=A D B Y (wV)\n"; close $fh; ok (-r 'date3.rc', 'Created date3.rc'); } qx{../src/task rc:date1.rc add foo due:20091231 2>&1}; my $output = qx{../src/task rc:date1.rc info 1 2>&1}; like ($output, qr/\b20091231\b/, 'date format YMD parsed'); unlink 'pending.data'; ok (!-r 'pending.data', 'Removed pending.data'); qx{../src/task rc:date2.rc add foo due:12/1/09 2>&1}; $output = qx{../src/task rc:date2.rc info 1 2>&1}; like ($output, qr/\b12\/1\/09\b/, 'date format m/d/y parsed'); unlink 'pending.data'; ok (!-r 'pending.data', 'Removed pending.data'); qx{../src/task rc:date3.rc add foo due:4/8/10 2>&1}; $output = qx{../src/task rc:date3.rc list 2>&1}; like ($output, qr/Thursday 08 April 2010 \(w14\)/, 'date format A D B Y (wV) parsed'); $output = qx{../src/task rc:date3.rc rc.dateformat.report:"D b Y - a" list 2>&1}; like ($output, qr/08 Apr 2010 - Thu/, 'date format D b Y - a parsed'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key date1.rc date2.rc date3.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'date1.rc' && ! -r 'date2.rc' && ! -r 'date3.rc', 'Cleanup'); exit 0; task-2.2.0-test/datesort.t000075500000000000000000000053371213035135600154540ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'datesort.rc') { print $fh "data.location=.\n", "dateformat=YMD\n", "report.small_list.description=Small list\n", "report.small_list.columns=due,description\n", "report.small_list.labels=Due,Description\n", "report.small_list.sort=due+\n", "report.small_list.filter=status:pending\n", "report.small_list.dateformat=MD\n"; close $fh; ok (-r 'datesort.rc', 'Created datesort.rc'); } qx{../src/task rc:datesort.rc add two due:20100201 2>&1}; qx{../src/task rc:datesort.rc add one due:20100101 2>&1}; qx{../src/task rc:datesort.rc add three due:20100301 2>&1}; my $output = qx{../src/task rc:datesort.rc small_list 2>&1}; like ($output, qr/one.+two.+three/ms, 'Sorting by due+ with format MD works'); $output = qx{../src/task rc:datesort.rc rc.report.small_list.sort=due- small_list 2>&1}; like ($output, qr/three.+two.+one/ms, 'Sorting by due- with format MD works'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key datesort.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'datesort.rc', 'Cleanup'); exit 0; task-2.2.0-test/default.t000075500000000000000000000100311213035135600152360ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 21; # Create the rc file. if (open my $fh, '>', 'default.rc') { print $fh "data.location=.\n", "default.command=list\n", "default.project=PROJECT\n", "default.priority=M\n", "default.due=eom\n"; close $fh; ok (-r 'default.rc', 'Created default.rc'); } # Set up a default command, project and priority. qx{../src/task rc:default.rc add all defaults 2>&1}; my $output = qx{../src/task rc:default.rc list 2>&1}; like ($output, qr/ all defaults/, 'task added'); like ($output, qr/ PROJECT /, 'default project added'); like ($output, qr/ M /, 'default priority added'); like ($output, qr/\//, 'default due added'); unlink 'pending.data'; qx{../src/task rc:default.rc add project:specific priority:L due:eoy all specified 2>&1}; $output = qx{../src/task rc:default.rc list 2>&1}; like ($output, qr/ all specified/, 'task added'); like ($output, qr/ specific /, 'project specified'); like ($output, qr/ L /, 'priority specified'); like ($output, qr/\//, 'due specified'); unlink 'pending.data'; qx{../src/task rc:default.rc add project:specific project specified 2>&1}; $output = qx{../src/task rc:default.rc list 2>&1}; like ($output, qr/ project specified/, 'task added'); like ($output, qr/ specific /, 'project specified'); like ($output, qr/ M /, 'default priority added'); like ($output, qr/\//, 'default due added'); unlink 'pending.data'; qx{../src/task rc:default.rc add priority:L priority specified 2>&1}; $output = qx{../src/task rc:default.rc list 2>&1}; like ($output, qr/ priority specified/, 'task added'); like ($output, qr/ PROJECT /, 'default project added'); like ($output, qr/ L /, 'priority specified'); like ($output, qr/\//, 'default due added'); $output = qx{../src/task rc:default.rc 2>&1}; like ($output, qr/1 PROJECT L .+ priority specified/, 'default command worked'); qx{../src/task rc:default.rc add project:HOME priority:M due:tomorrow all specified 2>&1}; qx{echo 'y' | ../src/task rc:default.rc config default.command 'list priority:M' 2>&1}; $output = qx{../src/task rc:default.rc 2>&1}; like ($output, qr/ M /, 'priority:M included in default command'); unlike ($output, qr/ L /, 'priority:L excluded from default command'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key default.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'default.rc', 'Cleanup'); exit 0; task-2.2.0-test/delete.t000075500000000000000000000073501213035135600150660ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 16; # Create the rc file. if (open my $fh, '>', 'delete.rc') { print $fh "data.location=.\n", "confirmation=no\n", "echo.command=no\n"; close $fh; ok (-r 'delete.rc', 'Created delete.rc'); } # Add a task, delete it, undelete it. my $output = qx{../src/task rc:delete.rc add one 2>&1; ../src/task rc:delete.rc info 1 2>&1}; ok (-r 'pending.data', 'pending.data created'); like ($output, qr/Status\s+Pending\n/, 'Pending'); $output = qx{../src/task rc:delete.rc 1 delete 2>&1; ../src/task rc:delete.rc info 1 2>&1}; like ($output, qr/Status\s+Deleted\n/, 'Deleted'); ok (-r 'completed.data', 'completed.data created'); $output = qx{echo 'y' | ../src/task rc:delete.rc undo 2>&1; ../src/task rc:delete.rc info 1 2>&1}; like ($output, qr/Status\s+Pending\n/, 'Pending'); ok (-r 'completed.data', 'completed.data created'); $output = qx{../src/task rc:delete.rc 1 delete 2>&1; ../src/task rc:delete.rc list 2>&1 >/dev/null}; like ($output, qr/No matches./, 'No matches'); ok (-r 'completed.data', 'completed.data created'); $output = qx{../src/task rc:delete.rc info 1 2>&1 >/dev/null}; like ($output, qr/No matches\./, 'No matches'); # 10 # Add a task, delete it, and modify on the fly. qx{../src/task rc:delete.rc add one two 2>&1}; $output = qx{../src/task rc:delete.rc list 2>&1}; like ($output, qr/one two/, 'Second task added'); qx{../src/task rc:delete.rc 1 delete foo pri:H 2>&1}; $output = qx{../src/task rc:delete.rc 1 info 2>&1}; like ($output, qr/foo/, 'Deletion annotation successful'); like ($output, qr/H/, 'Deletion modification successful'); # Add a task, complete it, then delete it. qx{../src/task rc:delete.rc add three 2>&1}; $output = qx{../src/task rc:delete.rc 2 info 2>&1}; like ($output, qr/three/, 'added and verified new task'); my ($uuid) = $output =~ /UUID\s+(\S+)/; qx{../src/task rc:delete.rc 2 done 2>&1}; qx{../src/task rc:delete.rc $uuid delete 2>&1}; $output = qx{../src/task rc:delete.rc $uuid info 2>&1}; like ($output, qr/Deleted/, 'task added, completed, then deleted'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key delete.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'delete.rc', 'Cleanup'); exit 0; task-2.2.0-test/denotate.t000075500000000000000000000135401213035135600154250ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 27; # Create the rc file. if (open my $fh, '>', 'denotate.rc') { # Note: Use 'rrr' to guarantee a unique report name. Using 'r' conflicts # with 'recurring'. print $fh "data.location=.\n", "confirmation=off\n", "report.rrr.description=rrr\n", "report.rrr.columns=id,description\n", "report.rrr.sort=id+\n"; close $fh; ok (-r 'denotate.rc', 'Created denotate.rc'); } # Add four tasks, annotate one three times, one twice, one just once and one none. qx{../src/task rc:denotate.rc add one 2>&1}; qx{../src/task rc:denotate.rc 1 annotate Ernie 2>&1}; qx{../src/task rc:denotate.rc 1 annotate Bert 2>&1}; qx{../src/task rc:denotate.rc 1 annotate Bibo 2>&1}; qx{../src/task rc:denotate.rc 1 annotate Kermit the frog 2>&1}; qx{../src/task rc:denotate.rc 1 annotate Kermit the frog 2>&1}; qx{../src/task rc:denotate.rc 1 annotate Kermit 2>&1}; qx{../src/task rc:denotate.rc 1 annotate Kermit and Miss Piggy 2>&1}; my $output = qx{../src/task rc:denotate.rc rrr 2>&1}; like ($output, qr/1 one/, 'task 1'); like ($output, qr/one.+\d{1,2}\/\d{1,2}\/\d{4} Ernie/ms, 'first annotation'); like ($output, qr/Ernie.+\d{1,2}\/\d{1,2}\/\d{4} Bert/ms, 'second annotation'); like ($output, qr/Bert.+\d{1,2}\/\d{1,2}\/\d{4} Bibo/ms, 'third annotation'); # 5 like ($output, qr/Bibo.+\d{1,2}\/\d{1,2}\/\d{4} Kermit the frog/ms, 'fourth annotation'); like ($output, qr/frog.+\d{1,2}\/\d{1,2}\/\d{4} Kermit the frog/ms, 'fifth annotation'); like ($output, qr/frog.+\d{1,2}\/\d{1,2}\/\d{4} Kermit/ms, 'sixth annotation'); like ($output, qr/Kermit.+\d{1,2}\/\d{1,2}\/\d{4} Kermit and Miss Piggy/ms, 'seventh annotation'); like ($output, qr/1 task/, 'count'); # 10 qx{../src/task rc:denotate.rc 1 denotate Ernie 2>&1}; $output = qx{../src/task rc:denotate.rc rrr 2>&1}; unlike ($output, qr/one.+\d{1,2}\/\d{1,2}\/\d{4} Ernie/ms, 'Delete annotation'); like ($output, qr/one.+\d{1,2}\/\d{1,2}\/\d{4} Bert/ms, 'Bert now first annotationt'); qx{../src/task rc:denotate.rc 1 denotate Bi 2>&1}; $output = qx{../src/task rc:denotate.rc rrr 2>&1}; unlike ($output, qr/Bert.+\d{1,2}\/\d{1,2}\/\d{4} Bibo/ms, 'Delete partial match'); like ($output, qr/Bert.+\d{1,2}\/\d{1,2}\/\d{4} Kermit the frog/ms, 'Kermit the frog now second annotation'); qx{../src/task rc:denotate.rc 1 denotate BErt 2>&1}; $output = qx{../src/task rc:denotate.rc rrr 2>&1}; like ($output, qr/one.+\d{1,2}\/\d{1,2}\/\d{4} Bert/ms, 'Denotate is case sensitive'); # 15 like ($output, qr/Bert.+\d{1,2}\/\d{1,2}\/\d{4} Kermit the frog/ms, 'Kermit the frog still second annoation'); qx{../src/task rc:denotate.rc 1 denotate Kermit 2>&1}; $output = qx{../src/task rc:denotate.rc rrr 2>&1}; like ($output, qr/one.+\d{1,2}\/\d{1,2}\/\d{4} Bert/ms, 'Exact match deletion - Bert'); like ($output, qr/Bert.+\d{1,2}\/\d{1,2}\/\d{4} Kermit the frog/ms, 'Exact match deletion - Kermit the frog'); like ($output, qr/frog.+\d{1,2}\/\d{1,2}\/\d{4} Kermit the frog/ms, 'Exact match deletion - Kermit the frog'); like ($output, qr/frog.+\d{1,2}\/\d{1,2}\/\d{4} Kermit and Miss Piggy/ms, 'Exact match deletion - Kermit and Miss Piggy'); # 20 qx{../src/task rc:denotate.rc 1 denotate Kermit the 2>&1}; $output = qx{../src/task rc:denotate.rc rrr 2>&1}; like ($output, qr/one.+\d{1,2}\/\d{1,2}\/\d{4} Bert/ms, 'Delete just one annotation - Bert'); like ($output, qr/Bert.+\d{1,2}\/\d{1,2}\/\d{4} Kermit the frog/ms, 'Delete just one annotation - Kermit the frog'); like ($output, qr/frog.+\d{1,2}\/\d{1,2}\/\d{4} Kermit and Miss Piggy/ms, 'Delete just one annotation - Kermit and Miss Piggy'); $output = qx{../src/task rc:denotate.rc 1 denotate Kermit a 2>&1}; $output = qx{../src/task rc:denotate.rc rrr 2>&1}; like ($output, qr/one.+\d{1,2}\/\d{1,2}\/\d{4} Bert/ms, 'Delete partial match - Bert'); like ($output, qr/Bert.+\d{1,2}\/\d{1,2}\/\d{4} Kermit the frog/ms, 'Delete partial match - Kermit the frog'); # 25 unlike ($output, qr/frog.+\d{1,2}\/\d{1,2}\/\d{4} Kermit and Miss Piggy/ms, 'Delete partial match - Kermit and Miss Piggy'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key denotate.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'denotate.rc', 'Cleanup'); exit 0; task-2.2.0-test/dependencies.t000075500000000000000000000272601213035135600162540ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 49; # Create the rc file. if (open my $fh, '>', 'dep.rc') { print $fh "data.location=.\n"; print $fh "dependency.confirmation=yes\n"; print $fh "report.depreport.columns=id,depends,description\n"; print $fh "report.depreport.labels=ID,Depends,Description\n"; print $fh "report.depreport.filter=status:pending\n"; print $fh "report.depreport.sort=depends+\n"; close $fh; # [1] ok (-r 'dep.rc', 'Created dep.rc'); } qx{../src/task rc:dep.rc add One 2>&1}; qx{../src/task rc:dep.rc add Two 2>&1}; # [2] my $output = qx{../src/task rc:dep.rc 1 modify dep:-2 2>&1 >/dev/null}; like ($output, qr/Could not delete a dependency on task 2 - not found\./, 'dependencies - remove nonexistent dependency'); # [3] $output = qx{../src/task rc:dep.rc 1 modify dep:99 2>&1 >/dev/null}; like ($output, qr/Could not create a dependency on task 99 - not found\./, 'dependencies - add dependency for nonexistent task'); # [4] $output = qx{../src/task rc:dep.rc 99 modify dep:1 2>&1 >/dev/null}; like ($output, qr/No tasks specified\./, 'dependencies - add dependency to nonexistent task'); # [5,6] t 1 dep:2; t info 1 => blocked by 2 $output = qx{../src/task rc:dep.rc 1 modify dep:2 2>&1; ../src/task rc:dep.rc info 1 2>&1}; like ($output, qr/This task blocked by\s+2 Two\nUUID/, 'dependencies - trivial blocked'); unlike ($output, qr/This task is blocking\n/, 'dependencies - trivial blocked'); # [7,8] t info 2 => blocking 1 $output = qx{../src/task rc:dep.rc info 2 2>&1}; unlike ($output, qr/This task blocked by/, 'dependencies - trivial blocking'); like ($output, qr/This task is blocking\s+1 One\nUUID/, 'dependencies - trivial blocking'); # [9] t 1 dep:2 (again) $output = qx{../src/task rc:dep.rc 1 modify dep:2 2>&1 >/dev/null}; like ($output, qr/Task 1 already depends on task 2\./, 'dependencies - add already existing dependency'); # [10,11] t 1 dep:1 => error $output = qx{../src/task rc:dep.rc 1 modify dep:1 2>&1}; like ($output, qr/A task cannot be dependent on itself\./, 'dependencies - cannot depend on self'); unlike ($output, qr/Modified 1 task\./, 'dependencies - cannot depend on self'); # [12,13] t 1 dep:2; t 2 dep:1 => error $output = qx{../src/task rc:dep.rc 2 modify dep:1 2>&1}; like ($output, qr/Circular dependency detected and disallowed\./, 'dependencies - trivial circular'); unlike ($output, qr/Modified 1 task\./, 'dependencies - trivial circular'); # [14,15] t 1 dep:2; t 2 dep:3; t 1 dep:3 => not circular qx{../src/task rc:dep.rc 1 modify dep:2 2>&1}; qx{../src/task rc:dep.rc add Three 2>&1}; qx{../src/task rc:dep.rc 2 modify dep:3 2>&1}; $output = qx{../src/task rc:dep.rc 1 modify dep:3 2>&1}; unlike ($output, qr/Circular dependency detected and disallowed\./, 'dependencies - diamond, non-circular'); like ($output, qr/Modified 1 task\./, 'dependencies - diamond, non-circular'); # [16] unlink 'pending.data'; ok (!-r 'pending.data', 'Removed pending.data for a fresh start'); qx{../src/task rc:dep.rc add One 2>&1}; qx{../src/task rc:dep.rc add Two 2>&1}; qx{../src/task rc:dep.rc add Three 2>&1}; qx{../src/task rc:dep.rc add Four 2>&1}; qx{../src/task rc:dep.rc add Five 2>&1}; qx{../src/task rc:dep.rc 5 modify dep:4 2>&1; ../src/task rc:dep.rc 4 modify dep:3 2>&1; ../src/task rc:dep.rc 3 modify dep:2 2>&1; ../src/task rc:dep.rc 2 modify dep:1 2>&1}; # [17,18] 5 dep 4 dep 3 dep 2 dep 1 dep 5 => error $output = qx{../src/task rc:dep.rc 1 modify dep:5 2>&1 >/dev/null}; like ($output, qr/Circular dependency detected and disallowed\./, 'dependencies - nontrivial circular'); unlike ($output, qr/Modified 1 task\./, 'dependencies - nontrivial circular'); # [19] unlink 'pending.data'; ok (!-r 'pending.data', 'Removed pending.data for a fresh start'); qx{../src/task rc:dep.rc add One 2>&1}; qx{../src/task rc:dep.rc add Two 2>&1}; qx{../src/task rc:dep.rc add Three 2>&1}; qx{../src/task rc:dep.rc add Four 2>&1}; qx{../src/task rc:dep.rc add Five 2>&1}; qx{../src/task rc:dep.rc add Six recurring due:tomorrow recur:daily 2>&1}; # [20] qx{../src/task rc:dep.rc ls 2>&1}; # To force handleRecurrence call. $output = qx{echo 'y' | ../src/task rc:dep.rc 6 modify dep:5 2>&1}; like ($output, qr/Modified \d+ task/, 'dependencies - recurring task depending on another task'); # [21] $output = qx{../src/task rc:dep.rc 4 modify dep:5 2>&1}; like ($output, qr/Modified \d+ task/, 'dependencies - task depending on recurring task'); # [22] t 1 dep:2,3,4; t 1 dep:-2,-4,5; t info 1 => blocked by 3,5 $output = qx{../src/task rc:dep.rc 1 modify dep:2,3,4 2>&1; ../src/task rc:dep.rc 1 modify dep:-2,-4,5 2>&1; ../src/task rc:dep.rc info 1 2>&1}; like ($output, qr/This task blocked by\s+3 Three\n\s+5 Five\nUUID/, 'dependencies - multiple dependencies modified'); # [23,24] $output = qx{../src/task rc:dep.rc 3,5 do 2>&1; ../src/task rc:dep.rc info 1 2>&1}; unlike ($output, qr/This task blocked by/, 'dependencies - task info reflects completed dependencies'); unlike ($output, qr/This task is blocking/, 'dependencies - task info reflects completed dependencies'); # [25] $output = qx{../src/task rc:dep.rc depreport 2>&1}; like ($output, qr/\s1\s+One\s+/, 'dependencies - depends report column reflects completed dependencies'); # [26] unlink 'pending.data'; ok (!-r 'pending.data', 'Removed pending.data for a fresh start'); qx{../src/task rc:dep.rc add One 2>&1}; qx{../src/task rc:dep.rc add Two 2>&1}; qx{../src/task rc:dep.rc add Three 2>&1}; qx{../src/task rc:dep.rc add Four 2>&1}; qx{../src/task rc:dep.rc 1 modify dep:3,4 2>&1}; qx{../src/task rc:dep.rc 2 do 2>&1}; # [27] $output = qx{../src/task rc:dep.rc depreport 2>&1}; like ($output, qr/\s1\s+2 3\s+One\s+/, 'dependencies - depends report column reflects changed IDs'); # [28] qx{../src/task rc:dep.rc 3 do 2>&1}; $output = qx{../src/task rc:dep.rc depreport 2>&1}; like ($output, qr/\s1\s+2\s+One\s+/, 'dependencies - depends report column reflects completed dependencies'); # [29] unlink 'pending.data'; ok (!-r 'pending.data', 'Removed pending.data for a fresh start'); qx{../src/task rc:dep.rc add One 2>&1}; qx{../src/task rc:dep.rc add Two 2>&1}; qx{../src/task rc:dep.rc add Three 2>&1}; qx{../src/task rc:dep.rc add Four 2>&1}; qx{../src/task rc:dep.rc 2 modify dep:1 2>&1; ../src/task rc:dep.rc 3 modify dep:2 2>&1; ../src/task rc:dep.rc 4 modify dep:3 2>&1}; # [30,31] $output = qx{echo 'y' | ../src/task rc:dep.rc 2 do 2>&1}; like ($output, qr/fixed/, 'dependencies - user prompted to fix broken chain after completing a blocked task'); like ($output, qr/is blocked by/, 'dependencies - user nagged for completing a blocked task'); # [32] $output = qx{echo 'y' | ../src/task rc:dep.rc 1 do 2>&1}; unlike ($output, qr/fixed/, 'dependencies - user not prompted to fix broken chain when the head of the chain is marked as complete'); # [33] $output = qx{echo 'y' | ../src/task rc:dep.rc 4 del 2>&1}; unlike ($output, qr/fixed/, 'dependencies - user not prompted to fix broken chain when the tail of the chain is deleted'); # [34] unlink 'pending.data'; ok (!-r 'pending.data', 'Removed pending.data for a fresh start'); qx{../src/task rc:dep.rc add One 2>&1}; qx{../src/task rc:dep.rc add Two 2>&1}; qx{../src/task rc:dep.rc add Three 2>&1}; qx{../src/task rc:dep.rc add Four 2>&1}; qx{../src/task rc:dep.rc add Five 2>&1}; qx{../src/task rc:dep.rc 2 modify dep:1 2>&1}; qx{../src/task rc:dep.rc 3 modify dep:2 2>&1}; qx{../src/task rc:dep.rc 4 modify dep:3 2>&1}; qx{../src/task rc:dep.rc 5 modify dep:4 2>&1}; # [35] qx{echo 'y' | ../src/task rc:dep.rc 2 do 2>&1}; $output = qx{../src/task rc:dep.rc depreport 2>&1}; like ($output, qr/\s1\s+One\s*\n\s2\s+1\s+Three\s*\n\s3\s+2\s+Four\s*\n\s4\s+3\s+Five/, 'dependencies - fixed chain after completing a blocked task'); # [36] qx{echo "Y\nY\n" | ../src/task rc:dep.rc 2 del 2>&1}; $output = qx{../src/task rc:dep.rc depreport 2>&1}; like ($output, qr/\s1\s+One\s*\n\s2\s+1\s+Four\s*\n\s3\s+2\s+Five/, 'dependencies - fixed chain after deleting a blocked task'); # [37] qx{../src/task rc:dep.rc 2 modify dep:-1 2>&1}; $output = qx{../src/task rc:dep.rc depreport 2>&1}; like ($output, qr/\s1\s+One\s*\n\s2\s+Four\s*\n\s3\s+2\s+Five/, 'dependencies - chain should not be automatically repaired after manually removing a dependency'); # [38] unlink 'pending.data'; ok (!-r 'pending.data', 'Removed pending.data for a fresh start'); # Bug when adding a range of dependencies - 'task 3 mod dep:1-2' interprets the # range 1-2 as the id 1 qx{../src/task rc:dep.rc add test1 2>&1}; qx{../src/task rc:dep.rc add test2 2>&1}; qx{../src/task rc:dep.rc add test3 2>&1}; qx{../src/task rc:dep.rc add test4 2>&1}; qx{../src/task rc:dep.rc add test5 2>&1}; $output = qx{../src/task rc:dep.rc 5 info 2>&1}; my ($uuid) = $output =~ /UUID\s+(\S+)/; # [39-43] test a comma-separated list of IDs, UUIDs, and ID ranges for creation qx{../src/task rc:dep.rc add test6 dep:1-3,4,$uuid 2>&1}; $output = qx{../src/task rc:dep.rc 6 info 2>&1}; like ($output, qr/test1/ms, 'Dependency appearing for task1'); like ($output, qr/test2/ms, 'Dependency appearing for task2'); like ($output, qr/test3/ms, 'Dependency appearing for task3'); like ($output, qr/test4/ms, 'Dependency appearing for task4'); like ($output, qr/test5/ms, 'Dependency appearing for task5'); # [44-48] test a comma-separated list of IDs, UUIDs, and ID ranges for deletion qx{../src/task rc:dep.rc 6 mod dep:-1-3,-4,-$uuid 2>&1}; $output = qx{../src/task rc:dep.rc 6 info 2>&1}; unlike ($output, qr/test1/ms, 'Dependency not appearing for task1'); unlike ($output, qr/test2/ms, 'Dependency not appearing for task2'); unlike ($output, qr/test3/ms, 'Dependency not appearing for task3'); unlike ($output, qr/test4/ms, 'Dependency not appearing for task4'); unlike ($output, qr/test5/ms, 'Dependency not appearing for task5'); # TODO - test dependency.confirmation config variable # TODO - test undo on backing out chain gap repair # TODO - test undo on backing out choice to not perform chain gap repair # TODO - test blocked task completion nag # TODO - test depend.any and depend.none report filters # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key dep.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'dep.rc', 'Cleanup'); exit 0; task-2.2.0-test/directory.t.cpp000064400000000000000000000123041213035135600164010ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include Context context; int main (int argc, char** argv) { UnitTest t (35); // Directory (const File&); // Directory (const Path&); Directory d0 (Path ("/tmp")); Directory d1 (File ("/tmp")); Directory d2 (File (Path ("/tmp"))); t.is (d0._data, d1._data, "Directory(std::string) == Directory (File&)"); t.is (d0._data, d2._data, "Directory(std::string) == Directory (File (Path &))"); t.is (d1._data, d2._data, "Directory(File&)) == Directory (File (Path &))"); // Directory (const Directory&); Directory d3 (d2); t.is (d3._data, "/tmp", "Directory (Directory&)"); // Directory (const std::string&); Directory d4 ("/tmp/test_directory"); // Directory& operator= (const Directory&); Directory d5 = d4; t.is (d5._data, "/tmp/test_directory", "Directory::operator="); // operator (std::string) const; t.is ((std::string) d3, "/tmp", "Directory::operator (std::string) const"); // virtual bool create (); t.ok (d5.create (), "Directory::create /tmp/test_directory"); t.ok (d5.exists (), "Directory::exists /tmp/test_directory"); Directory d6 (d5._data + "/dir"); t.ok (d6.create (), "Directory::create /tmp/test_directory/dir"); File::create (d5._data + "/f0"); File::create (d6._data + "/f1"); // std::vector list (); std::vector files = d5.list (); std::sort (files.begin (), files.end ()); t.is ((int)files.size (), 2, "Directory::list 1 file"); t.is (files[0], "/tmp/test_directory/dir", "file[0] is /tmp/test_directory/dir"); t.is (files[1], "/tmp/test_directory/f0", "file[1] is /tmp/test_directory/f0"); // std::vector listRecursive (); files = d5.listRecursive (); std::sort (files.begin (), files.end ()); t.is ((int)files.size (), 2, "Directory::list 1 file"); t.is (files[0], "/tmp/test_directory/dir/f1", "file is /tmp/test_directory/dir/f1"); t.is (files[1], "/tmp/test_directory/f0", "file is /tmp/test_directory/f0"); // virtual bool remove (); t.ok (File::remove (d5._data + "/f0"), "File::remove /tmp/test_directory/f0"); t.ok (File::remove (d6._data + "/f1"), "File::remove /tmp/test_directory/dir/f1"); t.ok (d6.remove (), "Directory::remove /tmp/test_directory/dir"); t.notok (d6.exists (), "Directory::exists /tmp/test_directory/dir - no"); t.ok (d5.remove (), "Directory::remove /tmp/test_directory"); t.notok (d5.exists (), "Directory::exists /tmp/test_directory - no"); // bool remove (const std::string&); Directory d7 ("/tmp/to_be_removed"); t.ok (d7.create (), "Directory::create /tmp/to_be_removed"); File::create (d7._data + "/f0"); Directory d8 (d7._data + "/another"); t.ok (d8.create (), "Directory::create /tmp/to_be_removed/another"); File::create (d8._data + "/f1"); t.ok (d7.remove (), "Directory::remove /tmp/to_be_removed"); t.notok (d7.exists (), "Directory /tmp/to_be_removed gone"); // static std::string cwd (); std::string cwd = Directory::cwd (); t.ok (cwd.length () > 0, "Directory::cwd returned a value"); // bool parent (std::string&) const; Directory d9 ("/one/two/three/four.txt"); t.ok (d9.up (), "parent /one/two/three/four.txt --> true"); t.is (d9._data, "/one/two/three", "parent /one/two/three/four.txt --> /one/two/three"); t.ok (d9.up (), "parent /one/two/three --> true"); t.is (d9._data, "/one/two", "parent /one/two/three --> /one/two"); t.ok (d9.up (), "parent /one/two --> true"); t.is (d9._data, "/one", "parent /one/two --> /one"); t.ok (d9.up (), "parent /one --> true"); t.is (d9._data, "/", "parent /one --> /"); t.notok (d9.up (), "parent / --> false"); return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/dom.2.t000075500000000000000000000046561213035135600145510ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'dom.rc') { print $fh "data.location=.\n", "dateformat=YMD\n", "dateformat.info=YMD\n"; close $fh; ok (-r 'dom.rc', 'Created dom.rc'); } # DOM reference to other task. qx{../src/task rc:dom.rc add one due:20110901 2>&1}; qx{../src/task rc:dom.rc add two due:1.due 2>&1}; my $output = qx{../src/task rc:dom.rc 2 info 2>&1}; like ($output, qr/Due\s+20110901/, 'Found due date duplicated via dom'); # DOM reference to the current task. qx{../src/task rc:dom.rc add three due:20110901 wait:due 2>&1}; $output = qx{../src/task rc:dom.rc 3 info 2>&1}; like ($output, qr/Waiting until\s+20110901/, 'Found wait date duplicated from due date'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key dom.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'dom.rc', 'Cleanup'); exit 0; task-2.2.0-test/dom.t.cpp000064400000000000000000000050111213035135600151510ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { UnitTest t (6); try { // Prime the pump. context.a3.capture ("task"); // TODO dom.get rc.name DOM dom; t.is (dom.get ("system.version"), VERSION, "DOM system.version -> VERSION"); t.ok (dom.get ("system.os") != "", "DOM system.os -> != Unknown"); t.is (dom.get ("context.program"), "task", "DOM context.program -> 'task'"); t.is (dom.get ("context.args"), "task", "DOM context.args -> 'task'"); t.is (dom.get ("context.width"), "0", "DOM context.width -> '0'"); t.is (dom.get ("context.height"), "0", "DOM context.height -> '0'"); // TODO dom.set rc.name } catch (const std::string& error) { t.diag (error); return -1; } catch (...) { t.diag ("Unknown error."); return -2; } return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/due.t000075500000000000000000000055661213035135600144100ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'due.rc') { print $fh "data.location=.\n", "due=4\n", "color=on\n", "color.due=red\n", "color.alternate=\n", "_forcecolor=on\n", "dateformat=m/d/Y\n"; close $fh; ok (-r 'due.rc', 'Created due.rc'); } # Add a task that is almost due, and one that is just due. my ($d, $m, $y) = (localtime (time + 3 * 86_400))[3..5]; my $just = sprintf ("%d/%d/%d", $m + 1, $d, $y + 1900); ($d, $m, $y) = (localtime (time + 5 * 86_400))[3..5]; my $almost = sprintf ("%d/%d/%d", $m + 1, $d, $y + 1900); qx{../src/task rc:due.rc add one due:$just 2>&1}; qx{../src/task rc:due.rc add two due:$almost 2>&1}; my $output = qx{../src/task rc:due.rc list 2>&1}; like ($output, qr/\[31m.+$just.+\[0m/, 'one marked due'); like ($output, qr/\s+$almost\s+/, 'two not marked due'); qx{../src/task rc:due.rc add three due:today 2>&1}; $output = qx{../src/task rc:due.rc list due:today 2>&1}; like ($output, qr/three/, 'due:today works as a filter'); $output = qx{../src/task rc:due.rc list due.is:today 2>&1}; like ($output, qr/three/, 'due.is:today works as a filter'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key due.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'due.rc', 'Cleanup'); exit 0; task-2.2.0-test/duplicate.t000075500000000000000000000060021213035135600155670ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 12; # Create the rc file. if (open my $fh, '>', 'dup.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'dup.rc', 'Created dup.rc'); } # Test the duplicate command. qx{../src/task rc:dup.rc add foo 2>&1}; qx{../src/task rc:dup.rc 1 duplicate 2>&1}; my $output = qx{../src/task rc:dup.rc info 2 2>&1}; like ($output, qr/ID\s+2/, 'duplicate new id'); like ($output, qr/Status\s+Pending/, 'duplicate same status'); like ($output, qr/Description\s+foo/, 'duplicate same description'); # Test the en passant modification while duplicating. qx{../src/task rc:dup.rc 1 duplicate priority:H /foo/FOO/ +tag 2>&1}; $output = qx{../src/task rc:dup.rc info 3 2>&1}; like ($output, qr/ID\s+3/, 'duplicate new id'); like ($output, qr/Status\s+Pending/, 'duplicate same status'); like ($output, qr/Description\s+FOO/, 'duplicate modified description'); like ($output, qr/Priority\s+H/, 'duplicate added priority'); like ($output, qr/Tags\s+tag/, 'duplicate added tag'); # Test the output of the duplicate command - returning id of duplicated task $output = qx{../src/task rc:dup.rc 1 duplicate 2>&1}; like ($output, qr/Duplicated\stask\s1\s'foo'/, 'duplicate output task id and description'); like ($output, qr/Created\s+task\s+4/, 'duplicate output of new task id'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key dup.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'dup.rc', 'Cleanup'); exit 0; task-2.2.0-test/duplicate2.t000075500000000000000000000070031213035135600156530ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 14; # Create the rc file. if (open my $fh, '>', 'dup.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'dup.rc', 'Created dup.rc'); } # Add a recurring task. Duplicate both parent and child. qx{../src/task rc:dup.rc add R due:tomorrow recur:weekly 2>&1}; qx{../src/task rc:dup.rc list 2>&1}; # To force handleRecurrence. my $output = qx{../src/task rc:dup.rc 1 info 2>&1}; like ($output, qr/Status\s+Recurring/, 'Found parent'); $output = qx{../src/task rc:dup.rc 2 info 2>&1}; like ($output, qr/Status\s+Pending/, 'Found child'); $output = qx{../src/task rc:dup.rc 1 duplicate 2>&1}; like ($output, qr/The duplicated task is too/, 'Duplicated parent is also a parent'); $output = qx{../src/task rc:dup.rc 2 duplicate 2>&1}; like ($output, qr/The duplicated task is not/, 'Duplicated child is also a plain task'); qx{../src/task rc:dup.rc list 2>&1}; # To force handleRecurrence. $output = qx{../src/task rc:dup.rc 1 info 2>&1}; like ($output, qr/Status\s+Recurring/, 'Found original parent task'); $output = qx{../src/task rc:dup.rc 2 info 2>&1}; like ($output, qr/Status\s+Pending/, 'Found original child task - pending'); like ($output, qr/Parent/, 'Found original child task - with parent'); $output = qx{../src/task rc:dup.rc 3 info 2>&1}; like ($output, qr/Status\s+Recurring/, 'Found duplicated parent task'); $output = qx{../src/task rc:dup.rc 4 info 2>&1}; like ($output, qr/Status\s+Pending/, 'Found duplicated plain task'); unlike ($output, qr/Parent/, 'Found duplicated child task - no parent'); $output = qx{../src/task rc:dup.rc 5 info 2>&1}; like ($output, qr/Status\s+Pending/, 'Found duplicated child task'); like ($output, qr/Parent/, 'Found duplicated child task - with parent'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key dup.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'dup.rc', 'Cleanup'); exit 0; task-2.2.0-test/duration.t.cpp000064400000000000000000001477431213035135600162420ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include Context context; //////////////////////////////////////////////////////////////////////////////// // daily, day, Nd // weekly, 1w, sennight, biweekly, fortnight // monthly, bimonthly, Nm, semimonthly // 1st 2nd 3rd 4th .. 31st // quarterly, 1q // biannual, biyearly, annual, semiannual, yearly, 1y int convertDuration (const std::string& input) { try { Duration d (input); return ((int) d) / 86400; } catch (...) {} return 0; } int main (int argc, char** argv) { UnitTest t (644); Duration d; // std::string format (); d = Duration (0); t.is (d.format (), "-", "0 -> -"); d = Duration (1); t.is (d.format (), "1 sec", "1 -> 1 sec"); d = Duration (2); t.is (d.format (), "2 secs", "2 -> 2 secs"); d = Duration (59); t.is (d.format (), "59 secs", "59 -> 59 secs"); d = Duration (60); t.is (d.format (), "1 min", "60 -> 1 min"); d = Duration (119); t.is (d.format (), "1 min", "119 -> 1 min"); d = Duration (120); t.is (d.format (), "2 mins", "120 -> 2 mins"); d = Duration (121); t.is (d.format (), "2 mins", "121 -> 2 mins"); d = Duration (3599); t.is (d.format (), "59 mins", "3599 -> 59 mins"); d = Duration (3600); t.is (d.format (), "1 hr", "3600 -> 1 hr"); d = Duration (3601); t.is (d.format (), "1 hr", "3601 -> 1 hr"); d = Duration (86399); t.is (d.format (), "23 hrs", "86399 -> 23 hrs"); d = Duration (86400); t.is (d.format (), "1 day", "86400 -> 1 day"); d = Duration (86401); t.is (d.format (), "1 day", "86401 -> 1 day"); d = Duration (14 * 86400 - 1); t.is (d.format (), "1 wk", "14 days - 1 sec -> 1 wk"); d = Duration (14 * 86400); t.is (d.format (), "2 wks", "14 days -> 2 wks"); d = Duration (14 * 86400 + 1); t.is (d.format (), "2 wks", "14 days + 1 sec -> 2 wks"); d = Duration (85 * 86400 - 1); t.is (d.format (), "2 mths", "85 days - 1 sec -> 2 mths"); d = Duration (85 * 86400); t.is (d.format (), "2 mths", "85 days -> 2 mths"); d = Duration (85 * 86400 + 1); t.is (d.format (), "2 mths", "85 days + 1 sec -> 2 mths"); d = Duration (365 * 86400 - 1); t.is (d.format (), "12 mths", "365 days - 1 sec -> 12 mths"); d = Duration (365 * 86400); t.is (d.format (), "1.0 yrs", "365 days -> 1.0 yrs"); d = Duration (365 * 86400 + 1); t.is (d.format (), "1.0 yrs", "365 days + 1 sec -> 1.0 yrs"); // std::string formatCompact (); d = Duration (0), t.is (d.formatCompact (), "", "0 ->"); d = Duration (1), t.is (d.formatCompact (), "1s", "1 -> 1s"); d = Duration (2), t.is (d.formatCompact (), "2s", "2 -> 2s"); d = Duration (59), t.is (d.formatCompact (), "59s", "59 -> 59s"); d = Duration (60), t.is (d.formatCompact (), "1m", "60 -> 1m"); d = Duration (119), t.is (d.formatCompact (), "1m", "119 -> 1m"); d = Duration (120), t.is (d.formatCompact (), "2m", "120 -> 2m"); d = Duration (121), t.is (d.formatCompact (), "2m", "121 -> 2m"); d = Duration (3599), t.is (d.formatCompact (), "59m", "3599 -> 59m"); d = Duration (3600), t.is (d.formatCompact (), "1h", "3600 -> 1h"); d = Duration (3601), t.is (d.formatCompact (), "1h", "3601 -> 1h"); d = Duration (86399), t.is (d.formatCompact (), "23h", "86399 -> 23h"); d = Duration (86400), t.is (d.formatCompact (), "1d", "86400 -> 1d"); d = Duration (86401), t.is (d.formatCompact (), "1d", "86401 -> 1d"); d = Duration (14 * 86400 - 1), t.is (d.formatCompact (), "1wk", "14 days - 1 sec -> 1wk"); d = Duration (14 * 86400), t.is (d.formatCompact (), "2wk", "14 days -> 2wk"); d = Duration (14 * 86400 + 1), t.is (d.formatCompact (), "2wk", "14 days + 1 sec -> 2wk"); d = Duration (85 * 86400 - 1), t.is (d.formatCompact (), "2mo", "85 days - 1 sec -> 2mo"); d = Duration (85 * 86400), t.is (d.formatCompact (), "2mo", "85 days -> 2mo"); d = Duration (85 * 86400 + 1), t.is (d.formatCompact (), "2mo", "85 days + 1 sec -> 2mo"); d = Duration (365 * 86400 - 1), t.is (d.formatCompact (), "12mo", "365 days - 1 sec -> 12mo"); d = Duration (365 * 86400), t.is (d.formatCompact (), "1.0y", "365 days -> 1.0y"); d = Duration (365 * 86400 + 1), t.is (d.formatCompact (), "1.0y", "365 days + 1 sec -> 1.0y"); // std::string formatPrecise (); d = Duration (0), t.is (d.formatPrecise (), "0:00:00", "0 -> 0:00:00"); d = Duration (1), t.is (d.formatPrecise (), "0:00:01", "1 -> 0:00:01"); d = Duration (2), t.is (d.formatPrecise (), "0:00:02", "2 -> 0:00:02"); d = Duration (59), t.is (d.formatPrecise (), "0:00:59", "59 -> 0:00:59"); d = Duration (60), t.is (d.formatPrecise (), "0:01:00", "60 -> 0:01;00"); d = Duration (119), t.is (d.formatPrecise (), "0:01:59", "119 -> 0:01:59"); d = Duration (120), t.is (d.formatPrecise (), "0:02:00", "120 -> 0:02:00"); d = Duration (121), t.is (d.formatPrecise (), "0:02:01", "121 -> 0:02:01"); d = Duration (3599), t.is (d.formatPrecise (), "0:59:59", "3599 -> 0:59:59"); d = Duration (3600), t.is (d.formatPrecise (), "1:00:00", "3600 -> 1:00:00"); d = Duration (3601), t.is (d.formatPrecise (), "1:00:01", "3601 -> 1:00:01"); d = Duration (86399), t.is (d.formatPrecise (), "23:59:59", "86399 -> 23:59:59"); d = Duration (86400), t.is (d.formatPrecise (), "1d 0:00:00", "86400 -> 1d 0:00:00"); d = Duration (86401), t.is (d.formatPrecise (), "1d 0:00:01", "86401 -> 1d 0:00:01"); d = Duration (14 * 86400 - 1), t.is (d.formatPrecise (), "13d 23:59:59", "(14 * 86400) - 1 sec -> 13d 23:59:59"); d = Duration (14 * 86400), t.is (d.formatPrecise (), "14d 0:00:00", "(14 * 86400) -> 14d 0:00:00"); d = Duration (14 * 86400 + 1), t.is (d.formatPrecise (), "14d 0:00:01", "(14 * 86400) + 1 -> 14d 0:00:01"); d = Duration (365 * 86400 - 1), t.is (d.formatPrecise (), "364d 23:59:59", "365 days - 1 sec -> 364d 23:59:59"); d = Duration (365 * 86400), t.is (d.formatPrecise (), "365d 0:00:00", "365 days -> 365d 0:00:00"); d = Duration (365 * 86400 + 1), t.is (d.formatPrecise (), "365d 0:00:01", "365 days + 1 sec -> 365d 0:00:01"); // Iterate for a whole year. Why? Just to see where the boundaries are, // so that changes can be made with some reference point. d = Duration ( 1*86400), t.is (d.formatCompact (), "1d", "1*86400 -> 1d"); d = Duration ( 2*86400), t.is (d.formatCompact (), "2d", "2*86400 -> 2d"); d = Duration ( 3*86400), t.is (d.formatCompact (), "3d", "3*86400 -> 3d"); d = Duration ( 4*86400), t.is (d.formatCompact (), "4d", "4*86400 -> 4d"); d = Duration ( 5*86400), t.is (d.formatCompact (), "5d", "5*86400 -> 5d"); d = Duration ( 6*86400), t.is (d.formatCompact (), "6d", "6*86400 -> 6d"); d = Duration ( 7*86400), t.is (d.formatCompact (), "7d", "7*86400 -> 7d"); d = Duration ( 8*86400), t.is (d.formatCompact (), "8d", "8*86400 -> 8d"); d = Duration ( 9*86400), t.is (d.formatCompact (), "9d", "9*86400 -> 9d"); d = Duration ( 10*86400), t.is (d.formatCompact (), "10d", "10*86400 -> 10d"); d = Duration ( 11*86400), t.is (d.formatCompact (), "11d", "11*86400 -> 11d"); d = Duration ( 12*86400), t.is (d.formatCompact (), "12d", "12*86400 -> 12d"); d = Duration ( 13*86400), t.is (d.formatCompact (), "1wk", "13*86400 -> 1wk"); d = Duration ( 14*86400), t.is (d.formatCompact (), "2wk", "14*86400 -> 2wk"); d = Duration ( 15*86400), t.is (d.formatCompact (), "2wk", "15*86400 -> 2wk"); d = Duration ( 16*86400), t.is (d.formatCompact (), "2wk", "16*86400 -> 2wk"); d = Duration ( 17*86400), t.is (d.formatCompact (), "2wk", "17*86400 -> 2wk"); d = Duration ( 18*86400), t.is (d.formatCompact (), "2wk", "18*86400 -> 2wk"); d = Duration ( 19*86400), t.is (d.formatCompact (), "2wk", "19*86400 -> 2wk"); d = Duration ( 20*86400), t.is (d.formatCompact (), "2wk", "20*86400 -> 2wk"); d = Duration ( 21*86400), t.is (d.formatCompact (), "3wk", "21*86400 -> 3wk"); d = Duration ( 22*86400), t.is (d.formatCompact (), "3wk", "22*86400 -> 3wk"); d = Duration ( 23*86400), t.is (d.formatCompact (), "3wk", "23*86400 -> 3wk"); d = Duration ( 24*86400), t.is (d.formatCompact (), "3wk", "24*86400 -> 3wk"); d = Duration ( 25*86400), t.is (d.formatCompact (), "3wk", "25*86400 -> 3wk"); d = Duration ( 26*86400), t.is (d.formatCompact (), "3wk", "26*86400 -> 3wk"); d = Duration ( 27*86400), t.is (d.formatCompact (), "3wk", "27*86400 -> 3wk"); d = Duration ( 28*86400), t.is (d.formatCompact (), "4wk", "28*86400 -> 4wk"); d = Duration ( 29*86400), t.is (d.formatCompact (), "4wk", "29*86400 -> 4wk"); d = Duration ( 30*86400), t.is (d.formatCompact (), "4wk", "30*86400 -> 4wk"); d = Duration ( 31*86400), t.is (d.formatCompact (), "4wk", "31*86400 -> 4wk"); d = Duration ( 32*86400), t.is (d.formatCompact (), "4wk", "32*86400 -> 4wk"); d = Duration ( 33*86400), t.is (d.formatCompact (), "4wk", "33*86400 -> 4wk"); d = Duration ( 34*86400), t.is (d.formatCompact (), "4wk", "34*86400 -> 4wk"); d = Duration ( 35*86400), t.is (d.formatCompact (), "5wk", "35*86400 -> 5wk"); d = Duration ( 36*86400), t.is (d.formatCompact (), "5wk", "36*86400 -> 5wk"); d = Duration ( 37*86400), t.is (d.formatCompact (), "5wk", "37*86400 -> 5wk"); d = Duration ( 38*86400), t.is (d.formatCompact (), "5wk", "38*86400 -> 5wk"); d = Duration ( 39*86400), t.is (d.formatCompact (), "5wk", "39*86400 -> 5wk"); d = Duration ( 40*86400), t.is (d.formatCompact (), "5wk", "40*86400 -> 5wk"); d = Duration ( 41*86400), t.is (d.formatCompact (), "5wk", "41*86400 -> 5wk"); d = Duration ( 42*86400), t.is (d.formatCompact (), "6wk", "42*86400 -> 6wk"); d = Duration ( 43*86400), t.is (d.formatCompact (), "6wk", "43*86400 -> 6wk"); d = Duration ( 44*86400), t.is (d.formatCompact (), "6wk", "44*86400 -> 6wk"); d = Duration ( 45*86400), t.is (d.formatCompact (), "6wk", "45*86400 -> 6wk"); d = Duration ( 46*86400), t.is (d.formatCompact (), "6wk", "46*86400 -> 6wk"); d = Duration ( 47*86400), t.is (d.formatCompact (), "6wk", "47*86400 -> 6wk"); d = Duration ( 48*86400), t.is (d.formatCompact (), "6wk", "48*86400 -> 6wk"); d = Duration ( 49*86400), t.is (d.formatCompact (), "7wk", "49*86400 -> 7wk"); d = Duration ( 50*86400), t.is (d.formatCompact (), "7wk", "50*86400 -> 7wk"); d = Duration ( 51*86400), t.is (d.formatCompact (), "7wk", "51*86400 -> 7wk"); d = Duration ( 52*86400), t.is (d.formatCompact (), "7wk", "52*86400 -> 7wk"); d = Duration ( 53*86400), t.is (d.formatCompact (), "7wk", "53*86400 -> 7wk"); d = Duration ( 54*86400), t.is (d.formatCompact (), "7wk", "54*86400 -> 7wk"); d = Duration ( 55*86400), t.is (d.formatCompact (), "7wk", "55*86400 -> 7wk"); d = Duration ( 56*86400), t.is (d.formatCompact (), "8wk", "56*86400 -> 8wk"); d = Duration ( 57*86400), t.is (d.formatCompact (), "8wk", "57*86400 -> 8wk"); d = Duration ( 58*86400), t.is (d.formatCompact (), "8wk", "58*86400 -> 8wk"); d = Duration ( 59*86400), t.is (d.formatCompact (), "8wk", "59*86400 -> 8wk"); d = Duration ( 60*86400), t.is (d.formatCompact (), "8wk", "60*86400 -> 8wk"); d = Duration ( 61*86400), t.is (d.formatCompact (), "8wk", "61*86400 -> 8wk"); d = Duration ( 62*86400), t.is (d.formatCompact (), "8wk", "62*86400 -> 8wk"); d = Duration ( 63*86400), t.is (d.formatCompact (), "9wk", "63*86400 -> 9wk"); d = Duration ( 64*86400), t.is (d.formatCompact (), "9wk", "64*86400 -> 9wk"); d = Duration ( 65*86400), t.is (d.formatCompact (), "9wk", "65*86400 -> 9wk"); d = Duration ( 66*86400), t.is (d.formatCompact (), "9wk", "66*86400 -> 9wk"); d = Duration ( 67*86400), t.is (d.formatCompact (), "9wk", "67*86400 -> 9wk"); d = Duration ( 68*86400), t.is (d.formatCompact (), "9wk", "68*86400 -> 9wk"); d = Duration ( 69*86400), t.is (d.formatCompact (), "9wk", "69*86400 -> 9wk"); d = Duration ( 70*86400), t.is (d.formatCompact (), "10wk", "70*86400 -> 10wk"); d = Duration ( 71*86400), t.is (d.formatCompact (), "10wk", "71*86400 -> 10wk"); d = Duration ( 72*86400), t.is (d.formatCompact (), "10wk", "72*86400 -> 10wk"); d = Duration ( 73*86400), t.is (d.formatCompact (), "10wk", "73*86400 -> 10wk"); d = Duration ( 74*86400), t.is (d.formatCompact (), "10wk", "74*86400 -> 10wk"); d = Duration ( 75*86400), t.is (d.formatCompact (), "10wk", "75*86400 -> 10wk"); d = Duration ( 76*86400), t.is (d.formatCompact (), "10wk", "76*86400 -> 10wk"); d = Duration ( 77*86400), t.is (d.formatCompact (), "11wk", "77*86400 -> 11wk"); d = Duration ( 78*86400), t.is (d.formatCompact (), "11wk", "78*86400 -> 11wk"); d = Duration ( 79*86400), t.is (d.formatCompact (), "11wk", "79*86400 -> 11wk"); d = Duration ( 80*86400), t.is (d.formatCompact (), "11wk", "80*86400 -> 11wk"); d = Duration ( 81*86400), t.is (d.formatCompact (), "11wk", "81*86400 -> 11wk"); d = Duration ( 82*86400), t.is (d.formatCompact (), "11wk", "82*86400 -> 11wk"); d = Duration ( 83*86400), t.is (d.formatCompact (), "11wk", "83*86400 -> 11wk"); d = Duration ( 84*86400), t.is (d.formatCompact (), "2mo", "84*86400 -> 2mo"); d = Duration ( 85*86400), t.is (d.formatCompact (), "2mo", "85*86400 -> 2mo"); d = Duration ( 86*86400), t.is (d.formatCompact (), "2mo", "86*86400 -> 2mo"); d = Duration ( 87*86400), t.is (d.formatCompact (), "2mo", "87*86400 -> 2mo"); d = Duration ( 88*86400), t.is (d.formatCompact (), "2mo", "88*86400 -> 2mo"); d = Duration ( 89*86400), t.is (d.formatCompact (), "2mo", "89*86400 -> 2mo"); d = Duration ( 90*86400), t.is (d.formatCompact (), "3mo", "90*86400 -> 3mo"); d = Duration ( 91*86400), t.is (d.formatCompact (), "3mo", "91*86400 -> 3mo"); d = Duration ( 92*86400), t.is (d.formatCompact (), "3mo", "92*86400 -> 3mo"); d = Duration ( 93*86400), t.is (d.formatCompact (), "3mo", "93*86400 -> 3mo"); d = Duration ( 94*86400), t.is (d.formatCompact (), "3mo", "94*86400 -> 3mo"); d = Duration ( 95*86400), t.is (d.formatCompact (), "3mo", "95*86400 -> 3mo"); d = Duration ( 96*86400), t.is (d.formatCompact (), "3mo", "96*86400 -> 3mo"); d = Duration ( 97*86400), t.is (d.formatCompact (), "3mo", "97*86400 -> 3mo"); d = Duration ( 98*86400), t.is (d.formatCompact (), "3mo", "98*86400 -> 3mo"); d = Duration ( 99*86400), t.is (d.formatCompact (), "3mo", "99*86400 -> 3mo"); d = Duration (100*86400), t.is (d.formatCompact (), "3mo", "100*86400 -> 3mo"); d = Duration (101*86400), t.is (d.formatCompact (), "3mo", "101*86400 -> 3mo"); d = Duration (102*86400), t.is (d.formatCompact (), "3mo", "102*86400 -> 3mo"); d = Duration (103*86400), t.is (d.formatCompact (), "3mo", "103*86400 -> 3mo"); d = Duration (104*86400), t.is (d.formatCompact (), "3mo", "104*86400 -> 3mo"); d = Duration (105*86400), t.is (d.formatCompact (), "3mo", "105*86400 -> 3mo"); d = Duration (106*86400), t.is (d.formatCompact (), "3mo", "106*86400 -> 3mo"); d = Duration (107*86400), t.is (d.formatCompact (), "3mo", "107*86400 -> 3mo"); d = Duration (108*86400), t.is (d.formatCompact (), "3mo", "108*86400 -> 3mo"); d = Duration (109*86400), t.is (d.formatCompact (), "3mo", "109*86400 -> 3mo"); d = Duration (110*86400), t.is (d.formatCompact (), "3mo", "110*86400 -> 3mo"); d = Duration (111*86400), t.is (d.formatCompact (), "3mo", "111*86400 -> 3mo"); d = Duration (112*86400), t.is (d.formatCompact (), "3mo", "112*86400 -> 3mo"); d = Duration (113*86400), t.is (d.formatCompact (), "3mo", "113*86400 -> 3mo"); d = Duration (114*86400), t.is (d.formatCompact (), "3mo", "114*86400 -> 3mo"); d = Duration (115*86400), t.is (d.formatCompact (), "3mo", "115*86400 -> 3mo"); d = Duration (116*86400), t.is (d.formatCompact (), "3mo", "116*86400 -> 3mo"); d = Duration (117*86400), t.is (d.formatCompact (), "3mo", "117*86400 -> 3mo"); d = Duration (118*86400), t.is (d.formatCompact (), "3mo", "118*86400 -> 3mo"); d = Duration (119*86400), t.is (d.formatCompact (), "3mo", "119*86400 -> 3mo"); d = Duration (120*86400), t.is (d.formatCompact (), "4mo", "120*86400 -> 4mo"); d = Duration (121*86400), t.is (d.formatCompact (), "4mo", "121*86400 -> 4mo"); d = Duration (122*86400), t.is (d.formatCompact (), "4mo", "122*86400 -> 4mo"); d = Duration (123*86400), t.is (d.formatCompact (), "4mo", "123*86400 -> 4mo"); d = Duration (124*86400), t.is (d.formatCompact (), "4mo", "124*86400 -> 4mo"); d = Duration (125*86400), t.is (d.formatCompact (), "4mo", "125*86400 -> 4mo"); d = Duration (126*86400), t.is (d.formatCompact (), "4mo", "126*86400 -> 4mo"); d = Duration (127*86400), t.is (d.formatCompact (), "4mo", "127*86400 -> 4mo"); d = Duration (128*86400), t.is (d.formatCompact (), "4mo", "128*86400 -> 4mo"); d = Duration (129*86400), t.is (d.formatCompact (), "4mo", "129*86400 -> 4mo"); d = Duration (130*86400), t.is (d.formatCompact (), "4mo", "130*86400 -> 4mo"); d = Duration (131*86400), t.is (d.formatCompact (), "4mo", "131*86400 -> 4mo"); d = Duration (132*86400), t.is (d.formatCompact (), "4mo", "132*86400 -> 4mo"); d = Duration (133*86400), t.is (d.formatCompact (), "4mo", "133*86400 -> 4mo"); d = Duration (134*86400), t.is (d.formatCompact (), "4mo", "134*86400 -> 4mo"); d = Duration (135*86400), t.is (d.formatCompact (), "4mo", "135*86400 -> 4mo"); d = Duration (136*86400), t.is (d.formatCompact (), "4mo", "136*86400 -> 4mo"); d = Duration (137*86400), t.is (d.formatCompact (), "4mo", "137*86400 -> 4mo"); d = Duration (138*86400), t.is (d.formatCompact (), "4mo", "138*86400 -> 4mo"); d = Duration (139*86400), t.is (d.formatCompact (), "4mo", "139*86400 -> 4mo"); d = Duration (140*86400), t.is (d.formatCompact (), "4mo", "140*86400 -> 4mo"); d = Duration (141*86400), t.is (d.formatCompact (), "4mo", "141*86400 -> 4mo"); d = Duration (142*86400), t.is (d.formatCompact (), "4mo", "142*86400 -> 4mo"); d = Duration (143*86400), t.is (d.formatCompact (), "4mo", "143*86400 -> 4mo"); d = Duration (144*86400), t.is (d.formatCompact (), "4mo", "144*86400 -> 4mo"); d = Duration (145*86400), t.is (d.formatCompact (), "4mo", "145*86400 -> 4mo"); d = Duration (146*86400), t.is (d.formatCompact (), "4mo", "146*86400 -> 4mo"); d = Duration (147*86400), t.is (d.formatCompact (), "4mo", "147*86400 -> 4mo"); d = Duration (148*86400), t.is (d.formatCompact (), "4mo", "148*86400 -> 4mo"); d = Duration (149*86400), t.is (d.formatCompact (), "4mo", "149*86400 -> 4mo"); d = Duration (150*86400), t.is (d.formatCompact (), "5mo", "150*86400 -> 5mo"); d = Duration (151*86400), t.is (d.formatCompact (), "5mo", "151*86400 -> 5mo"); d = Duration (152*86400), t.is (d.formatCompact (), "5mo", "152*86400 -> 5mo"); d = Duration (153*86400), t.is (d.formatCompact (), "5mo", "153*86400 -> 5mo"); d = Duration (154*86400), t.is (d.formatCompact (), "5mo", "154*86400 -> 5mo"); d = Duration (155*86400), t.is (d.formatCompact (), "5mo", "155*86400 -> 5mo"); d = Duration (156*86400), t.is (d.formatCompact (), "5mo", "156*86400 -> 5mo"); d = Duration (157*86400), t.is (d.formatCompact (), "5mo", "157*86400 -> 5mo"); d = Duration (158*86400), t.is (d.formatCompact (), "5mo", "158*86400 -> 5mo"); d = Duration (159*86400), t.is (d.formatCompact (), "5mo", "159*86400 -> 5mo"); d = Duration (160*86400), t.is (d.formatCompact (), "5mo", "160*86400 -> 5mo"); d = Duration (161*86400), t.is (d.formatCompact (), "5mo", "161*86400 -> 5mo"); d = Duration (162*86400), t.is (d.formatCompact (), "5mo", "162*86400 -> 5mo"); d = Duration (163*86400), t.is (d.formatCompact (), "5mo", "163*86400 -> 5mo"); d = Duration (164*86400), t.is (d.formatCompact (), "5mo", "164*86400 -> 5mo"); d = Duration (165*86400), t.is (d.formatCompact (), "5mo", "165*86400 -> 5mo"); d = Duration (166*86400), t.is (d.formatCompact (), "5mo", "166*86400 -> 5mo"); d = Duration (167*86400), t.is (d.formatCompact (), "5mo", "167*86400 -> 5mo"); d = Duration (168*86400), t.is (d.formatCompact (), "5mo", "168*86400 -> 5mo"); d = Duration (169*86400), t.is (d.formatCompact (), "5mo", "169*86400 -> 5mo"); d = Duration (170*86400), t.is (d.formatCompact (), "5mo", "170*86400 -> 5mo"); d = Duration (171*86400), t.is (d.formatCompact (), "5mo", "171*86400 -> 5mo"); d = Duration (172*86400), t.is (d.formatCompact (), "5mo", "172*86400 -> 5mo"); d = Duration (173*86400), t.is (d.formatCompact (), "5mo", "173*86400 -> 5mo"); d = Duration (174*86400), t.is (d.formatCompact (), "5mo", "174*86400 -> 5mo"); d = Duration (175*86400), t.is (d.formatCompact (), "5mo", "175*86400 -> 5mo"); d = Duration (176*86400), t.is (d.formatCompact (), "5mo", "176*86400 -> 5mo"); d = Duration (177*86400), t.is (d.formatCompact (), "5mo", "177*86400 -> 5mo"); d = Duration (178*86400), t.is (d.formatCompact (), "5mo", "178*86400 -> 5mo"); d = Duration (179*86400), t.is (d.formatCompact (), "5mo", "179*86400 -> 5mo"); d = Duration (180*86400), t.is (d.formatCompact (), "6mo", "180*86400 -> 6mo"); d = Duration (181*86400), t.is (d.formatCompact (), "6mo", "181*86400 -> 6mo"); d = Duration (182*86400), t.is (d.formatCompact (), "6mo", "182*86400 -> 6mo"); d = Duration (183*86400), t.is (d.formatCompact (), "6mo", "183*86400 -> 6mo"); d = Duration (184*86400), t.is (d.formatCompact (), "6mo", "184*86400 -> 6mo"); d = Duration (185*86400), t.is (d.formatCompact (), "6mo", "185*86400 -> 6mo"); d = Duration (186*86400), t.is (d.formatCompact (), "6mo", "186*86400 -> 6mo"); d = Duration (187*86400), t.is (d.formatCompact (), "6mo", "187*86400 -> 6mo"); d = Duration (188*86400), t.is (d.formatCompact (), "6mo", "188*86400 -> 6mo"); d = Duration (189*86400), t.is (d.formatCompact (), "6mo", "189*86400 -> 6mo"); d = Duration (190*86400), t.is (d.formatCompact (), "6mo", "190*86400 -> 6mo"); d = Duration (191*86400), t.is (d.formatCompact (), "6mo", "191*86400 -> 6mo"); d = Duration (192*86400), t.is (d.formatCompact (), "6mo", "192*86400 -> 6mo"); d = Duration (193*86400), t.is (d.formatCompact (), "6mo", "193*86400 -> 6mo"); d = Duration (194*86400), t.is (d.formatCompact (), "6mo", "194*86400 -> 6mo"); d = Duration (195*86400), t.is (d.formatCompact (), "6mo", "195*86400 -> 6mo"); d = Duration (196*86400), t.is (d.formatCompact (), "6mo", "196*86400 -> 6mo"); d = Duration (197*86400), t.is (d.formatCompact (), "6mo", "197*86400 -> 6mo"); d = Duration (198*86400), t.is (d.formatCompact (), "6mo", "198*86400 -> 6mo"); d = Duration (199*86400), t.is (d.formatCompact (), "6mo", "199*86400 -> 6mo"); d = Duration (200*86400), t.is (d.formatCompact (), "6mo", "200*86400 -> 6mo"); d = Duration (201*86400), t.is (d.formatCompact (), "6mo", "201*86400 -> 6mo"); d = Duration (202*86400), t.is (d.formatCompact (), "6mo", "202*86400 -> 6mo"); d = Duration (203*86400), t.is (d.formatCompact (), "6mo", "203*86400 -> 6mo"); d = Duration (204*86400), t.is (d.formatCompact (), "6mo", "204*86400 -> 6mo"); d = Duration (205*86400), t.is (d.formatCompact (), "6mo", "205*86400 -> 6mo"); d = Duration (206*86400), t.is (d.formatCompact (), "6mo", "206*86400 -> 6mo"); d = Duration (207*86400), t.is (d.formatCompact (), "6mo", "207*86400 -> 6mo"); d = Duration (208*86400), t.is (d.formatCompact (), "6mo", "208*86400 -> 6mo"); d = Duration (209*86400), t.is (d.formatCompact (), "6mo", "209*86400 -> 6mo"); d = Duration (210*86400), t.is (d.formatCompact (), "7mo", "210*86400 -> 7mo"); d = Duration (211*86400), t.is (d.formatCompact (), "7mo", "211*86400 -> 7mo"); d = Duration (212*86400), t.is (d.formatCompact (), "7mo", "212*86400 -> 7mo"); d = Duration (213*86400), t.is (d.formatCompact (), "7mo", "213*86400 -> 7mo"); d = Duration (214*86400), t.is (d.formatCompact (), "7mo", "214*86400 -> 7mo"); d = Duration (215*86400), t.is (d.formatCompact (), "7mo", "215*86400 -> 7mo"); d = Duration (216*86400), t.is (d.formatCompact (), "7mo", "216*86400 -> 7mo"); d = Duration (217*86400), t.is (d.formatCompact (), "7mo", "217*86400 -> 7mo"); d = Duration (218*86400), t.is (d.formatCompact (), "7mo", "218*86400 -> 7mo"); d = Duration (219*86400), t.is (d.formatCompact (), "7mo", "219*86400 -> 7mo"); d = Duration (220*86400), t.is (d.formatCompact (), "7mo", "220*86400 -> 7mo"); d = Duration (221*86400), t.is (d.formatCompact (), "7mo", "221*86400 -> 7mo"); d = Duration (222*86400), t.is (d.formatCompact (), "7mo", "222*86400 -> 7mo"); d = Duration (223*86400), t.is (d.formatCompact (), "7mo", "223*86400 -> 7mo"); d = Duration (224*86400), t.is (d.formatCompact (), "7mo", "224*86400 -> 7mo"); d = Duration (225*86400), t.is (d.formatCompact (), "7mo", "225*86400 -> 7mo"); d = Duration (226*86400), t.is (d.formatCompact (), "7mo", "226*86400 -> 7mo"); d = Duration (227*86400), t.is (d.formatCompact (), "7mo", "227*86400 -> 7mo"); d = Duration (228*86400), t.is (d.formatCompact (), "7mo", "228*86400 -> 7mo"); d = Duration (229*86400), t.is (d.formatCompact (), "7mo", "229*86400 -> 7mo"); d = Duration (230*86400), t.is (d.formatCompact (), "7mo", "230*86400 -> 7mo"); d = Duration (231*86400), t.is (d.formatCompact (), "7mo", "231*86400 -> 7mo"); d = Duration (232*86400), t.is (d.formatCompact (), "7mo", "232*86400 -> 7mo"); d = Duration (233*86400), t.is (d.formatCompact (), "7mo", "233*86400 -> 7mo"); d = Duration (234*86400), t.is (d.formatCompact (), "7mo", "234*86400 -> 7mo"); d = Duration (235*86400), t.is (d.formatCompact (), "7mo", "235*86400 -> 7mo"); d = Duration (236*86400), t.is (d.formatCompact (), "7mo", "236*86400 -> 7mo"); d = Duration (237*86400), t.is (d.formatCompact (), "7mo", "237*86400 -> 7mo"); d = Duration (238*86400), t.is (d.formatCompact (), "7mo", "238*86400 -> 7mo"); d = Duration (239*86400), t.is (d.formatCompact (), "7mo", "239*86400 -> 7mo"); d = Duration (240*86400), t.is (d.formatCompact (), "8mo", "240*86400 -> 8mo"); d = Duration (241*86400), t.is (d.formatCompact (), "8mo", "241*86400 -> 8mo"); d = Duration (242*86400), t.is (d.formatCompact (), "8mo", "242*86400 -> 8mo"); d = Duration (243*86400), t.is (d.formatCompact (), "8mo", "243*86400 -> 8mo"); d = Duration (244*86400), t.is (d.formatCompact (), "8mo", "244*86400 -> 8mo"); d = Duration (245*86400), t.is (d.formatCompact (), "8mo", "245*86400 -> 8mo"); d = Duration (246*86400), t.is (d.formatCompact (), "8mo", "246*86400 -> 8mo"); d = Duration (247*86400), t.is (d.formatCompact (), "8mo", "247*86400 -> 8mo"); d = Duration (248*86400), t.is (d.formatCompact (), "8mo", "248*86400 -> 8mo"); d = Duration (249*86400), t.is (d.formatCompact (), "8mo", "249*86400 -> 8mo"); d = Duration (250*86400), t.is (d.formatCompact (), "8mo", "250*86400 -> 8mo"); d = Duration (251*86400), t.is (d.formatCompact (), "8mo", "251*86400 -> 8mo"); d = Duration (252*86400), t.is (d.formatCompact (), "8mo", "252*86400 -> 8mo"); d = Duration (253*86400), t.is (d.formatCompact (), "8mo", "253*86400 -> 8mo"); d = Duration (254*86400), t.is (d.formatCompact (), "8mo", "254*86400 -> 8mo"); d = Duration (255*86400), t.is (d.formatCompact (), "8mo", "255*86400 -> 8mo"); d = Duration (256*86400), t.is (d.formatCompact (), "8mo", "256*86400 -> 8mo"); d = Duration (257*86400), t.is (d.formatCompact (), "8mo", "257*86400 -> 8mo"); d = Duration (258*86400), t.is (d.formatCompact (), "8mo", "258*86400 -> 8mo"); d = Duration (259*86400), t.is (d.formatCompact (), "8mo", "259*86400 -> 8mo"); d = Duration (260*86400), t.is (d.formatCompact (), "8mo", "260*86400 -> 8mo"); d = Duration (261*86400), t.is (d.formatCompact (), "8mo", "261*86400 -> 8mo"); d = Duration (262*86400), t.is (d.formatCompact (), "8mo", "262*86400 -> 8mo"); d = Duration (263*86400), t.is (d.formatCompact (), "8mo", "263*86400 -> 8mo"); d = Duration (264*86400), t.is (d.formatCompact (), "8mo", "264*86400 -> 8mo"); d = Duration (265*86400), t.is (d.formatCompact (), "8mo", "265*86400 -> 8mo"); d = Duration (266*86400), t.is (d.formatCompact (), "8mo", "266*86400 -> 8mo"); d = Duration (267*86400), t.is (d.formatCompact (), "8mo", "267*86400 -> 8mo"); d = Duration (268*86400), t.is (d.formatCompact (), "8mo", "268*86400 -> 8mo"); d = Duration (269*86400), t.is (d.formatCompact (), "8mo", "269*86400 -> 8mo"); d = Duration (270*86400), t.is (d.formatCompact (), "9mo", "270*86400 -> 9mo"); d = Duration (271*86400), t.is (d.formatCompact (), "9mo", "271*86400 -> 9mo"); d = Duration (272*86400), t.is (d.formatCompact (), "9mo", "272*86400 -> 9mo"); d = Duration (273*86400), t.is (d.formatCompact (), "9mo", "273*86400 -> 9mo"); d = Duration (274*86400), t.is (d.formatCompact (), "9mo", "274*86400 -> 9mo"); d = Duration (275*86400), t.is (d.formatCompact (), "9mo", "275*86400 -> 9mo"); d = Duration (276*86400), t.is (d.formatCompact (), "9mo", "276*86400 -> 9mo"); d = Duration (277*86400), t.is (d.formatCompact (), "9mo", "277*86400 -> 9mo"); d = Duration (278*86400), t.is (d.formatCompact (), "9mo", "278*86400 -> 9mo"); d = Duration (279*86400), t.is (d.formatCompact (), "9mo", "279*86400 -> 9mo"); d = Duration (280*86400), t.is (d.formatCompact (), "9mo", "280*86400 -> 9mo"); d = Duration (281*86400), t.is (d.formatCompact (), "9mo", "281*86400 -> 9mo"); d = Duration (282*86400), t.is (d.formatCompact (), "9mo", "282*86400 -> 9mo"); d = Duration (283*86400), t.is (d.formatCompact (), "9mo", "283*86400 -> 9mo"); d = Duration (284*86400), t.is (d.formatCompact (), "9mo", "284*86400 -> 9mo"); d = Duration (285*86400), t.is (d.formatCompact (), "9mo", "285*86400 -> 9mo"); d = Duration (286*86400), t.is (d.formatCompact (), "9mo", "286*86400 -> 9mo"); d = Duration (287*86400), t.is (d.formatCompact (), "9mo", "287*86400 -> 9mo"); d = Duration (288*86400), t.is (d.formatCompact (), "9mo", "288*86400 -> 9mo"); d = Duration (289*86400), t.is (d.formatCompact (), "9mo", "289*86400 -> 9mo"); d = Duration (290*86400), t.is (d.formatCompact (), "9mo", "290*86400 -> 9mo"); d = Duration (291*86400), t.is (d.formatCompact (), "9mo", "291*86400 -> 9mo"); d = Duration (292*86400), t.is (d.formatCompact (), "9mo", "292*86400 -> 9mo"); d = Duration (293*86400), t.is (d.formatCompact (), "9mo", "293*86400 -> 9mo"); d = Duration (294*86400), t.is (d.formatCompact (), "9mo", "294*86400 -> 9mo"); d = Duration (295*86400), t.is (d.formatCompact (), "9mo", "295*86400 -> 9mo"); d = Duration (296*86400), t.is (d.formatCompact (), "9mo", "296*86400 -> 9mo"); d = Duration (297*86400), t.is (d.formatCompact (), "9mo", "297*86400 -> 9mo"); d = Duration (298*86400), t.is (d.formatCompact (), "9mo", "298*86400 -> 9mo"); d = Duration (299*86400), t.is (d.formatCompact (), "9mo", "299*86400 -> 9mo"); d = Duration (300*86400), t.is (d.formatCompact (), "10mo", "300*86400 -> 10mo"); d = Duration (301*86400), t.is (d.formatCompact (), "10mo", "301*86400 -> 10mo"); d = Duration (302*86400), t.is (d.formatCompact (), "10mo", "302*86400 -> 10mo"); d = Duration (303*86400), t.is (d.formatCompact (), "10mo", "303*86400 -> 10mo"); d = Duration (304*86400), t.is (d.formatCompact (), "10mo", "304*86400 -> 10mo"); d = Duration (305*86400), t.is (d.formatCompact (), "10mo", "305*86400 -> 10mo"); d = Duration (306*86400), t.is (d.formatCompact (), "10mo", "306*86400 -> 10mo"); d = Duration (307*86400), t.is (d.formatCompact (), "10mo", "307*86400 -> 10mo"); d = Duration (308*86400), t.is (d.formatCompact (), "10mo", "308*86400 -> 10mo"); d = Duration (309*86400), t.is (d.formatCompact (), "10mo", "309*86400 -> 10mo"); d = Duration (310*86400), t.is (d.formatCompact (), "10mo", "310*86400 -> 10mo"); d = Duration (311*86400), t.is (d.formatCompact (), "10mo", "311*86400 -> 10mo"); d = Duration (312*86400), t.is (d.formatCompact (), "10mo", "312*86400 -> 10mo"); d = Duration (313*86400), t.is (d.formatCompact (), "10mo", "313*86400 -> 10mo"); d = Duration (314*86400), t.is (d.formatCompact (), "10mo", "314*86400 -> 10mo"); d = Duration (315*86400), t.is (d.formatCompact (), "10mo", "315*86400 -> 10mo"); d = Duration (316*86400), t.is (d.formatCompact (), "10mo", "316*86400 -> 10mo"); d = Duration (317*86400), t.is (d.formatCompact (), "10mo", "317*86400 -> 10mo"); d = Duration (318*86400), t.is (d.formatCompact (), "10mo", "318*86400 -> 10mo"); d = Duration (319*86400), t.is (d.formatCompact (), "10mo", "319*86400 -> 10mo"); d = Duration (320*86400), t.is (d.formatCompact (), "10mo", "320*86400 -> 10mo"); d = Duration (321*86400), t.is (d.formatCompact (), "10mo", "321*86400 -> 10mo"); d = Duration (322*86400), t.is (d.formatCompact (), "10mo", "322*86400 -> 10mo"); d = Duration (323*86400), t.is (d.formatCompact (), "10mo", "323*86400 -> 10mo"); d = Duration (324*86400), t.is (d.formatCompact (), "10mo", "324*86400 -> 10mo"); d = Duration (325*86400), t.is (d.formatCompact (), "10mo", "325*86400 -> 10mo"); d = Duration (326*86400), t.is (d.formatCompact (), "10mo", "326*86400 -> 10mo"); d = Duration (327*86400), t.is (d.formatCompact (), "10mo", "327*86400 -> 10mo"); d = Duration (328*86400), t.is (d.formatCompact (), "10mo", "328*86400 -> 10mo"); d = Duration (329*86400), t.is (d.formatCompact (), "10mo", "329*86400 -> 10mo"); d = Duration (330*86400), t.is (d.formatCompact (), "11mo", "330*86400 -> 11mo"); d = Duration (331*86400), t.is (d.formatCompact (), "11mo", "331*86400 -> 11mo"); d = Duration (332*86400), t.is (d.formatCompact (), "11mo", "332*86400 -> 11mo"); d = Duration (333*86400), t.is (d.formatCompact (), "11mo", "333*86400 -> 11mo"); d = Duration (334*86400), t.is (d.formatCompact (), "11mo", "334*86400 -> 11mo"); d = Duration (335*86400), t.is (d.formatCompact (), "11mo", "335*86400 -> 11mo"); d = Duration (336*86400), t.is (d.formatCompact (), "11mo", "336*86400 -> 11mo"); d = Duration (337*86400), t.is (d.formatCompact (), "11mo", "337*86400 -> 11mo"); d = Duration (338*86400), t.is (d.formatCompact (), "11mo", "338*86400 -> 11mo"); d = Duration (339*86400), t.is (d.formatCompact (), "11mo", "339*86400 -> 11mo"); d = Duration (340*86400), t.is (d.formatCompact (), "11mo", "340*86400 -> 11mo"); d = Duration (341*86400), t.is (d.formatCompact (), "11mo", "341*86400 -> 11mo"); d = Duration (342*86400), t.is (d.formatCompact (), "11mo", "342*86400 -> 11mo"); d = Duration (343*86400), t.is (d.formatCompact (), "11mo", "343*86400 -> 11mo"); d = Duration (344*86400), t.is (d.formatCompact (), "11mo", "344*86400 -> 11mo"); d = Duration (345*86400), t.is (d.formatCompact (), "11mo", "345*86400 -> 11mo"); d = Duration (346*86400), t.is (d.formatCompact (), "11mo", "346*86400 -> 11mo"); d = Duration (347*86400), t.is (d.formatCompact (), "11mo", "347*86400 -> 11mo"); d = Duration (348*86400), t.is (d.formatCompact (), "11mo", "348*86400 -> 11mo"); d = Duration (349*86400), t.is (d.formatCompact (), "11mo", "349*86400 -> 11mo"); d = Duration (350*86400), t.is (d.formatCompact (), "11mo", "350*86400 -> 11mo"); d = Duration (351*86400), t.is (d.formatCompact (), "11mo", "351*86400 -> 11mo"); d = Duration (352*86400), t.is (d.formatCompact (), "11mo", "352*86400 -> 11mo"); d = Duration (353*86400), t.is (d.formatCompact (), "11mo", "353*86400 -> 11mo"); d = Duration (354*86400), t.is (d.formatCompact (), "11mo", "354*86400 -> 11mo"); d = Duration (355*86400), t.is (d.formatCompact (), "11mo", "355*86400 -> 11mo"); d = Duration (356*86400), t.is (d.formatCompact (), "11mo", "356*86400 -> 11mo"); d = Duration (357*86400), t.is (d.formatCompact (), "11mo", "357*86400 -> 11mo"); d = Duration (358*86400), t.is (d.formatCompact (), "11mo", "358*86400 -> 11mo"); d = Duration (359*86400), t.is (d.formatCompact (), "11mo", "359*86400 -> 11mo"); d = Duration (360*86400), t.is (d.formatCompact (), "12mo", "360*86400 -> 12mo"); d = Duration (361*86400), t.is (d.formatCompact (), "12mo", "361*86400 -> 12mo"); d = Duration (362*86400), t.is (d.formatCompact (), "12mo", "362*86400 -> 12mo"); d = Duration (363*86400), t.is (d.formatCompact (), "12mo", "363*86400 -> 12mo"); d = Duration (364*86400), t.is (d.formatCompact (), "12mo", "364*86400 -> 12mo"); d = Duration (365*86400), t.is (d.formatCompact (), "1.0y", "365*86400 -> 1.0y"); d = Duration ("86400"), t.is (d.formatCompact (), "1d", "string '86400' -> 1d"); t.ok (d.valid ("daily"), "valid duration daily"); t.ok (d.valid ("day"), "valid duration day"); t.ok (d.valid ("weekly"), "valid duration weekly"); t.ok (d.valid ("weekdays"), "valid duration weekdays"); t.ok (d.valid ("sennight"), "valid duration sennight"); t.ok (d.valid ("biweekly"), "valid duration biweekly"); t.ok (d.valid ("fortnight"), "valid duration fortnight"); t.ok (d.valid ("monthly"), "valid duration monthly"); t.ok (d.valid ("bimonthly"), "valid duration bimonthly"); t.ok (d.valid ("quarterly"), "valid duration quarterly"); t.ok (d.valid ("annual"), "valid duration annual"); t.ok (d.valid ("yearly"), "valid duration yearly"); t.ok (d.valid ("semiannual"), "valid duration semiannual"); t.ok (d.valid ("biannual"), "valid duration biannual"); t.ok (d.valid ("biyearly"), "valid duration biyearly"); t.ok (d.valid ("0yrs"), "valid duration 0yrs"); t.ok (d.valid ("0yr"), "valid duration 0yr"); t.ok (d.valid ("0y"), "valid duration 0y"); t.ok (d.valid ("1yrs"), "valid duration 1yrs"); t.ok (d.valid ("1yr"), "valid duration 1yr"); t.ok (d.valid ("1y"), "valid duration 1y"); t.ok (d.valid ("10yrs"), "valid duration 10yrs"); t.ok (d.valid ("10yr"), "valid duration 10yr"); t.ok (d.valid ("10y"), "valid duration 10y"); t.ok (d.valid ("1.1yrs"), "valid duration 1.1yrs"); t.ok (d.valid ("-1.1yrs"), "valid duration -1.1yrs"); t.ok (d.valid ("1.1y"), "valid duration 1.1y"); t.ok (d.valid ("-1.1y"), "valid duration -1.1y"); t.ok (d.valid ("0qtrs"), "valid duration 0qtrs"); t.ok (d.valid ("0qtr"), "valid duration 0qtr"); t.ok (d.valid ("0q"), "valid duration 0q"); t.ok (d.valid ("1qtrs"), "valid duration 1qtrs"); t.ok (d.valid ("1qtr"), "valid duration 1qtr"); t.ok (d.valid ("1q"), "valid duration 1q"); t.ok (d.valid ("10qtrs"), "valid duration 10qtrs"); t.ok (d.valid ("10qtr"), "valid duration 10qtr"); t.ok (d.valid ("10q"), "valid duration 10q"); t.ok (d.valid ("0mnths"), "valid duration 0mnths"); t.ok (d.valid ("0mnth"), "valid duration 0mnth"); t.ok (d.valid ("0mo"), "valid duration 0mo"); t.ok (d.valid ("1mnths"), "valid duration 1mnths"); t.ok (d.valid ("1mnth"), "valid duration 1mnth"); t.ok (d.valid ("1mo"), "valid duration 1mo"); t.ok (d.valid ("10mnths"), "valid duration 10mnths"); t.ok (d.valid ("10mnth"), "valid duration 10mnth"); t.ok (d.valid ("10mo"), "valid duration 10mo"); t.ok (d.valid ("-1mnths"), "valid duration -1mnths"); t.ok (d.valid ("-1mnth"), "valid duration -1mnth"); t.ok (d.valid ("-1mths"), "valid duration -1mths"); t.ok (d.valid ("-1mth"), "valid duration -1mth"); t.ok (d.valid ("-1mo"), "valid duration -1mo"); t.ok (d.valid ("0wks"), "valid duration 0wks"); t.ok (d.valid ("0wk"), "valid duration 0wk"); t.ok (d.valid ("0w"), "valid duration 0w"); t.ok (d.valid ("1wks"), "valid duration 1wks"); t.ok (d.valid ("1wk"), "valid duration 1wk"); t.ok (d.valid ("1wk"), "valid duration 1wk"); t.ok (d.valid ("1w"), "valid duration 1w"); t.ok (d.valid ("10wks"), "valid duration 10wks"); t.ok (d.valid ("10wk"), "valid duration 10wk"); t.ok (d.valid ("10w"), "valid duration 10w"); t.ok (d.valid ("-1wks"), "valid duration -1wks"); t.ok (d.valid ("-1wk"), "valid duration -1wk"); t.ok (d.valid ("-1wk"), "valid duration -1wk"); t.ok (d.valid ("-1w"), "valid duration -1w"); t.ok (d.valid ("0days"), "valid duration 0days"); t.ok (d.valid ("0day"), "valid duration 0day"); t.ok (d.valid ("0d"), "valid duration 0d"); t.ok (d.valid ("1days"), "valid duration 1days"); t.ok (d.valid ("1day"), "valid duration 1day"); t.ok (d.valid ("1d"), "valid duration 1d"); t.ok (d.valid ("10days"), "valid duration 10days"); t.ok (d.valid ("10day"), "valid duration 10day"); t.ok (d.valid ("10d"), "valid duration 10d"); t.ok (d.valid ("-1days"), "valid duration -1days"); t.ok (d.valid ("-1day"), "valid duration -1day"); t.ok (d.valid ("-1d"), "valid duration -1d"); t.ok (d.valid ("0hrs"), "valid duration 0hrs"); t.ok (d.valid ("0hr"), "valid duration 0hr"); t.ok (d.valid ("0h"), "valid duration 0h"); t.ok (d.valid ("1hrs"), "valid duration 1hrs"); t.ok (d.valid ("1hr"), "valid duration 1hr"); t.ok (d.valid ("1h"), "valid duration 1h"); t.ok (d.valid ("10hrs"), "valid duration 10hrs"); t.ok (d.valid ("10hr"), "valid duration 10hr"); t.ok (d.valid ("10h"), "valid duration 10h"); t.ok (d.valid ("-1hrs"), "valid duration -1hrs"); t.ok (d.valid ("-1hr"), "valid duration -1hr"); t.ok (d.valid ("-1h"), "valid duration -1h"); t.ok (d.valid ("0mins"), "valid duration 0mins"); t.ok (d.valid ("0min"), "valid duration 0min"); t.ok (d.valid ("1mins"), "valid duration 1mins"); t.ok (d.valid ("1min"), "valid duration 1min"); t.ok (d.valid ("10mins"), "valid duration 10mins"); t.ok (d.valid ("10min"), "valid duration 10min"); t.ok (d.valid ("-1mins"), "valid duration -1mins"); t.ok (d.valid ("-1min"), "valid duration -1min"); t.ok (d.valid ("0secs"), "valid duration 0secs"); t.ok (d.valid ("0sec"), "valid duration 0sec"); t.ok (d.valid ("0s"), "valid duration 0s"); t.ok (d.valid ("1secs"), "valid duration 1secs"); t.ok (d.valid ("1sec"), "valid duration 1sec"); t.ok (d.valid ("1s"), "valid duration 1s"); t.ok (d.valid ("10secs"), "valid duration 10secs"); t.ok (d.valid ("10sec"), "valid duration 10sec"); t.ok (d.valid ("10s"), "valid duration 10s"); t.ok (d.valid ("-1secs"), "valid duration -1secs"); t.ok (d.valid ("-1sec"), "valid duration -1sec"); t.ok (d.valid ("-1s"), "valid duration -1s"); t.ok (d.valid ("-"), "valid duration -"); t.ok (d.valid ("86400"), "valid duration '86400'"); t.notok (d.valid ("woof"), "valid duration woof = fail"); t.is (convertDuration ("daily"), 1, "valid duration daily"); t.is (convertDuration ("day"), 1, "valid duration day"); t.is (convertDuration ("weekly"), 7, "valid duration weekly"); t.is (convertDuration ("weekdays"), 1, "valid duration weekdays"); t.is (convertDuration ("sennight"), 7, "valid duration sennight"); t.is (convertDuration ("biweekly"), 14, "valid duration biweekly"); t.is (convertDuration ("fortnight"), 14, "valid duration fortnight"); t.is (convertDuration ("monthly"), 30, "valid duration monthly"); t.is (convertDuration ("bimonthly"), 61, "valid duration bimonthly"); t.is (convertDuration ("quarterly"), 91, "valid duration quarterly"); t.is (convertDuration ("annual"), 365, "valid duration annual"); t.is (convertDuration ("yearly"), 365, "valid duration yearly"); t.is (convertDuration ("semiannual"), 183, "valid duration semiannual"); t.is (convertDuration ("biannual"), 730, "valid duration biannual"); t.is (convertDuration ("biyearly"), 730, "valid duration biyearly"); t.is (convertDuration ("0yrs"), 0, "valid duration 0yrs"); t.is (convertDuration ("0yr"), 0, "valid duration 0yr"); t.is (convertDuration ("0y"), 0, "valid duration 0y"); t.is (convertDuration ("1yrs"), 365, "valid duration 1yrs"); t.is (convertDuration ("1yr"), 365, "valid duration 1yr"); t.is (convertDuration ("1y"), 365, "valid duration 1y"); t.is (convertDuration ("10yrs"), 3650, "valid duration 10yrs"); t.is (convertDuration ("10yr"), 3650, "valid duration 10yr"); t.is (convertDuration ("10y"), 3650, "valid duration 10y"); t.is (convertDuration ("0qtrs"), 0, "valid duration 0qtrs"); t.is (convertDuration ("0qtr"), 0, "valid duration 0qtr"); t.is (convertDuration ("0q"), 0, "valid duration 0q"); t.is (convertDuration ("1qtrs"), 91, "valid duration 1qtrs"); t.is (convertDuration ("1qtr"), 91, "valid duration 1qtr"); t.is (convertDuration ("1q"), 91, "valid duration 1q"); t.is (convertDuration ("10qtrs"), 910, "valid duration 10qtrs"); t.is (convertDuration ("10qtr"), 910, "valid duration 10qtr"); t.is (convertDuration ("10q"), 910, "valid duration 10q"); t.is (convertDuration ("0mths"), 0, "valid duration 0mths"); t.is (convertDuration ("0mth"), 0, "valid duration 0mth"); t.is (convertDuration ("0mo"), 0, "valid duration 0mo"); t.is (convertDuration ("1mths"), 30, "valid duration 1mths"); t.is (convertDuration ("1mth"), 30, "valid duration 1mth"); t.is (convertDuration ("1mo"), 30, "valid duration 1mo"); t.is (convertDuration ("10mths"), 300, "valid duration 10mths"); t.is (convertDuration ("10mth"), 300, "valid duration 10mth"); t.is (convertDuration ("10mo"), 300, "valid duration 10mo"); t.is (convertDuration ("0wks"), 0, "valid duration 0wks"); t.is (convertDuration ("0wk"), 0, "valid duration 0wk"); t.is (convertDuration ("0w"), 0, "valid duration 0w"); t.is (convertDuration ("1wks"), 7, "valid duration 1wks"); t.is (convertDuration ("1wk"), 7, "valid duration 1wk"); t.is (convertDuration ("1w"), 7, "valid duration 1w"); t.is (convertDuration ("10wks"), 70, "valid duration 10wks"); t.is (convertDuration ("10wk"), 70, "valid duration 10wk"); t.is (convertDuration ("10w"), 70, "valid duration 10w"); t.is (convertDuration ("0days"), 0, "valid duration 0days"); t.is (convertDuration ("0day"), 0, "valid duration 0day"); t.is (convertDuration ("0d"), 0, "valid duration 0d"); t.is (convertDuration ("1days"), 1, "valid duration 1days"); t.is (convertDuration ("1day"), 1, "valid duration 1day"); t.is (convertDuration ("1d"), 1, "valid duration 1d"); t.is (convertDuration ("10days"), 10, "valid duration 10days"); t.is (convertDuration ("10day"), 10, "valid duration 10day"); t.is (convertDuration ("10d"), 10, "valid duration 10d"); t.is (convertDuration ("-"), 0, "valid duration -"); try { Duration left, right; // operator< left = Duration ("1sec"); right = Duration ("2secs"); t.ok (left < right, "duration 1sec < 2secs"); left = Duration ("-2secs"); right = Duration ("-1sec"); t.ok (left < right, "duration -2secs < -1sec"); left = Duration ("1sec"); right = Duration ("1min"); t.ok (left < right, "duration 1sec < 1min"); left = Duration ("1min"); right = Duration ("1hr"); t.ok (left < right, "duration 1min < 1hr"); left = Duration ("1hr"); right = Duration ("1d"); t.ok (left < right, "duration 1hr < 1d"); left = Duration ("1d"); right = Duration ("1w"); t.ok (left < right, "duration 1d < 1w"); left = Duration ("1w"); right = Duration ("1mo"); t.ok (left < right, "duration 1w < 1mo"); left = Duration ("1mo"); right = Duration ("1q"); t.ok (left < right, "duration 1mo < 1q"); left = Duration ("1q"); right = Duration ("1y"); t.ok (left < right, "duration 1q < 1y"); left = Duration ("-3s"); right = Duration ("-6s"); t.ok (right < left, "duration -6s < -3s"); // operator> left = Duration ("2secs"); right = Duration ("1sec"); t.ok (left > right, "2sec > 1secs"); left = Duration ("-1sec"); right = Duration ("-2secs"); t.ok (left > right, "-1secs > -2sec"); left = Duration ("1min"); right = Duration ("1sec"); t.ok (left > right, "1min > 1sec"); left = Duration ("1hr"); right = Duration ("1min"); t.ok (left > right, "1hr > 1min"); left = Duration ("1d"); right = Duration ("1hr"); t.ok (left > right, "1d > 1hr"); left = Duration ("1w"); right = Duration ("1d"); t.ok (left > right, "1w > 1d"); left = Duration ("1mo"); right = Duration ("1w"); t.ok (left > right, "1mo > 1w"); left = Duration ("1q"); right = Duration ("1mo"); t.ok (left > right, "1q > 1mo"); left = Duration ("1y"); right = Duration ("1q"); t.ok (left > right, "1y > 1q"); left = Duration ("-3s"); right = Duration ("-6s"); t.ok (left > right, "duration -3s > -6s"); // operator<= left = Duration ("1sec"); right = Duration ("2secs"); t.ok (left <= right, "duration 1sec <= 2secs"); left = Duration ("2secs"); right = Duration ("2secs"); t.ok (left <= right, "duration 1sec <= 2secs"); left = Duration ("2secs"); right = Duration ("1secs"); t.notok (left <= right, "duration NOT 1sec <= 2secs"); // operator>= left = Duration ("1sec"); right = Duration ("2secs"); t.notok (left >= right, "duration NOT 1sec >= 2secs"); left = Duration ("2secs"); right = Duration ("2secs"); t.ok (left >= right, "duration 1sec >= 2secs"); left = Duration ("2secs"); right = Duration ("1secs"); t.ok (left >= right, "duration 1sec >= 2secs"); // operator+ left = Duration (1); right = Duration (2); Duration result = left + right; t.is ((int)(time_t)left, 1, "1 + 2 = 3, 1 is still 1"); t.is ((int)(time_t)right, 2, "1 + 2 = 3, 2 is still 2"); t.is ((int)(time_t)result, 3, "1 + 2 = 3"); // operator+= left = Duration (1); right = Duration (2); left += right; t.is ((int)(time_t)left, 3, "1 += 2, 1 is now 3"); t.is ((int)(time_t)right, 2, "1 += 2, 2 is still 2"); // operator- left = Duration (3); right = Duration (2); result = left - right; t.is ((int)(time_t)left, 3, "3 - 2 = 1, 3 is still 3"); t.is ((int)(time_t)right, 2, "3 - 2 = 1, 2 is still 2"); t.is ((int)(time_t)result, 1, "3 - 2 = 1"); // operator-= left = Duration (3); right = Duration (2); left -= right; t.is ((int)(time_t)left, 1, "3 -= 2, 3 is now 1"); t.is ((int)(time_t)right, 2, "3 -= 2, 2 is still 2"); // Assorted regression tests. left = Duration ("-864000.00000"); t.is ((int)(time_t)left, 864000, "-864000.00000 -> 864000"); } catch (const std::string& e) { t.diag (e); } catch (...) { t.diag ("Unknown error"); } // Duration::negative t.ok ( Duration ("-1day").negative (), "-1day is negative"); t.ok (! Duration ("1day").negative (), "1day is not negative"); return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/enpassant.t000075500000000000000000000053601213035135600156170ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 10; # Create the rc file. if (open my $fh, '>', 'enp.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'enp.rc', 'Created enp.rc'); } # Test the en passant feature. qx{../src/task rc:enp.rc add foo 2>&1}; qx{../src/task rc:enp.rc add foo bar 2>&1}; qx{../src/task rc:enp.rc 1,2 do /foo/FOO/ pri:H +tag 2>&1}; my $output = qx{../src/task rc:enp.rc info 1 2>&1}; like ($output, qr/Status\s+Completed/, 'en passant 1 status change'); like ($output, qr/Description\s+FOO/, 'en passant 1 description change'); like ($output, qr/Priority\s+H/, 'en passant 1 description change'); like ($output, qr/Tags\s+tag/, 'en passant 1 description change'); $output = qx{../src/task rc:enp.rc info 2 2>&1}; like ($output, qr/Status\s+Completed/, 'en passant 2 status change'); like ($output, qr/Description\s+FOO bar/, 'en passant 2 description change'); like ($output, qr/Priority\s+H/, 'en passant 2 description change'); like ($output, qr/Tags\s+tag/, 'en passant 2 description change'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key enp.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'enp.rc', 'Cleanup'); exit 0; task-2.2.0-test/export.yaml.t000075500000000000000000000073551213035135600161130ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 22; # Create the rc file. if (open my $fh, '>', 'export.rc') { print $fh "data.location=.\n", "verbose=no\n"; close $fh; ok (-r 'export.rc', 'Created export.rc'); } # Add two tasks, export, examine result. # TODO Add annotations. qx{../src/task rc:export.rc add priority:H project:A one 2>&1}; qx{../src/task rc:export.rc add +tag1 +tag2 two 2>&1}; my $output = qx{../src/task rc:export.rc export | ../scripts/add-ons/export-yaml.pl > ./export.txt 2>&1}; my @lines; if (open my $fh, '<', './export.txt') { @lines = <$fh>; close $fh; } like ($lines[0], qr/^\%YAML 1\.1$/, 'export YAML line 1'); like ($lines[1], qr/^---$/, 'export YAML line 2'); like ($lines[2], qr/^ task:$/, 'export YAML line 3'); like ($lines[3], qr/^ description: one$/, 'export YAML line 4'); like ($lines[4], qr/^ entry: \d{8}T\d{6}Z$/, 'export YAML line 5'); like ($lines[5], qr/^ id: \d+$/, 'export YAML line 6'); like ($lines[6], qr/^ priority: H$/, 'export YAML line 7'); like ($lines[7], qr/^ project: A$/, 'export YAML line 8'); like ($lines[8], qr/^ status: pending$/, 'export YAML line 9'); like ($lines[9], qr/^ urgency: .+$/, 'export YAML line 10'); like ($lines[10], qr/^ uuid: .+$/, 'export YAML line 11'); like ($lines[11], qr/^ task:$/, 'export YAML line 12'); like ($lines[12], qr/^ description: two$/, 'export YAML line 13'); like ($lines[13], qr/^ entry: \d{8}T\d{6}Z$/, 'export YAML line 14'); like ($lines[14], qr/^ id: \d+$/, 'export YAML line 15'); like ($lines[15], qr/^ status: pending$/, 'export YAML line 16'); like ($lines[16], qr/^ tags: tag1,tag2$/, 'export YAML line 17'); like ($lines[17], qr/^ urgency: .+$/, 'export YAML line 18'); like ($lines[18], qr/^ uuid: .+$/, 'export YAML line 19'); like ($lines[19], qr/^\.\.\.$/, 'export YAML line 20'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key export.rc export.txt); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'export.rc' && ! -r 'export.txt', 'Cleanup'); exit 0; task-2.2.0-test/feature.1013.t000075500000000000000000000070131213035135600156360ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 10; # Create the rc file. if (open my $fh, '>', 'outerr.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'outerr.rc', 'Created outerr.rc'); } # Feature 1013: output error, header, footnote and debug messages on standard # error # Check that errors are sent to standard error my $stdout = qx{../src/task rc:outerr.rc add due:__ foo 2> /dev/null}; unlike ($stdout, qr/^The duration '__' was not recognized as valid, with correct units like '3days'.$/ms, 'Errors are not sent to stdout'); my $stderr = qx{../src/task rc:outerr.rc add due:__ bar 2>&1 >/dev/null}; like ($stderr, qr/^The duration '__' was not recognized as valid, with correct units like '3days'.$/ms, 'Errors are sent to stderr'); # Check that headers are sent to standard error $stdout = qx{../src/task rc:outerr.rc list 2> /dev/null}; unlike ($stdout, qr/^Using alternate .taskrc file outerr.rc$/ms, 'Headers are not sent to stdout'); $stderr = qx{../src/task rc:outerr.rc list 2>&1 >/dev/null}; like ($stderr, qr/^Using alternate .taskrc file outerr.rc$/ms, 'Headers are sent to stderr'); # Check that footnotes are sent to standard error $stdout = qx{../src/task rc:outerr.rc rc.debug:on list 2> /dev/null}; unlike ($stdout, qr/^Configuration override rc.debug:on$/ms, 'Footnotes are not sent to stdout'); $stderr = qx{../src/task rc:outerr.rc rc.debug:on list 2>&1 >/dev/null}; like ($stderr, qr/^Configuration override rc.debug:on$/ms, 'Footnotes are sent to stderr'); # Check that debugs are sent to standard error $stdout = qx{../src/task rc:outerr.rc rc.debug:on list 2> /dev/null}; unlike ($stdout, qr/^Timer Config::load \(outerr.rc\) /ms, 'Debugs are not sent to stdout'); $stderr = qx{../src/task rc:outerr.rc rc.debug:on list 2>&1 >/dev/null}; like ($stderr, qr/^Timer Config::load \(outerr.rc\) /ms, 'Debugs are sent to stderr'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key outerr.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'outerr.rc', 'Cleanup'); exit 0; task-2.2.0-test/feature.1061.t000075500000000000000000000047371213035135600156530ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 8; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "color=off\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Test: task columns # task columns descr my $output = qx{../src/task rc:bug.rc columns 2>/dev/null}; like ($output, qr/description/, 'columns - found description'); like ($output, qr/uuid/, 'columns - found uuid'); like ($output, qr/project/, 'columns - found project'); $output = qx{../src/task rc:bug.rc columns escr 2>/dev/null}; like ($output, qr/description/, 'columns - found \'escr\' in description'); unlike ($output, qr/uuid/, 'columns - did not find \'escr\' in uuid'); unlike ($output, qr/project/, 'columns - did not find \'escr\' in project'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/feature.559.t000075500000000000000000000045761213035135600156070ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "exit.on.missing.db=yes\n", "confirmation=no\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Feature 559: rc.exit.on.missing.db should cause exit if rc.data.location is missing. qx{../src/task rc:bug.rc add foo rc.debug:1 2>&1}; my $output = qx{../src/task rc:bug.rc list 2>&1 >/dev/null}; unlike ($output, qr/Error.+does not exist/, 'No error on existant rc.data.location'); $output = qx{../src/task rc:bug.rc rc.data.location=donkey list 2>&1 >/dev/null}; like ($output, qr/Error.+does not exist/, 'Error on missing rc.data.location'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/feature.608.t000075500000000000000000000044331213035135600155720ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Feature 608: Done should stop a task # Setup: Add and start a task qx{../src/task rc:bug.rc add Test due:3d 2>&1; ../src/task rc:bug.rc 1 start 2>&1}; # Mark the task as completed qx{../src/task rc:bug.rc 1 done 2>&1}; # Check to ensure task was stopped my $output = qx{../src/task rc:bug.rc info 1 2>&1}; like ($output, qr/End set to/ms, 'Done command also stops started task.'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/feature.632.t000075500000000000000000000060021213035135600155610ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 12; use File::Path; # Create the rc files. if (open my $fh, '>', 'rc1') { print $fh "data.location=./data1\n"; close $fh; ok (-r 'rc1', 'Created rc1'); } if (open my $fh, '>', 'rc2') { print $fh "data.location=./data2\n"; close $fh; ok (-r 'rc2', 'Created rc2'); } # Feature #632: task environment variables: TASKRC and TASKDATA qx{../src/task rc:rc1 add one 2>&1}; qx{../src/task rc:rc2 add two 2>&1}; # All in agreement: 1 my $output = qx{../src/task rc:rc1 list 2>&1}; like ($output, qr/one/, 'rc1'); $output = qx{TASKDATA=./data1 ../src/task rc:rc1 list 2>&1}; like ($output, qr/one/, 'TASKDATA, rc1'); $output = qx{TASKRC=./rc1 ../src/task list 2>&1}; like ($output, qr/one/, 'TASKRC'); $output = qx{TASKDATA=./data1 TASKRC=./rc1 ../src/task list 2>&1}; like ($output, qr/one/, 'TASKDATA, TASKRC, rc1'); # All in agreement: 2 $output = qx{../src/task rc:rc2 list 2>&1}; like ($output, qr/two/, 'rc2'); $output = qx{TASKDATA=./data2 ../src/task rc:rc2 list 2>&1}; like ($output, qr/two/, 'TASKDATA, rc2'); $output = qx{TASKRC=./rc2 ../src/task list 2>&1}; like ($output, qr/two/, 'TASKRC'); $output = qx{TASKDATA=./data2 TASKRC=./rc2 ../src/task list 2>&1}; like ($output, qr/two/, 'TASKDATA, TASKRC, rc2'); # rc: overrides TASKRC, TASKDATA $output = qx{TASKDATA=./data1 TASKRC=./rc1 ../src/task rc:rc2 list 2>&1}; like ($output, qr/one/, 'overrides TASKDATA, TASKRC override rc:'); rmtree ('./data1', 0 , 1); rmtree ('./data2', 0 , 1); unlink qw(rc1 rc2); ok (! -d './data1' && ! -d './data2' && ! -r 'rc1' && ! -r 'rc2', 'Cleanup'); exit 0 task-2.2.0-test/feature.725.t000075500000000000000000000060101213035135600155630ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 8; # Create the rc file. if (open my $fh, '>', 'feature.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'feature.rc', 'Created feature.rc'); } # Feature 725: Feedback when tasks become unblocked. qx{../src/task rc:feature.rc add one 2>&1}; qx{../src/task rc:feature.rc add two 2>&1}; qx{../src/task rc:feature.rc add three 2>&1}; qx{../src/task rc:feature.rc add four 2>&1}; qx{../src/task rc:feature.rc 1 modify depends:2,3 2>&1}; qx{../src/task rc:feature.rc 4 modify depends:1 2>&1}; my $output = qx{../src/task rc:feature.rc long 2>&1}; like ($output, qr/1.+2\s3/, 'Dependencies in place [1]'); like ($output, qr/4.+1/, 'Dependencies in place [4]'); # Trigger the feedback based on completion. $output = qx{../src/task rc:feature.rc 2 done 2>&1}; unlike ($output, qr/Unblocked/, 'Completing first dependency does not trigger message'); $output = qx{../src/task rc:feature.rc 3 done 2>&1}; like ($output, qr/Unblocked/, 'Completing second dependency triggers message'); # Now trigger the feedback based on deletion. $output = qx{../src/task rc:feature.rc long 2>&1}; like ($output, qr/2.+1/, 'Dependencies in place [2]'); $output = qx{../src/task rc:feature.rc 1 delete 2>&1}; like ($output, qr/Unblocked/, 'Deleting dependency triggers message'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key feature.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'feature.rc', 'Cleanup'); exit 0; task-2.2.0-test/feature.891.t000075500000000000000000000157741213035135600156100ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Time::Local; use Test::More tests => 37; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Feature 891: UUID filter should be uuid.endswith by default # Create some example data directly. This is so that we have complete control # over the UUID. if (open my $fh, '>', 'pending.data') { my $timeA = timegm (00,00,12,22,11,2008); my $timeB = timegm (00,00,12,17,03,2009); print $fh <&1}; my ($uuid) = $output =~ /UUID\s+(\S{36})/ms; $output = qx{../src/task rc:bug.rc $uuid list rc.debug:1 2>&1}; like ($output, qr/one/, "Found with $uuid"); my ($short) = $uuid =~ /^(.{35})/; $output = qx{../src/task rc:bug.rc $short list rc.debug:1 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{34})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{33})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{32})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{31})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{30})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{29})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{28})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{27})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{26})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{25})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{24})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{23})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{22})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{21})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{20})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{19})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{18})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{17})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{16})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{15})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{14})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{13})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; unlike ($output, qr/one/, "Not found with $short"); ($short) = $uuid =~ /^(.{12})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; unlike ($output, qr/one/, "Not found with $short"); ($short) = $uuid =~ /^(.{11})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; unlike ($output, qr/one/, "Not found with $short"); ($short) = $uuid =~ /^(.{10})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; unlike ($output, qr/one/, "Not found with $short"); ($short) = $uuid =~ /^(.{9})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; unlike ($output, qr/one/, "Not found with $short"); ($short) = $uuid =~ /^(.{8})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; unlike ($output, qr/one/, "Not found with $short"); ($short) = $uuid =~ /^(.{7})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; unlike ($output, qr/one/, "Not found with $short"); ($short) = $uuid =~ /^(.{6})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; unlike ($output, qr/one/, "Not found with $short"); ($short) = $uuid =~ /^(.{5})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; unlike ($output, qr/one/, "Not found with $short"); ($short) = $uuid =~ /^(.{4})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; unlike ($output, qr/one/, "Not found with $short"); ($short) = $uuid =~ /^(.{3})/; $output = qx{../src/task rc:bug.rc $short list 2>&1}; unlike ($output, qr/one/, "Not found with $short"); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/feature.exit.t000075500000000000000000000043021213035135600162210ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'exit.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'exit.rc', 'Created exit.rc'); } qx{../src/task rc:exit.rc add foo 2>&1}; my $exit_good = system ('../src/task rc:exit.rc ls foo >/dev/null 2>&1'); is ($exit_good, 0, 'task returns 0 on success'); my $exit_bad = system ('../src/task rc:exit.rc ls bar >/dev/null 2>&1'); isnt ($exit_bad, 0, 'task returns non-zero on failure'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key exit.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'exit.rc', 'Cleanup'); exit 0; task-2.2.0-test/feature.print.empty.columns.t000075500000000000000000000052741213035135600212310ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; print $fh "report.test.columns=id,project\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Feature: variable to control printing of empty columns qx{../src/task rc:bug.rc add sample desc 2>&1}; qx{../src/task rc:bug.rc add withP project:house 2>&1}; my $output = qx{../src/task test sample rc:bug.rc 2>&1}; unlike ($output, qr/Project/, 'empty \'project\' column is not printed by default'); $output = qx{../src/task test sample rc.print.empty.columns:yes rc:bug.rc 2>&1}; like ($output, qr/Project/, 'empty \'project\' column is printed if rc.print.empty.columns:yes'); $output = qx{../src/task test rc:bug.rc 2>&1}; like ($output, qr/Project/, 'non-empty \'project\' column is printed by default'); $output = qx{../src/task test rc.print.empty.columns:yes rc:bug.rc 2>&1}; like ($output, qr/Project/, 'non-empty \'project\' column is printed if rc.print.empty.columns:yes'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/file.t.cpp000064400000000000000000000056161213035135600153240ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include Context context; int main (int argc, char** argv) { UnitTest t (13); File::write ("/tmp/file.t.txt", "This is a test\n"); File f6 ("/tmp/file.t.txt"); t.ok (f6.size () == 15, "File::size /tmp/file.t.txt good"); t.ok (f6.mode () & S_IRUSR, "File::mode /tmp/file.t.txt good"); t.ok (File::remove ("/tmp/file.t.txt"), "File::remove /tmp/file.t.txt good"); // operator (std::string) const; t.is ((std::string) f6, "/tmp/file.t.txt", "File::operator (std::string) const"); t.ok (File::create ("/tmp/file.t.create"), "File::create /tmp/file.t.create good"); t.ok (File::remove ("/tmp/file.t.create"), "File::remove /tmp/file.t.create good"); // basename (std::string) const; t.is (f6.name (), "file.t.txt", "File::basename /tmp/file.t.txt --> file.t.txt"); // dirname (std::string) const; t.is (f6.parent (), "/tmp", "File::dirname /tmp/file.t.txt --> /tmp"); // bool rename (const std::string&); File f7 ("/tmp/file.t.2.txt"); f7.append ("something\n"); f7.close (); t.ok (f7.rename ("/tmp/file.t.3.txt"), "File::rename did not fail"); t.is (f7._data, "/tmp/file.t.3.txt", "File::rename stored new name"); t.ok (f7.exists (), "File::rename new file exists"); t.ok (f7.remove (), "File::remove /tmp/file.t.3.txt good"); t.notok (f7.exists (), "File::remove new file no longer exists"); return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/filter-prefix.t000075500000000000000000000116021213035135600163770ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 58; # Create the rc file. if (open my $fh, '>', 'filter.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'filter.rc', 'Created filter.rc'); } # Test the filters. qx{../src/task rc:filter.rc add project:foo.uno priority:H +tag one foo 2>&1}; qx{../src/task rc:filter.rc add project:foo.dos priority:H two 2>&1}; qx{../src/task rc:filter.rc add project:foo.tres three 2>&1}; qx{../src/task rc:filter.rc add project:bar.uno priority:H four 2>&1}; qx{../src/task rc:filter.rc add project:bar.dos +tag five 2>&1}; qx{../src/task rc:filter.rc add project:bar.tres six foo 2>&1}; qx{../src/task rc:filter.rc add project:bazuno seven bar foo 2>&1}; qx{../src/task rc:filter.rc add project:bazdos eight bar foo 2>&1}; my $output = qx{../src/task rc:filter.rc list 2>&1}; like ($output, qr/one/, 'a1'); like ($output, qr/two/, 'a2'); like ($output, qr/three/, 'a3'); like ($output, qr/four/, 'a4'); like ($output, qr/five/, 'a5'); like ($output, qr/six/, 'a6'); like ($output, qr/seven/, 'a7'); like ($output, qr/eight/, 'a8'); $output = qx{../src/task rc:filter.rc list project:foo 2>&1}; like ($output, qr/one/, 'b1'); like ($output, qr/two/, 'b2'); like ($output, qr/three/, 'b3'); unlike ($output, qr/four/, 'b4'); unlike ($output, qr/five/, 'b5'); unlike ($output, qr/six/, 'b6'); unlike ($output, qr/seven/, 'b7'); unlike ($output, qr/eight/, 'b8'); $output = qx{../src/task rc:filter.rc list project.not:foo 2>&1}; unlike ($output, qr/one/, 'c1'); unlike ($output, qr/two/, 'c2'); unlike ($output, qr/three/, 'c3'); like ($output, qr/four/, 'c4'); like ($output, qr/five/, 'c5'); like ($output, qr/six/, 'c6'); like ($output, qr/seven/, 'c7'); like ($output, qr/eight/, 'c8'); $output = qx{../src/task rc:filter.rc list project.startswith:bar 2>&1}; unlike ($output, qr/one/, 'd1'); unlike ($output, qr/two/, 'd2'); unlike ($output, qr/three/, 'd3'); like ($output, qr/four/, 'd4'); like ($output, qr/five/, 'd5'); like ($output, qr/six/, 'd6'); unlike ($output, qr/seven/, 'd7'); unlike ($output, qr/eight/, 'd8'); $output = qx{../src/task rc:filter.rc list project:ba 2>&1}; unlike ($output, qr/one/, 'f1'); unlike ($output, qr/two/, 'f2'); unlike ($output, qr/three/, 'f3'); like ($output, qr/four/, 'f4'); like ($output, qr/five/, 'f5'); like ($output, qr/six/, 'f6'); like ($output, qr/seven/, 'f7'); like ($output, qr/eight/, 'f8'); $output = qx{../src/task rc:filter.rc list project.not:ba 2>&1}; like ($output, qr/one/, 'g1'); like ($output, qr/two/, 'g2'); like ($output, qr/three/, 'g3'); unlike ($output, qr/four/, 'g4'); unlike ($output, qr/five/, 'g5'); unlike ($output, qr/six/, 'g6'); unlike ($output, qr/seven/, 'g7'); unlike ($output, qr/eight/, 'g8'); $output = qx{../src/task rc:filter.rc list description.has:foo 2>&1}; like ($output, qr/one/, 'i1'); unlike ($output, qr/two/, 'i2'); unlike ($output, qr/three/, 'i3'); unlike ($output, qr/four/, 'i4'); unlike ($output, qr/five/, 'i5'); like ($output, qr/six/, 'i6'); like ($output, qr/seven/, 'i7'); like ($output, qr/eight/, 'i8'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key filter.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'filter.rc', 'Cleanup'); exit 0; task-2.2.0-test/filter.t000075500000000000000000000241041213035135600151050ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 156; # Create the rc file. if (open my $fh, '>', 'filter.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'filter.rc', 'Created filter.rc'); } # Test the filters. qx{../src/task rc:filter.rc add project:A priority:H +tag one foo 2>&1}; qx{../src/task rc:filter.rc add project:A priority:H two 2>&1}; qx{../src/task rc:filter.rc add project:A three 2>&1}; qx{../src/task rc:filter.rc add priority:H four 2>&1}; qx{../src/task rc:filter.rc add +tag five 2>&1}; qx{../src/task rc:filter.rc add six foo 2>&1}; qx{../src/task rc:filter.rc add priority:L seven bar foo 2>&1}; my $output = qx{../src/task rc:filter.rc list 2>&1}; like ($output, qr/one/, 'a1'); like ($output, qr/two/, 'a2'); like ($output, qr/three/, 'a3'); like ($output, qr/four/, 'a4'); like ($output, qr/five/, 'a5'); like ($output, qr/six/, 'a6'); like ($output, qr/seven/, 'a7'); $output = qx{../src/task rc:filter.rc list project:A 2>&1}; like ($output, qr/one/, 'b1'); like ($output, qr/two/, 'b2'); like ($output, qr/three/, 'b3'); unlike ($output, qr/four/, 'b4'); unlike ($output, qr/five/, 'b5'); unlike ($output, qr/six/, 'b6'); unlike ($output, qr/seven/, 'b7'); $output = qx{../src/task rc:filter.rc list priority:H 2>&1}; like ($output, qr/one/, 'c1'); like ($output, qr/two/, 'c2'); unlike ($output, qr/three/, 'c3'); like ($output, qr/four/, 'c4'); unlike ($output, qr/five/, 'c5'); unlike ($output, qr/six/, 'c6'); unlike ($output, qr/seven/, 'c7'); $output = qx{../src/task rc:filter.rc list priority: 2>&1}; unlike ($output, qr/one/, 'd1'); unlike ($output, qr/two/, 'd2'); like ($output, qr/three/, 'd3'); unlike ($output, qr/four/, 'd4'); like ($output, qr/five/, 'd5'); like ($output, qr/six/, 'd6'); unlike ($output, qr/seven/, 'd7'); $output = qx{../src/task rc:filter.rc list foo 2>&1}; like ($output, qr/one/, 'e1'); unlike ($output, qr/two/, 'e2'); unlike ($output, qr/three/, 'e3'); unlike ($output, qr/four/, 'e4'); unlike ($output, qr/five/, 'e5'); like ($output, qr/six/, 'e6'); like ($output, qr/seven/, 'e7'); $output = qx{../src/task rc:filter.rc list foo bar 2>&1}; unlike ($output, qr/one/, 'f1'); unlike ($output, qr/two/, 'f2'); unlike ($output, qr/three/, 'f3'); unlike ($output, qr/four/, 'f4'); unlike ($output, qr/five/, 'f5'); unlike ($output, qr/six/, 'f6'); like ($output, qr/seven/, 'f7'); $output = qx{../src/task rc:filter.rc list +tag 2>&1}; like ($output, qr/one/, 'g1'); unlike ($output, qr/two/, 'g2'); unlike ($output, qr/three/, 'g3'); unlike ($output, qr/four/, 'g4'); like ($output, qr/five/, 'g5'); unlike ($output, qr/six/, 'g6'); unlike ($output, qr/seven/, 'g7'); $output = qx{../src/task rc:filter.rc list -tag 2>&1}; unlike ($output, qr/one/, 'h1'); like ($output, qr/two/, 'h2'); like ($output, qr/three/, 'h3'); like ($output, qr/four/, 'h4'); unlike ($output, qr/five/, 'h5'); like ($output, qr/six/, 'h6'); like ($output, qr/seven/, 'h7'); $output = qx{../src/task rc:filter.rc list -missing 2>&1}; like ($output, qr/one/, 'i1'); like ($output, qr/two/, 'i2'); like ($output, qr/three/, 'i3'); like ($output, qr/four/, 'i4'); like ($output, qr/five/, 'i5'); like ($output, qr/six/, 'i6'); like ($output, qr/seven/, 'i7'); $output = qx{../src/task rc:filter.rc list +tag -tag 2>&1}; unlike ($output, qr/one/, 'j1'); unlike ($output, qr/two/, 'j2'); unlike ($output, qr/three/, 'j3'); unlike ($output, qr/four/, 'j4'); unlike ($output, qr/five/, 'j5'); unlike ($output, qr/six/, 'j6'); unlike ($output, qr/seven/, 'j7'); $output = qx{../src/task rc:filter.rc list project:A priority:H 2>&1}; like ($output, qr/one/, 'k1'); like ($output, qr/two/, 'k2'); unlike ($output, qr/three/, 'k3'); unlike ($output, qr/four/, 'k4'); unlike ($output, qr/five/, 'k5'); unlike ($output, qr/six/, 'k6'); unlike ($output, qr/seven/, 'k7'); $output = qx{../src/task rc:filter.rc list project:A priority: 2>&1}; unlike ($output, qr/one/, 'l1'); unlike ($output, qr/two/, 'l2'); like ($output, qr/three/, 'l3'); unlike ($output, qr/four/, 'l4'); unlike ($output, qr/five/, 'l5'); unlike ($output, qr/six/, 'l6'); unlike ($output, qr/seven/, 'l7'); $output = qx{../src/task rc:filter.rc list project:A foo 2>&1}; like ($output, qr/one/, 'm1'); unlike ($output, qr/two/, 'm2'); unlike ($output, qr/three/, 'm3'); unlike ($output, qr/four/, 'm4'); unlike ($output, qr/five/, 'm5'); unlike ($output, qr/six/, 'm6'); unlike ($output, qr/seven/, 'm7'); $output = qx{../src/task rc:filter.rc list project:A +tag 2>&1}; like ($output, qr/one/, 'n1'); unlike ($output, qr/two/, 'n2'); unlike ($output, qr/three/, 'n3'); unlike ($output, qr/four/, 'n4'); unlike ($output, qr/five/, 'n5'); unlike ($output, qr/six/, 'n6'); unlike ($output, qr/seven/, 'n7'); $output = qx{../src/task rc:filter.rc list project:A priority:H foo 2>&1}; like ($output, qr/one/, 'o1'); unlike ($output, qr/two/, 'o2'); unlike ($output, qr/three/, 'o3'); unlike ($output, qr/four/, 'o4'); unlike ($output, qr/five/, 'o5'); unlike ($output, qr/six/, 'o6'); unlike ($output, qr/seven/, 'o7'); $output = qx{../src/task rc:filter.rc list project:A priority:H +tag 2>&1}; like ($output, qr/one/, 'p1'); unlike ($output, qr/two/, 'p2'); unlike ($output, qr/three/, 'p3'); unlike ($output, qr/four/, 'p4'); unlike ($output, qr/five/, 'p5'); unlike ($output, qr/six/, 'p6'); unlike ($output, qr/seven/, 'p7'); $output = qx{../src/task rc:filter.rc list project:A priority:H foo +tag 2>&1}; like ($output, qr/one/, 'q1'); unlike ($output, qr/two/, 'q2'); unlike ($output, qr/three/, 'q3'); unlike ($output, qr/four/, 'q4'); unlike ($output, qr/five/, 'q5'); unlike ($output, qr/six/, 'q6'); unlike ($output, qr/seven/, 'q7'); $output = qx{../src/task rc:filter.rc list project:A priority:H foo +tag baz 2>&1}; unlike ($output, qr/one/, 'r1'); unlike ($output, qr/two/, 'r2'); unlike ($output, qr/three/, 'r3'); unlike ($output, qr/four/, 'r4'); unlike ($output, qr/five/, 'r5'); unlike ($output, qr/six/, 'r6'); unlike ($output, qr/seven/, 'r7'); # Regex filters. #$output = qx{../src/task rc:filter.rc list rc.regex:on project:/[A-Z]/ 2>&1}; #like ($output, qr/one/, 's1'); #like ($output, qr/two/, 's2'); #like ($output, qr/three/, 's3'); #unlike ($output, qr/four/, 's4'); #unlike ($output, qr/five/, 's5'); #unlike ($output, qr/six/, 's6'); #unlike ($output, qr/seven/, 's7'); #$output = qx{../src/task rc:filter.rc list rc.regex:on project:. 2>&1}; #like ($output, qr/one/, 't1'); #like ($output, qr/two/, 't2'); #like ($output, qr/three/, 't3'); #unlike ($output, qr/four/, 't4'); #unlike ($output, qr/five/, 't5'); #unlike ($output, qr/six/, 't6'); #unlike ($output, qr/seven/, 't7'); $output = qx{../src/task rc:filter.rc rc.regex:on list /fo\{2\}/ 2>&1}; like ($output, qr/one/, 'u1'); unlike ($output, qr/two/, 'u2'); unlike ($output, qr/three/, 'u3'); unlike ($output, qr/four/, 'u4'); unlike ($output, qr/five/, 'u5'); like ($output, qr/six/, 'u6'); like ($output, qr/seven/, 'u7'); #$output = qx{../src/task rc:filter.rc rc.regex:on list /f../ /b../ 2>&1}; #unlike ($output, qr/one/, 'v1'); #unlike ($output, qr/two/, 'v2'); #unlike ($output, qr/three/, 'v3'); #unlike ($output, qr/four/, 'v4'); #unlike ($output, qr/five/, 'v5'); #unlike ($output, qr/six/, 'v6'); #like ($output, qr/seven/, 'v7'); $output = qx{../src/task rc:filter.rc rc.regex:on list /^s/ 2>&1}; unlike ($output, qr/one/, 'w1'); unlike ($output, qr/two/, 'w2'); unlike ($output, qr/three/, 'w3'); unlike ($output, qr/four/, 'w4'); unlike ($output, qr/five/, 'w5'); like ($output, qr/six/, 'w6'); like ($output, qr/seven/, 'w7'); $output = qx{../src/task rc:filter.rc rc.regex:on list /^.i/ 2>&1}; unlike ($output, qr/one/, 'x1'); unlike ($output, qr/two/, 'x2'); unlike ($output, qr/three/, 'x3'); unlike ($output, qr/four/, 'x4'); like ($output, qr/five/, 'x5'); like ($output, qr/six/, 'x6'); unlike ($output, qr/seven/, 'x7'); $output = qx{../src/task rc:filter.rc rc.regex:on list "/two|five/" 2>&1}; unlike ($output, qr/one/, 'y1'); like ($output, qr/two/, 'y2'); unlike ($output, qr/three/, 'y3'); unlike ($output, qr/four/, 'y4'); like ($output, qr/five/, 'y5'); unlike ($output, qr/six/, 'y6'); unlike ($output, qr/seven/, 'y7'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key filter.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'filter.rc', 'Cleanup'); exit 0; task-2.2.0-test/fontunderline.t000075500000000000000000000074301213035135600164770ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 10; # Create the rc file. if (open my $fh, '>', 'font.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'font.rc', 'Created font.rc'); } # Test the fontunderline config variable. The following truth table defines # the different results which are to be confirmed. # # color _forcecolor fontunderline result # ----- ----------- ------------- --------- # 0 0 0 dashes # 0 0 1 dashes # 0 1 0 dashes # 0 1 1 underline # 1* 0 0 dashes # 1* 0 1 dashes # 1* 1 0 dashes # 1* 1 1 underline # # * When isatty (fileno (stdout)) is false, color is automatically disabled. qx{../src/task rc:font.rc add foo 2>&1}; my $output = qx{../src/task 1 info rc:font.rc rc.color:off rc._forcecolor:off rc.fontunderline:off 2>&1}; like ($output, qr/--------/, '0,0,0 -> dashes'); $output = qx{../src/task 1 info rc:font.rc rc.color:off rc._forcecolor:off rc.fontunderline:on 2>&1}; like ($output, qr/--------/, '0,0,1 -> dashes'); $output = qx{../src/task 1 info rc:font.rc rc.color:off rc._forcecolor:on rc.fontunderline:off 2>&1}; like ($output, qr/--------/, '0,1,0 -> dashes'); $output = qx{../src/task 1 info rc:font.rc rc.color:off rc._forcecolor:on rc.fontunderline:on 2>&1}; unlike ($output, qr/--------/, '0,1,1 -> underline'); $output = qx{../src/task 1 info rc:font.rc rc.color:on rc._forcecolor:off rc.fontunderline:off 2>&1}; like ($output, qr/--------/, '1,0,0 -> dashes'); $output = qx{../src/task 1 info rc:font.rc rc.color:on rc._forcecolor:off rc.fontunderline:on 2>&1}; like ($output, qr/--------/, '1,0,1 -> dashes'); $output = qx{../src/task 1 info rc:font.rc rc.color:on rc._forcecolor:on rc.fontunderline:off 2>&1}; like ($output, qr/--------/, '1,1,0 -> dashes'); $output = qx{../src/task 1 info rc:font.rc rc.color:on rc._forcecolor:on rc.fontunderline:on 2>&1}; unlike ($output, qr/--------/, '1,1,1 -> underline'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key font.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'font.rc', 'Cleanup'); exit 0; task-2.2.0-test/history.annual.t000075500000000000000000000060601213035135600165770ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'time.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'time.rc', 'Created time.rc'); } # Create some tasks that were started/finished in different months, then verify # contents of the history report my @timeArray = localtime(time); my $now = time (); my $lastyear = $now - ($timeArray[7]+1) * 86_400; if (open my $fh, '>', 'pending.data') { print $fh <&1}; like ($output, qr/7\s+1\s+0\s+6/, 'history.annual - last year'); like ($output, qr/2\s+3\s+3\s+-4/, 'history.annual - this year'); like ($output, qr/4\s+2\s+1\s+1/, 'history.annual - average'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key time.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'time.rc', 'Cleanup'); exit 0; task-2.2.0-test/history.monthly.t000075500000000000000000000061011213035135600170070ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'time.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'time.rc', 'Created time.rc'); } # Create some tasks that were started/finished in different months, then verify # contents of the history report my @timeArray = localtime(time); my $now = time (); my $lastmonth = $now - ($timeArray[3] + 1) * 86_400; if (open my $fh, '>', 'pending.data') { print $fh <&1}; like ($output, qr/7\s+1\s+0\s+6/, 'history.monthly - last month'); like ($output, qr/2\s+3\s+3\s+-4/, 'history.monthly - this month'); like ($output, qr/4\s+2\s+1\s+1/, 'history.monthly - average'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key time.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'time.rc', 'Cleanup'); exit 0; task-2.2.0-test/hyphenate.t000075500000000000000000000042271213035135600156110ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n"; print $fh "confirmation=no\n"; print $fh "defaultwidth=50\n"; print $fh "detection=off\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } # Split on comma instead of hyphenating my $output = qx{../src/task rc:bug.rc show report.next.columns | tail -n +4 2>&1}; unlike ($output, qr/-/, 'split on comma for comma-separated lists'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'bug.rc', 'Cleanup'); exit 0; task-2.2.0-test/i18n.t.cpp000064400000000000000000000055661213035135600151700ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { UnitTest t (11); try { t.is (format ("pre {1} post", "mid"), "pre mid post", "format 1a"); t.is (format ("pre {1}{1} post", "mid"), "pre midmid post", "format 1b"); t.is (format ("pre {1} post", 0), "pre 0 post", "format 1c"); t.is (format ("pre {1}{1} post", 0), "pre 00 post", "format 1d"); t.is (format ("pre {1}{2} post", "one", "two"), "pre onetwo post", "format 2a"); t.is (format ("pre {2}{1} post", "one", "two"), "pre twoone post", "format 2b"); t.is (format ("pre {1}{2} post", "one", 2), "pre one2 post", "format 2c"); t.is (format ("pre {1}{2} post", 1, "two"), "pre 1two post", "format 2d"); t.is (format ("pre {1}{2} post", 1, 2), "pre 12 post", "format 2e"); t.is (format ("pre {1}{2}{3} post", "one", "two", "three"), "pre onetwothree post", "format 3a"); t.is (format ("pre {3}{1}{2} post", "one", "two", "three"), "pre threeonetwo post", "format 3b"); } catch (const std::string& error) { t.diag (error); return -1; } catch (...) { t.diag ("Unknown error."); return -2; } return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/ids.t000075500000000000000000000064521213035135600144050ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 10; # Create the rc file. if (open my $fh, '>', 'ids.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'ids.rc', 'Created ids.rc'); } # Test the count command. qx{../src/task rc:ids.rc add one +A +B 2>&1}; qx{../src/task rc:ids.rc add two +A 2>&1}; qx{../src/task rc:ids.rc add three +A +B 2>&1}; qx{../src/task rc:ids.rc add four 2>&1}; qx{../src/task rc:ids.rc add five +A +B 2>&1}; my $output = qx{../src/task rc:ids.rc ids +A 2>/dev/null}; like ($output, qr/^1-3,5$/, 'ids +A --> 1-3,5'); $output = qx{../src/task rc:ids.rc ids +B 2>/dev/null}; like ($output, qr/^1,3,5$/, 'ids +B --> 1,3,5'); $output = qx{../src/task rc:ids.rc ids +A -B 2>/dev/null}; like ($output, qr/^2$/, 'ids +A -B --> 2'); $output = qx{../src/task rc:ids.rc _ids +A}; like ($output, qr/^1\n2\n3\n5$/, '_ids +A --> 1\n2\n3\n5'); $output = qx{../src/task rc:ids.rc _zshids +A}; like ($output, qr/^1:one\n2:two\n3:three\n5:five$/, '_zshids +A --> 1:one\n2:two\n3:three\n5:five'); $output = qx{../src/task rc:ids.rc uuids +A 2>/dev/null}; like ($output, qr/^[0-9a-f-]+,[0-9a-f-]+,[0-9a-f-]+,[0-9a-f-]+$/, 'uuids +A --> uuid,uuid,uuid,uuid'); $output = qx{../src/task rc:ids.rc _uuids +A}; like ($output, qr/^[0-9a-f-]+\n[0-9a-f-]+\n[0-9a-f-]+\n[0-9a-f-]+$/, '_uuids +A --> uuid\nuuid\nuuid\nuuid'); # The order of the task may not be respected with _zshuuids $output = qx{../src/task rc:ids.rc _zshuuids +A}; like ($output, qr/^[0-9a-f-]+:[a-z]+\n[0-9a-f-]+:[a-z]+\n[0-9a-f-]+:[a-z]+\n[0-9a-f-]+:[a-z]+$/, '_zshuuids +A --> uuid:*\nuuid:*\nuuid:*\nuuid:*'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key ids.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'ids.rc', 'Cleanup'); exit 0; task-2.2.0-test/import.t000075500000000000000000000100101213035135600151210ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 13; # Create the rc file. if (open my $fh, '>', 'import.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'import.rc', 'Created import.rc'); } # Create import file. if (open my $fh, '>', 'import.txt') { print $fh <&1 >/dev/null}; like ($output, qr/Imported 3 tasks\./, 'no errors'); # Imported 3 tasks successfully. $output = qx{../src/task rc:import.rc list 2>&1}; # ID Project Pri Due Active Age Description # -- ------- --- --- ------ ------- ----------- # 1 A 1.5 yrs zero # 2 B 1.5 yrs one # # 2 tasks like ($output, qr/1.+A.+zero/, 't1 present'); like ($output, qr/2.+B.+one/, 't2 present'); unlike ($output, qr/3.+two/, 't3 missing'); $output = qx{../src/task rc:import.rc completed 2>&1}; # Complete Project Pri Age Description # --------- ------- --- ------- ----------- # 2/13/2009 1.5 yrs two # # 1 task unlike ($output, qr/1.+A.+zero/, 't1 missing'); unlike ($output, qr/2.+B.+one/, 't2 missing'); like ($output, qr/2\/13\/2009.+two/, 't3 present'); # Make sure that a duplicate task cannot be imported. $output = qx{../src/task rc:import.rc import import.txt 2>&1 >/dev/null}; like ($output, qr/Cannot add task because the uuid .+ is not unique\./, 'error on duplicate uuid'); # Create import file. if (open my $fh, '>', 'import2.txt') { print $fh <&1 >/dev/null}; like ($output, qr/Imported 1 tasks\./, 'no errors'); # Imported 1 tasks successfully. # Cleanup. unlink qw(import.txt import2.txt pending.data completed.data undo.data backlog.data synch.key import.rc); ok (! -r 'import.txt' && ! -r 'import2.txt' && ! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'import.rc', 'Cleanup'); exit 0; task-2.2.0-test/import.todo.sh.t000075500000000000000000000134621213035135600165140ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 26; # Create the rc file. if (open my $fh, '>', 'import.rc') { print $fh "data.location=.\n", "json.array=on\n", "dateformat=YYYY-M-D\n", "verbose=off\n"; close $fh; ok (-r 'import.rc', 'Created import.rc'); } # Create import file. if (open my $fh, '>', 'import.txt') { print $fh "(A) \@phone thank Mom for the meatballs\n", # 1 "(B) +GarageSale \@phone schedule Goodwill pickup\n", # 2 "+GarageSale \@home post signs around the neighborhood\n", # 3 "\@shopping Eskimo pies\n", # 4 "(A) Call Mom\n", # 5 "Really gotta call Mom (A) \@phone \@someday\n", # 6 "(b)->get back to the boss\n", # 7 "2011-03-02 Document +TodoTxt task format\n", # 8 "(A) 2011-03-02 Call Mom\n", # 9 "(A) Call Mom 2011-03-02\n", # 10 "(A) Call Mom +Family +PeaceLoveAndHappiness \@iphone \@phone\n", # 11 "xylophone lesson\n", # 12 "X 2011-03-03 Call Mom\n", # - "x 2011-03-02 2011-03-01 Review Tim's pull request +TodoTxtTouch \@github\n"; # - close $fh; ok (-r 'import.txt', 'Created sample import data'); } # Convert todo.sh --> task JSON. qx{../scripts/add-ons/import-todo.sh.pl import.json 2>&1}; # Import the JSON. my $output = qx{../src/task rc:import.rc import import.json 2>&1}; diag ($output); $output = qx{../src/task rc:import.rc info 1 2>&1}; like ($output, qr/^Priority.+H/ms, '1 pri:H'); like ($output, qr/^Tags.+phone/ms, '1 +phone'); like ($output, qr/^Description.+\@phone thank Mom for the meatballs/ms, '1 '); $output = qx{../src/task rc:import.rc info 2 2>&1}; like ($output, qr/^Priority.+M/ms, '2 pri:M'); like ($output, qr/^Project.+GarageSale/ms, '2 '); like ($output, qr/^Description.+/ms, '2 '); $output = qx{../src/task rc:import.rc info 3 2>&1}; like ($output, qr/^Project.+GarageSale/ms, '3 '); like ($output, qr/^Description.+\+GarageSale \@home post signs around the neighborhood/ms, '3 '); $output = qx{../src/task rc:import.rc info 4 2>&1}; like ($output, qr/^Description.+\@shopping Eskimo pies/ms, '4 '); $output = qx{../src/task rc:import.rc info 5 2>&1}; like ($output, qr/^Priority.+H/ms, '5 pri:H'); like ($output, qr/^Description.+Call Mom/ms, '5 '); $output = qx{../src/task rc:import.rc info 6 2>&1}; like ($output, qr/^Description.+Really gotta call Mom \(A\) \@phone \@someday/ms, '6 '); $output = qx{../src/task rc:import.rc info 7 2>&1}; like ($output, qr/^Description.+\(b\)->get back to the boss/ms, '7 '); $output = qx{../src/task rc:import.rc info 8 2>&1}; like ($output, qr/^Project.+TodoTxt/ms, '8 '); like ($output, qr/^Description.+Document \+TodoTxt task format/ms, '8 '); $output = qx{../src/task rc:import.rc info 9 2>&1}; like ($output, qr/^Priority.+H/ms, '9 pri:H'); like ($output, qr/^Description.+Call Mom/ms, '9 '); $output = qx{../src/task rc:import.rc info 10 2>&1}; like ($output, qr/^Priority.+H/ms, '10 pri:H'); like ($output, qr/^Description.+Call Mom 2011-03-02/ms, '10 '); $output = qx{../src/task rc:import.rc info 11 2>&1}; like ($output, qr/^Priority.+H/ms, '11 pri:H'); like ($output, qr/^Project.+Family/ms, '8 '); like ($output, qr/^Description.+Call Mom \+Family \+PeaceLoveAndHappiness \@iphone \@phone/ms, '11 '); $output = qx{../src/task rc:import.rc info 12 2>&1}; like ($output, qr/^Description.+xylophone lesson/ms, '12 '); # TODO and now the completed ones. # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key import.rc import.txt import.json); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'import.rc' && ! -r 'import.txt' && ! -r 'import.json', 'Cleanup'); exit 0; task-2.2.0-test/import.yaml.t000075500000000000000000000112641213035135600160760ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 16; # Create the rc file. if (open my $fh, '>', 'import.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'import.rc', 'Created import.rc'); } # Create import file. if (open my $fh, '>', 'import.txt') { print $fh < task JSON. qx{../scripts/add-ons/import-yaml.pl import.json 2>&1}; # Import the JSON. my $output = qx{../src/task rc:import.rc import import.json 2>&1 >/dev/null}; like ($output, qr/Imported 3 tasks\./, '3 tasks imported'); $output = qx{../src/task rc:import.rc list 2>&1}; # ID Project Pri Due Active Age Description # -- ------- --- --- ------ ------- ----------- # 1 A 1.5 yrs zero # 2 B 1.5 yrs one # # 2 tasks like ($output, qr/1.+A.+zero/, 't1 present'); like ($output, qr/2.+B.+one/, 't2 present'); unlike ($output, qr/3.+two/, 't3 missing'); $output = qx{../src/task rc:import.rc completed 2>&1}; # Complete Project Pri Age Description # --------- ------- --- ------- ----------- # 2/13/2009 1.5 yrs two # # 1 task unlike ($output, qr/1.+A.+zero/, 't1 missing'); unlike ($output, qr/2.+B.+one/, 't2 missing'); like ($output, qr/9\/4\/2011.+two/, 't3 present'); # Make sure that a duplicate task cannot be imported. $output = qx{../src/task rc:import.rc import import.json 2>&1 >/dev/null}; like ($output, qr/Cannot add task because the uuid '.{36}' is not unique\./, 'error on duplicate uuid'); # Create import file. if (open my $fh, '>', 'import.txt') { print $fh < task JSON. qx{../scripts/add-ons/import-yaml.pl import.json 2>&1}; # Import the JSON. $output = qx{../src/task rc:import.rc import import.json 2>&1 >/dev/null}; like ($output, qr/Imported 1 tasks\./, '1 task imported'); # Verify. $output = qx{../src/task rc:import.rc list 2>&1}; # ID Project Pri Due Active Age Description # -- ------- --- --- ------ ---- ----------- # 3 2.6y three # 1 A 3d zero # 2 B 2d one like ($output, qr/1.+A.+zero/, 't1 present'); like ($output, qr/2.+B.+one/, 't2 present'); like ($output, qr/3.+three/, 't3 present'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key import.rc import.txt import.json); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'import.rc' && ! -r 'import.txt' && ! -r 'import.json', 'Cleanup'); exit 0; task-2.2.0-test/json.t.cpp000064400000000000000000000145061213035135600153540ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include Context context; const char *positive_tests[] = { "{}", " { } ", "[]", "{\"one\":1}", "{\n\"one\"\n:\n1\n}\n", "{\"name\":123, \"array\":[1,2,3.4], \"object\":{\"m1\":\"v1\", \"m2\":\"v2\"}}", "{\"name\":\"value\",\"array\":[\"one\",\"two\"],\"object\":{\"name2\":123,\"literal\":false}}", "{\n" "\"ticket\": { \"type\":\"add\", \"client\":\"taskwarrior 2.x\"},\n" "\"auth\": { \"user\":\"paul\", \"org\":\"gbf\", \"key\":\".........\",\n" " \"locale\":\"en-US\" },\n" "\n" "\"add\": { \"description\":\"Wash the dog\",\n" " \"project\":\"home\",\n" " \"due\":\"20101101T000000Z\" }\n" "}", "{" "\"ticket\":{" "\"type\":\"synch\"," "\"client\":\"taskd-test-suite 1.0\"" "}," "\"synch\":{" "\"user\":{" "\"data\":[" "{" "\"uuid\":\"11111111-1111-1111-1111-111111111111\"," "\"status\":\"pending\"," "\"description\":\"This is a test\"," "\"entry\":\"20110111T124000Z\"" "}" "]," "\"synch\":\"key\"" "}" "}," "\"auth\":{" "\"org\":\"gbf\"," "\"user\":\"Paul Beckingham\"," "\"key\":\"K\"," "\"locale\":\"en-US\"" "}" "}" }; #define NUM_POSITIVE_TESTS (sizeof (positive_tests) / sizeof (positive_tests[0])) const char *negative_tests[] = { "", "{", "}", "[", "]", "foo", "[?]" }; #define NUM_NEGATIVE_TESTS (sizeof (negative_tests) / sizeof (negative_tests[0])) //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { UnitTest t (NUM_POSITIVE_TESTS + NUM_NEGATIVE_TESTS + 22); // Positive tests. for (int i = 0; i < NUM_POSITIVE_TESTS; ++i) { try { json::value* root = json::parse (positive_tests[i]); t.ok (root, std::string ("positive: ") + positive_tests[i]); if (root) { t.diag (root->dump ()); delete root; } } catch (const std::string& e) { t.diag (e); } catch (...) { t.diag ("Unknown error"); } } // Negative tests. for (int i = 0; i < NUM_NEGATIVE_TESTS; ++i) { try { json::value* root = json::parse (negative_tests[i]); t.is ((const char*) root, (const char*) NULL, std::string ("negative: ") + negative_tests[i]); } catch (const std::string& e) { t.pass (e); } catch (...) { t.fail ("Unknown error"); } } // Other tests. try { // Regular unit tests. t.is (json::encode ("1\b2"), "1\\b2", "json::encode slashslashb -> slashslashslashslashb"); t.is (json::decode ("1\\b2"), "1\b2", "json::decode slashslashslashslashb -> slashslashb"); t.is (json::encode ("1\n2"), "1\\n2", "json::encode slashslashn -> slashslashslashslashn"); t.is (json::decode ("1\\n2"), "1\n2", "json::decode slashslashslashslashn -> slashslashn"); t.is (json::encode ("1\r2"), "1\\r2", "json::encode slashslashr -> slashslashslashslashr"); t.is (json::decode ("1\\r2"), "1\r2", "json::decode slashslashslashslashr -> slashslashr"); t.is (json::encode ("1\t2"), "1\\t2", "json::encode slashslasht -> slashslashslashslasht"); t.is (json::decode ("1\\t2"), "1\t2", "json::decode slashslashslashslasht -> slashslasht"); t.is (json::encode ("1\\2"), "1\\\\2", "json::encode slashslash -> slashslashslashslash"); t.is (json::decode ("1\\\\2"), "1\\2", "json::decode slashslashslashslash -> slashslash"); t.is (json::encode ("1\x2"), "1\x2", "json::encode slashslashx -> slashslashx(NOP)"); t.is (json::decode ("1\x2"), "1\x2", "json::decode slashslashx -> slashslashx(NOP)"); t.is (json::encode ("1€2"), "1€2", "json::encode € -> €"); t.is (json::decode ("1\\u20ac2"), "1€2", "json::decode slashslashu20ac -> €"); std::string encoded = json::encode ("one\\"); t.is (encoded, "one\\\\", "json::encode oneslashslashslashslash -> oneslashslashslashslashslashslashslashslash"); t.is ((int)encoded.length (), 5, "json::encode oneslashslashslashslash -> length 5"); t.is (encoded[0], 'o', "json::encode oneslashslashslashslash[0] -> o"); t.is (encoded[1], 'n', "json::encode oneslashslashslashslash[1] -> n"); t.is (encoded[2], 'e', "json::encode oneslashslashslashslash[2] -> e"); t.is (encoded[3], '\\', "json::encode oneslashslashslashslash[3] -> slashslash"); t.is (encoded[4], '\\', "json::encode oneslashslashslashslash[4] -> slashslash"); t.is (json::decode (encoded), "one\\", "json::decode oneslashslashslashslashslashslashslashslash -> oneslashslashslashslash"); } catch (const std::string& e) {t.diag (e);} return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/json/000075500000000000000000000000001213035135600144005ustar00rootroot00000000000000task-2.2.0-test/json/1.json000064400000000000000000000011611213035135600154320ustar00rootroot00000000000000{ "glossary": { "title": "example glossary", "GlossDiv": { "title": "S", "GlossList": { "GlossEntry": { "ID": "SGML", "SortAs": "SGML", "GlossTerm": "Standard Generalized Markup Language", "Acronym": "SGML", "Abbrev": "ISO 8879:1986", "GlossDef": { "para": "A meta-markup language, used to create markup languages such as DocBook.", "GlossSeeAlso": ["GML", "XML"] }, "GlossSee": "markup" } } } } } task-2.2.0-test/json/2.json000064400000000000000000000003621213035135600154350ustar00rootroot00000000000000{"menu": { "id": "file", "value": "File", "popup": { "menuitem": [ {"value": "New", "onclick": "CreateNewDoc()"}, {"value": "Open", "onclick": "OpenDoc()"}, {"value": "Close", "onclick": "CloseDoc()"} ] } }} task-2.2.0-test/json/3.json000064400000000000000000000011361213035135600154360ustar00rootroot00000000000000{"widget": { "debug": "on", "window": { "title": "Sample Konfabulator Widget", "name": "main_window", "width": 500, "height": 500 }, "image": { "src": "Images/Sun.png", "name": "sun1", "hOffset": 250, "vOffset": 250, "alignment": "center" }, "text": { "data": "Click Here", "size": 36, "style": "bold", "name": "text1", "hOffset": 250, "vOffset": 100, "alignment": "center", "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;" } }} task-2.2.0-test/json/4.json000064400000000000000000000066141213035135600154450ustar00rootroot00000000000000{"web-app": { "servlet": [ { "servlet-name": "cofaxCDS", "servlet-class": "org.cofax.cds.CDSServlet", "init-param": { "configGlossary:installationAt": "Philadelphia, PA", "configGlossary:adminEmail": "ksm@pobox.com", "configGlossary:poweredBy": "Cofax", "configGlossary:poweredByIcon": "/images/cofax.gif", "configGlossary:staticPath": "/content/static", "templateProcessorClass": "org.cofax.WysiwygTemplate", "templateLoaderClass": "org.cofax.FilesTemplateLoader", "templatePath": "templates", "templateOverridePath": "", "defaultListTemplate": "listTemplate.htm", "defaultFileTemplate": "articleTemplate.htm", "useJSP": false, "jspListTemplate": "listTemplate.jsp", "jspFileTemplate": "articleTemplate.jsp", "cachePackageTagsTrack": 200, "cachePackageTagsStore": 200, "cachePackageTagsRefresh": 60, "cacheTemplatesTrack": 100, "cacheTemplatesStore": 50, "cacheTemplatesRefresh": 15, "cachePagesTrack": 200, "cachePagesStore": 100, "cachePagesRefresh": 10, "cachePagesDirtyRead": 10, "searchEngineListTemplate": "forSearchEnginesList.htm", "searchEngineFileTemplate": "forSearchEngines.htm", "searchEngineRobotsDb": "WEB-INF/robots.db", "useDataStore": true, "dataStoreClass": "org.cofax.SqlDataStore", "redirectionClass": "org.cofax.SqlRedirection", "dataStoreName": "cofax", "dataStoreDriver": "com.microsoft.jdbc.sqlserver.SQLServerDriver", "dataStoreUrl": "jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon", "dataStoreUser": "sa", "dataStorePassword": "dataStoreTestQuery", "dataStoreTestQuery": "SET NOCOUNT ON;select test='test';", "dataStoreLogFile": "/usr/local/tomcat/logs/datastore.log", "dataStoreInitConns": 10, "dataStoreMaxConns": 100, "dataStoreConnUsageLimit": 100, "dataStoreLogLevel": "debug", "maxUrlLength": 500}}, { "servlet-name": "cofaxEmail", "servlet-class": "org.cofax.cds.EmailServlet", "init-param": { "mailHost": "mail1", "mailHostOverride": "mail2"}}, { "servlet-name": "cofaxAdmin", "servlet-class": "org.cofax.cds.AdminServlet"}, { "servlet-name": "fileServlet", "servlet-class": "org.cofax.cds.FileServlet"}, { "servlet-name": "cofaxTools", "servlet-class": "org.cofax.cms.CofaxToolsServlet", "init-param": { "templatePath": "toolstemplates/", "log": 1, "logLocation": "/usr/local/tomcat/logs/CofaxTools.log", "logMaxSize": "", "dataLog": 1, "dataLogLocation": "/usr/local/tomcat/logs/dataLog.log", "dataLogMaxSize": "", "removePageCache": "/content/admin/remove?cache=pages&id=", "removeTemplateCache": "/content/admin/remove?cache=templates&id=", "fileTransferFolder": "/usr/local/tomcat/webapps/content/fileTransferFolder", "lookInContext": 1, "adminGroupID": 4, "betaServer": true}}], "servlet-mapping": { "cofaxCDS": "/", "cofaxEmail": "/cofaxutil/aemail/*", "cofaxAdmin": "/admin/*", "fileServlet": "/static/*", "cofaxTools": "/tools/*"}, "taglib": { "taglib-uri": "cofax.tld", "taglib-location": "/WEB-INF/tlds/cofax.tld"}}} task-2.2.0-test/json/5.json000064400000000000000000000015511213035135600154410ustar00rootroot00000000000000{"menu": { "header": "SVG Viewer", "items": [ {"id": "Open"}, {"id": "OpenNew", "label": "Open New"}, null, {"id": "ZoomIn", "label": "Zoom In"}, {"id": "ZoomOut", "label": "Zoom Out"}, {"id": "OriginalView", "label": "Original View"}, null, {"id": "Quality"}, {"id": "Pause"}, {"id": "Mute"}, null, {"id": "Find", "label": "Find..."}, {"id": "FindAgain", "label": "Find Again"}, {"id": "Copy"}, {"id": "CopyAgain", "label": "Copy Again"}, {"id": "CopySVG", "label": "Copy SVG"}, {"id": "ViewSVG", "label": "View SVG"}, {"id": "ViewSource", "label": "View Source"}, {"id": "SaveAs", "label": "Save As"}, null, {"id": "Help"}, {"id": "About", "label": "About Adobe CVG Viewer..."} ] }} task-2.2.0-test/json/6.json000064400000000000000000000025531213035135600154450ustar00rootroot00000000000000[{"styleFocus":"GROWTH","creationTime":"2008-01-21","preferences":{"kfe.elite-rankings":"hide","guitarPromoClosed":"1","kfe.last_viewed_feature":"1"},"nickName":"Pascal-Louis Perez","showFlag":true,"firstName":"Pascal-Louis","points":0,"id":8,"industryFocus":"TECHNOLOGY","externalIds":[{"platform":"FACEBOOK","id":219948}],"useRealName":true,"shard":8,"concentrationFocus":"LESS_THAN_10","passwordSalt":3567830610840546163,"validatedEmails":["pascal.louis.perez@gmail.com","pascal@kaching.com","pascal@cs.stanford.edu"],"city":"Geneve","rankLevel":"BASIC","experiences":["KACHING","DEVELOPMENT","LOGIN_SYSTEM","ADMIN","RESEARCH","RANKINGS"],"marketCapFocus":"LARGE","picture":"sqr8.jpg","interests":{"MY_WALL":["EMAIL"]},"nonValidatedEmails":["pascal.loui-s.perez@gmail.com"],"showPicture":true,"lastName":"Perez","tradingFrequencyFocus":"BUY_AND_HOLD","validatedPrimaryEmail":"pascal.louis.perez@gmail.com","country":"CH","sessions":[{"d":"p","parameters":{"facebookSessionKey":"a9f133eed207196a563b0ca7-219948","facebookUserId":"219948"},"k":"qOtXSepsfrc=","platform":"FACEBOOK"},{"d":"s","k":"O7p3i91IXa8="},{"d":"s","k":"fexhG/MSXr0="},{"d":"s","k":"YUkWZMK4ors="},{"d":"s","k":"ETfFsm0svdg="}],"primaryEmail":"pascal.louis.perez@gmail.com","investmentStrategy":"Hire people who can manage my assets for me. I'm lousy.","lastLogin":"2008-12-17 12:45:25.000","portfolioId":219948}] task-2.2.0-test/json/e1.json000064400000000000000000000000341213035135600155750ustar00rootroot00000000000000[ 100, 500, 300, 200, 400 ] task-2.2.0-test/json/e2.json000064400000000000000000000004751213035135600156070ustar00rootroot00000000000000[ { "color": "red", "value": "#f00" }, { "color": "green", "value": "#0f0" }, { "color": "blue", "value": "#00f" }, { "color": "cyan", "value": "#0ff" }, { "color": "magenta", "value": "#f0f" }, { "color": "yellow", "value": "#ff0" }, { "color": "black", "value": "#000" } ] task-2.2.0-test/json/e3.json000064400000000000000000000000461213035135600156020ustar00rootroot00000000000000{ "color": "red", "value": "#f00" } task-2.2.0-test/json/e4.json000064400000000000000000000011371213035135600156050ustar00rootroot00000000000000{ "id": "0001", "type": "donut", "name": "Cake", "ppu": 0.55, "batters": { "batter": [ { "id": "1001", "type": "Regular" }, { "id": "1002", "type": "Chocolate" }, { "id": "1003", "type": "Blueberry" }, { "id": "1004", "type": "Devil's Food" } ] }, "topping": [ { "id": "5001", "type": "None" }, { "id": "5002", "type": "Glazed" }, { "id": "5005", "type": "Sugar" }, { "id": "5007", "type": "Powdered Sugar" }, { "id": "5006", "type": "Chocolate with Sprinkles" }, { "id": "5003", "type": "Chocolate" }, { "id": "5004", "type": "Maple" } ] } task-2.2.0-test/json/e5.json000064400000000000000000000026321213035135600156070ustar00rootroot00000000000000[ { "id": "0001", "type": "donut", "name": "Cake", "ppu": 0.55, "batters": { "batter": [ { "id": "1001", "type": "Regular" }, { "id": "1002", "type": "Chocolate" }, { "id": "1003", "type": "Blueberry" }, { "id": "1004", "type": "Devil's Food" } ] }, "topping": [ { "id": "5001", "type": "None" }, { "id": "5002", "type": "Glazed" }, { "id": "5005", "type": "Sugar" }, { "id": "5007", "type": "Powdered Sugar" }, { "id": "5006", "type": "Chocolate with Sprinkles" }, { "id": "5003", "type": "Chocolate" }, { "id": "5004", "type": "Maple" } ] }, { "id": "0002", "type": "donut", "name": "Raised", "ppu": 0.55, "batters": { "batter": [ { "id": "1001", "type": "Regular" } ] }, "topping": [ { "id": "5001", "type": "None" }, { "id": "5002", "type": "Glazed" }, { "id": "5005", "type": "Sugar" }, { "id": "5003", "type": "Chocolate" }, { "id": "5004", "type": "Maple" } ] }, { "id": "0003", "type": "donut", "name": "Old Fashioned", "ppu": 0.55, "batters": { "batter": [ { "id": "1001", "type": "Regular" }, { "id": "1002", "type": "Chocolate" } ] }, "topping": [ { "id": "5001", "type": "None" }, { "id": "5002", "type": "Glazed" }, { "id": "5003", "type": "Chocolate" }, { "id": "5004", "type": "Maple" } ] } ] task-2.2.0-test/json/e6.json000064400000000000000000000003461213035135600156100ustar00rootroot00000000000000{ "id": "0001", "type": "donut", "name": "Cake", "image": { "url": "images/0001.jpg", "width": 200, "height": 200 }, "thumbnail": { "url": "images/thumbnails/0001.jpg", "width": 32, "height": 32 } } task-2.2.0-test/json/e7.json000064400000000000000000000014161213035135600156100ustar00rootroot00000000000000{ "items": { "item": [ { "id": "0001", "type": "donut", "name": "Cake", "ppu": 0.55, "batters": { "batter": [ { "id": "1001", "type": "Regular" }, { "id": "1002", "type": "Chocolate" }, { "id": "1003", "type": "Blueberry" }, { "id": "1004", "type": "Devil's Food" } ] }, "topping": [ { "id": "5001", "type": "None" }, { "id": "5002", "type": "Glazed" }, { "id": "5005", "type": "Sugar" }, { "id": "5007", "type": "Powdered Sugar" }, { "id": "5006", "type": "Chocolate with Sprinkles" }, { "id": "5003", "type": "Chocolate" }, { "id": "5004", "type": "Maple" } ] } ] } } task-2.2.0-test/json/e8.json000064400000000000000000000014201213035135600156040ustar00rootroot00000000000000{ "items": { "item": [ { "id": "0001", "type": "donut", "name": "Cake", "ppu": 0.55, "batters": { "batter": [ { "id": "1001", "type": "Regular" }, { "id": "1002", "type": "Chocolate" }, { "id": "1003", "type": "Blueberry" }, { "id": "1004", "type": "Devil's Food" } ] }, "topping": [ { "id": "5001", "type": "None" }, { "id": "5002", "type": "Glazed" }, { "id": "5005", "type": "Sugar" }, { "id": "5007", "type": "Powdered Sugar" }, { "id": "5006", "type": "Chocolate with Sprinkles" }, { "id": "5003", "type": "Chocolate" }, { "id": "5004", "type": "Maple" } ] } ] } } task-2.2.0-test/json/facebook.json000064400000000000000000000022541213035135600170470ustar00rootroot00000000000000{ "data": [ { "id": "X999_Y999", "from": { "name": "Tom Brady", "id": "X12" }, "message": "Looking forward to 2010!", "actions": [ { "name": "Comment", "link": "http://www.facebook.com/X999/posts/Y999" }, { "name": "Like", "link": "http://www.facebook.com/X999/posts/Y999" } ], "type": "status", "created_time": "2010-08-02T21:27:44+0000", "updated_time": "2010-08-02T21:27:44+0000" }, { "id": "X998_Y998", "from": { "name": "Peyton Manning", "id": "X18" }, "message": "Where's my contract?", "actions": [ { "name": "Comment", "link": "http://www.facebook.com/X998/posts/Y998" }, { "name": "Like", "link": "http://www.facebook.com/X998/posts/Y998" } ], "type": "status", "created_time": "2010-08-02T21:27:44+0000", "updated_time": "2010-08-02T21:27:44+0000" } ] } task-2.2.0-test/json/flikr.json000064400000000000000000000024011213035135600163770ustar00rootroot00000000000000{ "title": "Talk On Travel Pool", "link": "http://www.flickr.com/groups/talkontravel/pool/", "description": "Travel and vacation photos from around the world.", "modified": "2009-02-02T11:10:27Z", "generator": "http://www.flickr.com/", "items": [ { "title": "View from the hotel", "link": "http://www.flickr.com/photos/33112458@N08/3081564649/in/pool-998875@N22", "media": {"m":"http://farm4.static.flickr.com/3037/3081564649_4a6569750c_m.jpg"}, "date_taken": "2008-12-04T04:43:03-08:00", "description": "

Talk On Travel<\/a> has added a photo to the pool:<\/p>

\"View<\/a><\/p> ", "published": "2008-12-04T12:43:03Z", "author": "nobody@flickr.com (Talk On Travel)", "author_id": "33112458@N08", "tags": "spain dolphins tenerife canaries lagomera aqualand playadelasamericas junglepark losgigantos loscristines talkontravel" } ] } task-2.2.0-test/json/interop.json000064400000000000000000000036341213035135600167610ustar00rootroot00000000000000{ "ResultSet": { "totalResultsAvailable": "1827221", "totalResultsReturned": 2, "firstResultPosition": 1, "Result": [ { "Title": "potato jpg", "Summary": "Kentang Si bungsu dari keluarga Solanum tuberosum L ini ternyata memiliki khasiat untuk mengurangi kerutan jerawat bintik hitam dan kemerahan pada kulit Gunakan seminggu sekali sebagai", "Url": "http:\/\/www.mediaindonesia.com\/spaw\/uploads\/images\/potato.jpg", "ClickUrl": "http:\/\/www.mediaindonesia.com\/spaw\/uploads\/images\/potato.jpg", "RefererUrl": "http:\/\/www.mediaindonesia.com\/mediaperempuan\/index.php?ar_id=Nzkw", "FileSize": 22630, "FileFormat": "jpeg", "Height": "362", "Width": "532", "Thumbnail": { "Url": "http:\/\/thm-a01.yimg.com\/nimage\/557094559c18f16a", "Height": "98", "Width": "145" } }, { "Title": "potato jpg", "Summary": "Introduction of puneri aloo This is a traditional potato preparation flavoured with curry leaves and peanuts and can be eaten on fasting day Preparation time 10 min", "Url": "http:\/\/www.infovisual.info\/01\/photo\/potato.jpg", "ClickUrl": "http:\/\/www.infovisual.info\/01\/photo\/potato.jpg", "RefererUrl": "http:\/\/sundayfood.com\/puneri-aloo-indian-%20recipe", "FileSize": 119398, "FileFormat": "jpeg", "Height": "685", "Width": "1024", "Thumbnail": { "Url": "http:\/\/thm-a01.yimg.com\/nimage\/7fa23212efe84b64", "Height": "107", "Width": "160" } } ] } } task-2.2.0-test/json/iphone.json000064400000000000000000000033011213035135600165520ustar00rootroot00000000000000{ "menu": { "header": "xProgress SVG Viewer", "items": [ { "id": "Open" }, { "id": "OpenNew", "label": "Open New" }, null, { "id": "ZoomIn", "label": "Zoom In" }, { "id": "ZoomOut", "label": "Zoom Out" }, { "id": "OriginalView", "label": "Original View" }, null, { "id": "Quality" }, { "id": "Pause" }, { "id": "Mute" }, null, { "id": "Find", "label": "Find..." }, { "id": "FindAgain", "label": "Find Again" }, { "id": "Copy" }, { "id": "CopyAgain", "label": "Copy Again" }, { "id": "CopySVG", "label": "Copy SVG" }, { "id": "ViewSVG", "label": "View SVG" }, { "id": "ViewSource", "label": "View Source" }, { "id": "SaveAs", "label": "Save As" }, null, { "id": "Help" }, { "id": "About", "label": "About xProgress CVG Viewer..." } ] } } task-2.2.0-test/json/twitter.json000064400000000000000000000016161213035135600170010ustar00rootroot00000000000000{"results":[ {"text":"@twitterapi http:\/\/tinyurl.com\/ctrefg", "to_user_id":396524, "to_user":"TwitterAPI", "from_user":"jkoum", "metadata": { "result_type":"popular", "recent_retweets": 109 }, "id":1478555574, "from_user_id":1833773, "iso_language_code":"nl", "source":"twitter<\/a>", "profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/118412707\/2522215727_a5f07da155_b_normal.jpg", "created_at":"Wed, 08 Apr 2009 19:22:10 +0000"} ], "since_id":0, "max_id":1480307926, "refresh_url":"?since_id=1480307926&q=%40twitterapi", "results_per_page":15, "next_page":"?page=2&max_id=1480307926&q=%40twitterapi", "completed_in":0.031704, "page":1, "query":"%40twitterapi" } task-2.2.0-test/json/youtube.json000064400000000000000000000032121213035135600167650ustar00rootroot00000000000000{"apiVersion":"2.0", "data":{ "updated":"2010-01-07T19:58:42.949Z", "totalItems":800, "startIndex":1, "itemsPerPage":1, "items":[ {"id":"hYB0mn5zh2c", "uploaded":"2007-06-05T22:07:03.000Z", "updated":"2010-01-07T13:26:50.000Z", "uploader":"GoogleDeveloperDay", "category":"News", "title":"Google Developers Day US - Maps API Introduction", "description":"Google Maps API Introduction ...", "tags":[ "GDD07","GDD07US","Maps" ], "thumbnail":{ "default":"http://i.ytimg.com/vi/hYB0mn5zh2c/default.jpg", "hqDefault":"http://i.ytimg.com/vi/hYB0mn5zh2c/hqdefault.jpg" }, "player":{ "default":"http://www.youtube.com/watch?v\u003dhYB0mn5zh2c" }, "content":{ "1":"rtsp://v5.cache3.c.youtube.com/CiILENy.../0/0/0/video.3gp", "5":"http://www.youtube.com/v/hYB0mn5zh2c?f...", "6":"rtsp://v1.cache1.c.youtube.com/CiILENy.../0/0/0/video.3gp" }, "duration":2840, "aspectRatio":"widescreen", "rating":4.63, "ratingCount":68, "viewCount":220101, "favoriteCount":201, "commentCount":22, "status":{ "value":"restricted", "reason":"limitedSyndication" }, "accessControl":{ "syndicate":"allowed", "commentVote":"allowed", "rate":"allowed", "list":"allowed", "comment":"allowed", "embed":"allowed", "videoRespond":"moderated" } } ] } } task-2.2.0-test/json_test.cpp000064400000000000000000000053601213035135600161470ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { if (argc == 1) { std::cout << "\nUsage: json_test [-q] ...\n" << "\n" << " -q quiet, no JSON dump\n" << " file containing JSON\n" << " JSON string, may need to be quoted\n" << "\n"; return 0; } bool quiet = false; for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-q")) quiet = true; for (int i = 1; i < argc; ++i) { if (strcmp (argv[i], "-q")) { try { json::value* root; File file (argv[i]); if (file.exists ()) { std::string contents; file.read (contents); root = json::parse (contents); } else root = json::parse (argv[i]); if (root && !quiet) std::cout << root->dump () << "\n"; delete root; } catch (const std::string& e) { std::cout << e << "\n"; } catch (...) { std::cout << "Unknown error\n"; } } } return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/json_test.t000075500000000000000000000032201213035135600156240ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More; my @files = glob "./json/*.json"; plan tests => scalar @files; my $output; for my $file (@files) { $output = qx{./json_test $file 2>&1}; unlike ($output, qr/^Error/, "json_test $file"); } exit 0; task-2.2.0-test/label.t000075500000000000000000000052631213035135600147040ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 7; # Create the rc file. if (open my $fh, '>', 'custom.rc') { print $fh "data.location=.\n", "report.foo.description=DESC\n", "report.foo.labels=ID,DESCRIPTION\n", "report.foo.columns=id,description\n", "report.foo.sort=id+\n", "report.foo.filter=project:A\n"; close $fh; ok (-r 'custom.rc', 'Created custom.rc'); } # Generate the help screen, and locate the custom report on it. my $output = qx{../src/task rc:custom.rc help 2>&1}; like ($output, qr/task foo\s+DESC\n/m, 'report.foo'); qx{../src/task rc:custom.rc add project:A one 2>&1}; qx{../src/task rc:custom.rc add two 2>&1}; $output = qx{../src/task rc:custom.rc foo 2>&1}; like ($output, qr/ID/, 'custom label for id column'); like ($output, qr/DESCRIPTION/, 'custom label for description column'); like ($output, qr/one/, 'custom filter included'); unlike ($output, qr/two/, 'custom filter excluded'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key custom.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'custom.rc', 'Cleanup'); exit 0; task-2.2.0-test/limit.t000075500000000000000000000073421213035135600147430ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'limit.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'limit.rc', 'Created limit.rc'); } # Add a large number of tasks (> 25). qx{../src/task rc:limit.rc add one 2>&1}; qx{../src/task rc:limit.rc add two 2>&1}; qx{../src/task rc:limit.rc add three 2>&1}; qx{../src/task rc:limit.rc add four 2>&1}; qx{../src/task rc:limit.rc add five 2>&1}; qx{../src/task rc:limit.rc add six 2>&1}; qx{../src/task rc:limit.rc add seven 2>&1}; qx{../src/task rc:limit.rc add eight 2>&1}; qx{../src/task rc:limit.rc add nine 2>&1}; qx{../src/task rc:limit.rc add ten 2>&1}; qx{../src/task rc:limit.rc add eleven 2>&1}; qx{../src/task rc:limit.rc add twelve 2>&1}; qx{../src/task rc:limit.rc add thirteen 2>&1}; qx{../src/task rc:limit.rc add fourteen 2>&1}; qx{../src/task rc:limit.rc add fifteen 2>&1}; qx{../src/task rc:limit.rc add sixteen 2>&1}; qx{../src/task rc:limit.rc add seventeen 2>&1}; qx{../src/task rc:limit.rc add eighteen 2>&1}; qx{../src/task rc:limit.rc add nineteen 2>&1}; qx{../src/task rc:limit.rc add twenty 2>&1}; qx{../src/task rc:limit.rc add twenty one 2>&1}; qx{../src/task rc:limit.rc add twenty two 2>&1}; qx{../src/task rc:limit.rc add twenty three 2>&1}; qx{../src/task rc:limit.rc add twenty four 2>&1}; qx{../src/task rc:limit.rc add twenty five 2>&1}; qx{../src/task rc:limit.rc add twenty six 2>&1}; qx{../src/task rc:limit.rc add twenty seven 2>&1}; qx{../src/task rc:limit.rc add twenty eight 2>&1}; qx{../src/task rc:limit.rc add twenty nine 2>&1}; qx{../src/task rc:limit.rc add thirty 2>&1}; my $output = qx{../src/task rc:limit.rc ls 2>&1}; like ($output, qr/^30 tasks$/ms, 'unlimited'); $output = qx{../src/task rc:limit.rc ls limit:0 2>&1}; like ($output, qr/^30 tasks$/ms, 'limited to 0 - unlimited'); $output = qx{../src/task rc:limit.rc ls limit:3 2>&1}; like ($output, qr/^30 tasks, 3 shown$/ms, 'limited to 3'); $output = qx{../src/task rc:limit.rc ls limit:page 2>&1}; like ($output, qr/^30 tasks, truncated to 18 lines$/ms, 'limited to page'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key limit.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'limit.rc', 'Cleanup'); exit 0; task-2.2.0-test/list.all.projects.t000075500000000000000000000050461213035135600171760ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 8; # Create the rc file. if (open my $fh, '>', 'projects.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'projects.rc', 'Created projects.rc'); } # Create a data set of two tasks, with unique project names, one # pending, one completed. qx{../src/task rc:projects.rc add project:p1 one 2>&1}; qx{../src/task rc:projects.rc add project:p2 two 2>&1}; qx{../src/task rc:projects.rc 1 done 2>&1}; my $output = qx{../src/task rc:projects.rc ls 2>&1}; unlike ($output, qr/p1/, 'p1 done'); like ($output, qr/p2/, 'p2 pending'); $output = qx{../src/task rc:projects.rc projects 2>&1}; unlike ($output, qr/p1/, 'p1 done'); like ($output, qr/p2/, 'p2 pending'); $output = qx{../src/task rc:projects.rc rc.list.all.projects:yes projects 2>&1}; like ($output, qr/p1/, 'p1 listed'); like ($output, qr/p2/, 'p2 listed'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key projects.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'projects.rc', 'Cleanup'); exit 0; task-2.2.0-test/list.all.tags.t000075500000000000000000000050031213035135600162740ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 8; # Create the rc file. if (open my $fh, '>', 'tags.rc') { print $fh "data.location=.\n", "defaultwidth=100\n"; close $fh; ok (-r 'tags.rc', 'Created tags.rc'); } # Create a data set of two tasks, with unique project names, one # pending, one completed. qx{../src/task rc:tags.rc add +t1 one 2>&1}; qx{../src/task rc:tags.rc add +t2 two 2>&1}; qx{../src/task rc:tags.rc 1 done 2>&1}; my $output = qx{../src/task rc:tags.rc long 2>&1}; unlike ($output, qr/t1/, 't1 done'); like ($output, qr/t2/, 't2 pending'); $output = qx{../src/task rc:tags.rc tags 2>&1}; unlike ($output, qr/t1/, 't1 done'); like ($output, qr/t2/, 't2 pending'); $output = qx{../src/task rc:tags.rc rc.list.all.tags:yes tags 2>&1}; like ($output, qr/t1/, 't1 listed'); like ($output, qr/t2/, 't2 listed'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key tags.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'tags.rc', 'Cleanup'); exit 0; task-2.2.0-test/list.t.cpp000064400000000000000000000117441213035135600153570ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { UnitTest t (24); // 1,2,3 <=> 2,3,4 std::vector string_one; string_one.push_back ("1"); string_one.push_back ("2"); string_one.push_back ("3"); std::vector string_two; string_two.push_back ("2"); string_two.push_back ("3"); string_two.push_back ("4"); std::vector string_three; string_three.push_back ("2"); string_three.push_back ("3"); string_three.push_back ("4"); std::vector string_four; // Differences? t.ok (!listDiff (string_one, string_one), "std::string (1,2,3) == (1,2,3)"); t.ok (listDiff (string_one, string_two), "std::string (1,2,3) != (2,3,4)"); t.ok (listDiff (string_one, string_three), "std::string (1,2,3) != (2,3,4)"); t.ok (listDiff (string_one, string_four), "std::string (1,2,3) != ()"); t.ok (!listDiff (string_four, string_four), "std::string () == ()"); // What are the differences? std::vector string_leftOnly; std::vector string_rightOnly; listDiff (string_one, string_two, string_leftOnly, string_rightOnly); t.is ((int) string_leftOnly.size (), 1, "std::string (1,2,3) <=> (2,3,4) = 1<-"); t.is (string_leftOnly[0], "1", "std::string (1,2,3) <=> (2,3,4) = 1<-"); t.is ((int) string_rightOnly.size (), 1, "std::string (1,2,3) <=> (2,3,4) = ->4"); t.is (string_rightOnly[0], "4", "std::string (1,2,3) <=> (2,3,4) = ->4"); // What is the intersection? std::vector string_join; listIntersect (string_one, string_two, string_join); t.is ((int) string_join.size (), 2, "std::string (1,2,3) intersect (2,3,4) = (2,3)"); t.is (string_join[0], "2", "std::string (1,2,3) intersect (2,3,4) = (2,3)"); t.is (string_join[1], "3", "std::string (1,2,3) intersect (2,3,4) = (2,3)"); // Now do it all again, with integers. // 1,2,3 <=> 2,3,4 std::vector int_one; int_one.push_back (1); int_one.push_back (2); int_one.push_back (3); std::vector int_two; int_two.push_back (2); int_two.push_back (3); int_two.push_back (4); std::vector int_three; int_three.push_back (2); int_three.push_back (3); int_three.push_back (4); std::vector int_four; // Differences? t.ok (!listDiff (int_one, int_one), "int (1,2,3) == (1,2,3)"); t.ok (listDiff (int_one, int_two), "int (1,2,3) != (2,3,4)"); t.ok (listDiff (int_one, int_three), "int (1,2,3) != (2,3,4)"); t.ok (listDiff (int_one, int_four), "int (1,2,3) != ()"); t.ok (!listDiff (int_four, int_four), "int () == ()"); // What are the differences? std::vector int_leftOnly; std::vector int_rightOnly; listDiff (int_one, int_two, int_leftOnly, int_rightOnly); t.is ((int) int_leftOnly.size (), 1, "int (1,2,3) <=> (2,3,4) = 1<-"); t.is (int_leftOnly[0], "1", "int (1,2,3) <=> (2,3,4) = 1<-"); t.is ((int) int_rightOnly.size (), 1, "int (1,2,3) <=> (2,3,4) = ->4"); t.is (int_rightOnly[0], "4", "int (1,2,3) <=> (2,3,4) = ->4"); // What is the intersection? std::vector int_join; listIntersect (int_one, int_two, int_join); t.is ((int) int_join.size (), 2, "int (1,2,3) intersect (2,3,4) = (2,3)"); t.is (int_join[0], "2", "int (1,2,3) intersect (2,3,4) = (2,3)"); t.is (int_join[1], "3", "int (1,2,3) intersect (2,3,4) = (2,3)"); return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/log.t000075500000000000000000000041201213035135600143750ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'log.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'log.rc', 'Created log.rc'); } # Test the log command. qx{../src/task rc:log.rc log This is a test 2>&1}; my $output = qx{../src/task rc:log.rc completed 2>&1}; like ($output, qr/This is a test/, 'log description'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key log.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'log.rc', 'Cleanup'); exit 0; task-2.2.0-test/merge.duplicates.t000075500000000000000000000167301213035135600170610ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 31; use File::Copy; use File::Path; use constant false => 0; use constant true => 1; # Create data locations mkdir("data1", 0755); mkdir("data2", 0755); mkdir("data3", 0755); mkdir('backup', 0755); ok(-e 'data1', "Created directory data1"); ok(-e 'data2', "Created directory data2"); ok(-e 'data3', "Created directory data3"); ok(-e 'backup', "Created directory backup"); # Create the rc files. if (open my $fh, '>', '1.rc') { print $fh "data.location=./data1\n", "confirmation=no\n", "merge.autopush=yes\n", "merge.default.uri=./backup/\n", "report.list.description=DESC\n", "report.list.columns=id,project,active,priority,description,tags\n", "report.list.labels=id,pro,a,pri,d,t\n", "report.list.sort=id+\n", "report.list.filter=status:pending\n"; close $fh; ok (-r '1.rc', 'Created 1.rc'); } # Create the rc files. if (open my $fh, '>', '2.rc') { print $fh "data.location=./data2\n", "confirmation=no\n", "merge.autopush=yes\n", "merge.default.uri=./backup/\n", "report.list.description=DESC\n", "report.list.columns=id,project,active,priority,description,tags\n", "report.list.labels=id,pro,a,pri,d,t\n", "report.list.sort=id+\n", "report.list.filter=status:pending\n"; close $fh; ok (-r '2.rc', 'Created 2.rc'); } # Create the rc files. if (open my $fh, '>', '3.rc') { print $fh "data.location=./data3\n", "confirmation=no\n", "merge.autopush=yes\n", "merge.default.uri=./backup/\n", "report.list.description=DESC\n", "report.list.columns=id,project,active,priority,description,tags\n", "report.list.labels=id,pro,a,pri,d,t\n", "report.list.sort=id+\n", "report.list.filter=status:pending\n"; close $fh; ok (-r '3.rc', 'Created 3.rc'); } ####################################### # Create tasks on 1st resource qx{../src/task rc:1.rc add Task1 2>&1}; diag ("7 second delay"); sleep(1); qx{../src/task rc:1.rc add Task2 2>&1}; sleep(1); qx{../src/task rc:1.rc add Task3 2>&1}; sleep(1); qx{../src/task rc:1.rc add Task4 2>&1}; # Merge with backup my $output = qx{../src/task rc:1.rc push ./backup/ 2>&1}; ####################################### # Modify on 2nd resource # first merge $output = qx{../src/task rc:2.rc merge 2>&1}; like ($output, qr/Merge complete/, "res2: pre-merge completed"); # complete Task1 qx{../src/task rc:2.rc 1 done 2>&1}; sleep(1); ####################################### # Modify on 3rd resource # first merge $output = qx{../src/task rc:3.rc merge 2>&1}; like ($output, qr/Merge complete/, "res3: pre-merge completed"); # complete Task1 qx{../src/task rc:3.rc 1 done 2>&1}; sleep(1); # now merge 3rd resource $output = qx{../src/task rc:3.rc merge 2>&1}; like ($output, qr/Merge complete/, "res3: post-merge completed"); unlike ($output, qr/Missing/, "no missing entry"); # and merge 2nd resource $output = qx{../src/task rc:2.rc merge 2>&1}; like ($output, qr/Merge complete/, "res2: post-merge completed"); unlike ($output, qr/Missing/, "no missing entry"); # merge 3rd $output = qx{../src/task rc:3.rc merge 2>&1}; like ($output, qr/Merge complete/, "res3: post-merge completed"); unlike ($output, qr/Missing/, "no missing entry"); like ($output, qr/Retain/, "retained changes"); # 16 # pre-merge 1st $output = qx{../src/task rc:1.rc merge 2>&1}; like ($output, qr/Merge complete/, "res1: pre-merge completed"); # 17 unlike ($output, qr/Missing/, "no missing entry"); qx{../src/task rc:1.rc add Task5 2>&1}; sleep(1); qx{../src/task rc:1.rc 4 done 2>&1}; sleep(1); # merge $output = qx{../src/task rc:1.rc merge 2>&1}; like ($output, qr/Merge complete/, "res1: post-merge completed"); unlike ($output, qr/Missing/, "no missing entry"); # pre-merge 2nd res $output = qx{../src/task rc:2.rc merge 2>&1}; like ($output, qr/Merge complete/, "res2: pre-merge completed"); unlike ($output, qr/Missing/, "no missing entry"); # merge $output = qx{../src/task rc:1.rc merge 2>&1}; like ($output, qr/up-to-date/, "res1: up-to-date"); unlike ($output, qr/Missing/, "no missing entry"); # pre-merge 2nd res $output = qx{../src/task rc:2.rc merge 2>&1}; like ($output, qr/up-to-date/, "res2: up-to-date"); unlike ($output, qr/Missing/, "no missing entry"); # Cleanup. unlink qw(data1/pending.data data1/completed.data data1/undo.data data1/undo.save data1/backlog.data data1/synch.key 1.rc); ok (! -r 'data1/pending.data' && ! -r 'data1/completed.data' && ! -r 'data1/undo.data' && ! -r 'data1/undo.save' && ! -r 'data1/backlog.data' && ! -r 'data1/synch.key' && ! -r '1.rc', 'data1 Cleanup'); unlink qw(data2/pending.data data2/completed.data data2/undo.data data2/undo.save data2/backlog.data data2/synch.key 2.rc); ok (! -r 'data2/pending.data' && ! -r 'data2/completed.data' && ! -r 'data2/undo.data' && ! -r 'data2/undo.save' && ! -r 'data2/backlog.data' && ! -r 'data2/synch.key' && ! -r '2.rc', 'data2 Cleanup'); unlink qw(data3/pending.data data3/completed.data data3/undo.data data3/undo.save data3/backlog.data data3/synch.key 3.rc); ok (! -r 'data3/pending.data' && ! -r 'data3/completed.data' && ! -r 'data3/undo.data' && ! -r 'data3/undo.save' && ! -r 'data3/backlog.data' && ! -r 'data3/synch.key' && ! -r '3.rc', 'data3 Cleanup'); unlink qw(backup/pending.data backup/completed.data backup/undo.data backup/undo.save backup/backlog.data backup/synch.key); ok (! -r 'backup/pending.data' && ! -r 'backup/completed.data' && ! -r 'backup/undo.data' && ! -r 'backup/undo.save' && ! -r 'backup/backlog.data' && ! -r 'backup/synch.key', 'backup Cleanup'); rmtree (['data1/extensions', 'data1', 'data2/extensions', 'data2', 'data3/extensions', 'data3', 'backup/extensions', 'backup'], 0, 1); ok (! -e 'data1/extensions' && ! -e 'data1' && ! -e 'data2/extensions' && ! -e 'data2' && ! -e 'data3/extensions' && ! -e 'data3' && ! -e 'backup/extensions' && ! -e 'backup', 'Removed dir local'); exit 0; task-2.2.0-test/merge.simple_duplication.t000075500000000000000000000107311213035135600206030ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use File::Copy; use File::Path; use Test::More tests => 16; mkdir("1", 0755); mkdir("2", 0755); mkdir("dropbox", 0755); ok (-e "1", 'Created directory 1/'); ok (-e "2", 'Created directory 2/'); ok (-e "dropbox", 'Created directory dropbox/'); # Create the rc file. if (open my $fh, '>', '1.rc') { print $fh "data.location=1/\n"; print $fh "confirmation=no\n"; print $fh "merge.autopush=yes\n"; print $fh "merge.default.uri=./dropbox/\n"; print $fh "push.default.uri=./dropbox/\n"; print $fh "pull.default.uri=./dropbox/\n"; close $fh; ok (-r '1.rc', 'Created 1.rc'); } # Create the rc file. if (open my $fh, '>', '2.rc') { print $fh "data.location=2/\n"; print $fh "confirmation=no\n"; print $fh "merge.autopush=yes\n"; print $fh "merge.default.uri=./dropbox/\n"; print $fh "push.default.uri=./dropbox/\n"; print $fh "pull.default.uri=./dropbox/\n"; close $fh; ok (-r '2.rc', 'Created 2.rc'); } # Once-only push from 1 --> dropbox my $output = qx{../src/task rc:1.rc add one 2>&1}; ok ($? == 0, 'Exit status check'); $output = qx{../src/task rc:1.rc push 2>&1}; ok ($? == 0, 'Exit status check'); # Merges to 2 $output = qx{../src/task rc:2.rc merge 2>&1}; ok ($? == 0, 'Exit status check'); # Add a task to 1 $output = qx{../src/task rc:1.rc add two 2>&1}; ok ($? == 0, 'Exit status check'); # Add with a later timestamp to 2 qx{sleep 1}; $output = qx{../src/task rc:2.rc add three 2>&1}; ok ($? == 0, 'Exit status check'); # Only completing this task triggers duplications $output = qx{../src/task rc:2.rc three done 2>&1}; ok ($? == 0, 'Exit status check'); # Merge/update the dropbox $output = qx{../src/task rc:2.rc merge 2>&1}; ok ($? == 0, 'Exit status check'); # Merge to 1, which means that the new task on 1 # will be inserted before the modifications of 2 $output = qx{../src/task rc:1.rc merge 2>&1}; ok ($? == 0, 'Exit status check'); # Merging to 2 now triggers the duplications because # both sides have exactly the same modifications # (creation and deletion of a task) after # the branch point $output = qx{../src/task rc:2.rc merge 2>&1}; ok ($? == 0, 'Exit status check'); # Cleanup. unlink qw(1.rc 1/pending.data 1/completed.data 1/undo.data 1/backlog.data 1/synch.key 2/pending.data 2/completed.data 2/undo.data 2.rc 2/backlog.data 2/synch.key dropbox/completed.data dropbox/pending.data dropbox/undo.data); ok (! -r '1/pending.data' && ! -r '1/completed.data' && ! -r '1/undo.data' && ! -r '1/backlog.data' && ! -r '1/synch.key' && ! -r '1.rc' && ! -r '2/pending.data' && ! -r '2/completed.data' && ! -r '2/undo.data' && ! -r '2/backlog.data' && ! -r '2/synch.key' && ! -r '2.rc' && ! -r 'dropbox/pending.data' && ! -r 'dropbox/completed.data' && ! -r 'dropbox/undo.data' , 'Cleanup'); rmtree (['1', '2', 'dropbox'], 0, 1); ok (! -e '1' && ! -e '2' && ! -e 'dropbox', 'Removed directories'); exit 0; task-2.2.0-test/merge.t000075500000000000000000000226411213035135600147230ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 33; use File::Copy; use File::Path; use constant false => 0; use constant true => 1; # Create data locations mkdir("local", 0755); ok(-e 'local', "Created directory local"); mkdir("remote", 0755); ok(-e 'remote', "Created directory remote"); # Create the rc files. if (open my $fh, '>', 'local.rc') { print $fh "data.location=./local\n", "confirmation=no\n", "merge.autopush=no\n", "report.list.description=DESC\n", "report.list.columns=id,project,start.active,priority,description,tags\n", "report.list.labels=id,pro,a,pri,d,t\n", "report.list.sort=id+\n", "report.list.filter=status:pending\n"; close $fh; ok (-r 'local.rc', 'Created local.rc'); } if (open my $fh, '>', 'remote.rc') { print $fh "data.location=./remote\n", "confirmation=no\n", "merge.autopush=no\n", "report.list.description=DESC\n", "report.list.columns=id,project,start.active,priority,description,tags\n", "report.list.labels=id,pro,a,pri,d,t\n", "report.list.sort=id+\n", "report.list.filter=status:pending\n"; close $fh; ok (-r 'remote.rc', 'Created remote.rc'); } # Create some basic tasks on both sides qx{../src/task rc:local.rc add left_modified 2>&1}; diag ("25 second delay"); sleep 1; qx{../src/task rc:local.rc add right_modified 2>&1}; sleep 1; qx{../src/task rc:local.rc add left_newer 2>&1}; sleep 1; qx{../src/task rc:local.rc add right_newer 2>&1}; sleep 1; qx{../src/task rc:local.rc add left_deleted 2>&1}; sleep 1; qx{../src/task rc:local.rc add right_deleted 2>&1}; sleep 1; qx{../src/task rc:local.rc add left_completed 2>&1}; sleep 1; qx{../src/task rc:local.rc add right_completed 2>&1}; sleep 1; copy ("local/undo.data", "remote/undo.data"); copy ("local/pending.data", "remote/pending.data"); copy ("local/completed.data", "remote/completed.data"); # make local modifications qx{../src/task rc:local.rc add left_added 2>&1}; #left_added sleep 1; qx{../src/task rc:local.rc 1 modify prio:H 2>&1}; #left_modified sleep 1; qx{../src/task rc:local.rc 3 modify +stay 2>&1}; #left_newer sleep 1; qx{../src/task rc:local.rc 4 modify project:test 2>&1}; #right_newer sleep 1; qx{../src/task rc:local.rc 6 modify +delete 2>&1}; #right_deleted sleep 1; # make remote modifications qx{../src/task rc:remote.rc add right_added 2>&1}; #right_added sleep 1; qx{../src/task rc:remote.rc 2 modify prio:L 2>&1}; #right_modified sleep 1; qx{../src/task rc:remote.rc 2 modify wait:tomorrow 2>&1}; #right_modified sleep 1; qx{../src/task rc:remote.rc 4 modify proj:realProject 2>&1}; #right_newer sleep 1; qx{../src/task rc:remote.rc 5 modify project:deletion 2>&1}; #left_deleted sleep 1; qx{../src/task rc:remote.rc 8 done 2>&1}; #right_completed sleep 1; qx{../src/task rc:remote.rc 6 del 2>&1}; #right_deleted sleep 1; qx{../src/task rc:remote.rc 3 done 2>&1}; #left_newer sleep 1; # make new local modifications qx{../src/task rc:local.rc 3 start 2>&1}; #left_newer sleep 1; qx{../src/task rc:local.rc 4 modify +car 2>&1}; #right_newer sleep 1; qx{../src/task rc:local.rc 7 done 2>&1}; #left_completed sleep 1; qx{../src/task rc:local.rc 5 del 2>&1}; #left_deleted sleep 1; # make new remote modifications qx{../src/task rc:remote.rc 4 modify +gym 2>&1}; # right_newer # merge remote into local copy ("local/undo.data", "local/undo.save"); my $output_l = qx{../src/task rc:local.rc merge remote/ 2>&1}; #check output unlike ($output_l, qr/Missing/, "local-merge: no missing entry"); unlike ($output_l, qr/Not adding duplicate/, "local-merge: no duplicates"); # merge local into remote my $output_r = qx{../src/task rc:remote.rc merge local/undo.save 2>&1}; # check output unlike ($output_r, qr/Missing/, "remote-merge: no missing entry"); unlike ($output_r, qr/Not adding duplicate/, "remote-merge: no duplicates"); # check reports my $report_l = qx{../src/task rc:local.rc list 2>&1}; my $report_r = qx{../src/task rc:remote.rc list 2>&1}; # local-merge like ($report_l, qr/left_added/, "local-merge: left_added is present"); like ($report_l, qr/right_added/, "local-merge: right_added is present"); like ($report_l, qr/H.*left_modified/, "local-merge: left_modified ok"); like ($report_l, qr/\*.*left_newer.*stay/, "local-merge: left_newer ok, undo-completed"); like ($report_l, qr/realProject.*right_newer.*gym/, "local-merge: right_newer ok"); $report_l = qx{../src/task rc:local.rc export 2>&1}; like ($report_l, qr/left_deleted.*deleted/, "local-merge: left_deleted ok"); like ($report_l, qr/right_deleted.*deleted/, "local-merge: right_deleted ok"); like ($report_l, qr/left_completed.*completed/, "local-merge: left_completed ok"); like ($report_l, qr/right_completed.*completed/, "local-merge: right_completed ok"); $report_l = qx{../src/task rc:local.rc waiting 2>&1}; like ($report_l, qr/L.*right_modified/, "local-merge: right_modified ok"); # remote-merge like ($report_r, qr/left_added/, "remote-merge: left_added is present"); like ($report_r, qr/right_added/, "remote-merge: right_added is present"); like ($report_r, qr/H.*left_modified/, "remote-merge: left_modified ok"); like ($report_r, qr/\*.*left_newer.*stay/, "remote-merge: left_newer ok"); like ($report_r, qr/realProject.*right_newer.*gym/, "remote-merge: right_newer ok"); $report_r = qx{../src/task rc:remote.rc export 2>&1}; like ($report_r, qr/left_deleted.*deleted/, "remote-merge: left_deleted ok"); like ($report_r, qr/right_deleted.*deleted/, "remote-merge: right_deleted ok"); like ($report_r, qr/left_completed.*completed/, "remote-merge: left_completed ok"); like ($report_r, qr/right_completed.*completed/, "remote-merge: right_completed ok"); $report_r = qx{../src/task rc:remote.rc waiting 2>&1}; like ($report_r, qr/L.*right_modified/, "remote-merge: right_modified ok"); # check timestamps in undo.data my $good = true; if (open my $fh, 'local/undo.data') { my $lasttime = 0; while (!eof($fh)) { if (defined ($_ = <$fh>)) { if ($_ =~ m/^time (\d+)/) { my $time = $1 + 0; if ($time <= $lasttime) { fail ("timestamps in local/undo.data are not monotonically ordered"); $good = false; } $lasttime = $time; } } } close $fh; } else { fail ("could not open local/undo.data"); } ok ($good, "local-merge: timestamps ok"); $good = true; if (open my $fh, 'remote/undo.data') { my $lasttime = 0; while (!eof($fh)) { if (defined ($_ = <$fh>)) { if ($_ =~ m/^time (\d+)/) { my $time = $1 + 0; if ($time <= $lasttime) { fail ("timestamps in remote/undo.data are not monotonically ordered"); $good = false; } $lasttime = $time; } } } close $fh; } else { fail ("could not open remote/undo.data"); } ok ($good, "remote-merge: timestamps ok"); # Cleanup. unlink qw(local/pending.data local/completed.data local/undo.data local/undo.save local/backlog.data local/synch.key local.rc); ok (! -r 'local/pending.data' && ! -r 'local/completed.data' && ! -r 'local/undo.data' && ! -r 'local/undo.save' && ! -r 'local/backlog.data' && ! -r 'local/synch.key' && ! -r 'local.rc', 'Local Cleanup'); unlink qw(remote/pending.data remote/completed.data remote/undo.data remote/backlog.data remote/synch.key remote.rc); ok (! -r 'remote/pending.data' && ! -r 'remote/completed.data' && ! -r 'remote/undo.data' && ! -r 'remote/backlog.data' && ! -r 'remote/synch.key' && ! -r 'remote.rc', 'Remove Cleanup'); rmtree (['remote/extensions', 'remote', 'local/extensions', 'local'], 0, 1); ok (! -e 'remote/extensions' && ! -e 'remote' && ! -e 'local/extensions' && ! -e 'local', 'Removed dir local'); exit 0; task-2.2.0-test/nag.t000075500000000000000000000054531213035135600143730ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 8; # Create the rc file. if (open my $fh, '>', 'nag.rc') { print $fh "data.location=.\n", "nag=NAG\n"; close $fh; ok (-r 'nag.rc', 'Created nag.rc'); } my $setup = "../src/task rc:nag.rc add due:yesterday one 2>&1;" . "../src/task rc:nag.rc add due:tomorrow two 2>&1;" . "../src/task rc:nag.rc add priority:H three 2>&1;" . "../src/task rc:nag.rc add priority:M four 2>&1;" . "../src/task rc:nag.rc add priority:L five 2>&1;" . "../src/task rc:nag.rc add six 2>&1;"; qx{$setup}; like (qx{../src/task rc:nag.rc 6 do 2>&1 >/dev/null}, qr/NAG/, 'do pri: -> nag'); like (qx{../src/task rc:nag.rc 5 do 2>&1 >/dev/null}, qr/NAG/, 'do pri:L -> nag'); like (qx{../src/task rc:nag.rc 4 do 2>&1 >/dev/null}, qr/NAG/, 'do pri:M-> nag'); like (qx{../src/task rc:nag.rc 3 do 2>&1 >/dev/null}, qr/NAG/, 'do pri:H-> nag'); like (qx{../src/task rc:nag.rc 2 do 2>&1 >/dev/null}, qr/NAG/, 'do due:tomorrow -> nag'); my $output = qx{../src/task rc:nag.rc 1 do 2>&1 >/dev/null}; unlike ($output, qr/NAG/, 'do due:yesterday -> no nag'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key nag.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'nag.rc', 'Cleanup'); exit 0; task-2.2.0-test/next.t000075500000000000000000000045551213035135600146060ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'next.rc') { print $fh "data.location=.\n", "next=1\n"; close $fh; ok (-r 'next.rc', 'Created next.rc'); } # Add two tasks for each of two projects, then run next. There should be only # one task from each project shown. qx{../src/task rc:next.rc add project:A priority:H AH 2>&1}; qx{../src/task rc:next.rc add project:A priority:M AM 2>&1}; qx{../src/task rc:next.rc add project:B priority:H BH 2>&1}; qx{../src/task rc:next.rc add project:B Bnone 2>&1}; my $output = qx{../src/task rc:next.rc next 2>&1}; like ($output, qr/AH/, 'AH shown'); like ($output, qr/BH/, 'BH shown'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key next.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'next.rc', 'Cleanup'); exit 0; task-2.2.0-test/nibbler.t.cpp000064400000000000000000001146371213035135600160260ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #ifdef NIBBLER_FEATURE_DATE #include #endif #include Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { #ifdef NIBBLER_FEATURE_DATE #ifdef NIBBLER_FEATURE_REGEX UnitTest t (396); #else UnitTest t (372); #endif #else #ifdef NIBBLER_FEATURE_REGEX UnitTest t (346); #else UnitTest t (322); #endif #endif try { Nibbler n; std::string s; int i; double d; time_t ti; #ifdef NIBBLER_FEATURE_DATE Date dt; #endif std::vector options; // Make sure the nibbler behaves itself with trivial input. t.diag ("Test all nibbler calls given empty input"); n = Nibbler (""); t.notok (n.getUntil (' ', s), "trivial: getUntil"); t.notok (n.getUntil ("hi", s), "trivial: getUntil"); t.notok (n.getUntilOneOf ("ab", s), "trivial: getUntilOneOf"); t.notok (n.skipN (123), "trivial: skipN"); t.notok (n.skip ('x'), "trivial: skip"); t.notok (n.skipAll ('x'), "trivial: skipAll"); t.notok (n.skipAllOneOf ("abc"), "trivial: skipAllOneOf"); t.notok (n.getQuoted ('"', s), "trivial: getQuoted"); t.notok (n.getDigit (i), "trivial: getDigit"); t.notok (n.getInt (i), "trivial: getInt"); // 10 t.notok (n.getHex (i), "trivial: getHex"); t.notok (n.getUnsignedInt (i), "trivial: getUnsignedInt"); t.notok (n.getUntilEOL (s), "trivial: getUntilEOL"); t.notok (n.getUntilEOS (s), "trivial: getUntilEOS"); t.notok (n.getDateISO (ti), "trivial: getDateISO"); #ifdef NIBBLER_FEATURE_DATE t.notok (n.getDate ("YYYYMMDD", ti), "trivial: getDate"); #endif t.notok (n.getOneOf (options, s), "trivial: getOneOf"); t.ok (n.depleted (), "trivial: depleted"); // bool getUntil (char, std::string&); t.diag ("Nibbler::getUntil"); n = Nibbler ("one two"); t.ok (n.getUntil (' ', s), " 'one two' : getUntil (' ') -> true"); t.is (s, "one", " 'one two' : getUntil (' ') -> 'one'"); // 20 t.ok (n.getUntil (' ', s), " ' two' : getUntil (' ') -> true"); t.is (s, "", " ' two' : getUntil (' ') -> ''"); t.ok (n.skip (' '), " ' two' : skip (' ') -> true"); t.ok (n.getUntil (' ', s), " 'two' : getUntil (' ') -> 'two'"); t.notok (n.getUntil (' ', s), " '' : getUntil (' ') -> false"); t.ok (n.depleted (), " '' : depleted () -> true"); #ifdef NIBBLER_FEATURE_REGEX // bool getUntilRx (const std::string&, std::string&); t.diag ("Nibbler::getUntilRx"); n = Nibbler ("one two"); t.ok (n.getUntilRx ("th", s), " 'one two' : getUntilRx ('th') -> true"); t.is (s, "one two", " 'one two' : getUntilRx ('th') -> 'one two'"); n = Nibbler ("one two"); t.ok (n.getUntilRx ("e", s), " 'one two' : getUntilRx ('e') -> true"); t.is (s, "on", " 'one two' : getUntilRx ('e') -> 'on'"); // 30 t.ok (n.getUntilRx ("tw", s), " 'e two' : getUntilRx ('tw') -> true"); t.is (s, "e ", " 'e two' : getUntilRx ('tw') -> 'e '"); t.ok (n.getUntilRx ("$", s), " 'two' : getUntilRx ('$') -> true"); t.is (s, "two", " 'two' : getUntilRx ('$') -> 'two'"); t.ok (n.depleted (), " '' : depleted () -> true"); #endif // bool getUntilOneOf (const std::string&, std::string&); t.diag ("Nibbler::getUntilOneOf"); n = Nibbler ("ab.cd"); t.ok (n.getUntilOneOf (".:", s), " 'ab.cd' : getUntilOneOf ('.:') -> true"); t.is (s, "ab", " 'ab.cd' : getUntilOneOf ('.:') -> 'ab'"); t.ok (n.skipN (), " '.cd' : skipN () -> true"); t.ok (n.getUntilOneOf (".:", s), " 'cd' : getUntilOneOf ('.:') -> true"); t.notok (n.getUntilOneOf (".:", s), " '' : getUntilOneOf ('.:') -> false"); t.ok (n.depleted (), " '' : depleted () -> true"); // bool getUntil (const std::string&, std::string&); t.diag ("Nibbler::getUntil"); n = Nibbler ("ab\r\ncd"); t.ok (n.getUntil ("\r\n", s), "'ab\\r\\ncd' : getUntil ('\\r\\n') -> true"); t.ok (n.skipN (2), " '\\r\\ncd' : skipN (2) -> true"); t.ok (n.getUntil ("\r\n", s), " 'cd' : getUntil ('\\r\\n') -> true"); t.ok (n.depleted (), " '' : depleted () -> true"); // bool getUntilWS (std::string&); t.diag ("Nibbler::getUntilWS"); n = Nibbler ("ab \t\ncd"); t.ok (n.getUntilWS (s), " 'ab \\t\\ncd' : getUntilWS () -> true"); t.is (s, "ab", " 'ab \\t\\ncd' : getUntilWS () -> 'ab'"); t.ok (n.getUntilWS (s), " ' \\t\\ncd' : getUntilWS () -> true"); t.is (s, "", " ' \\t\\ncd' : getUntilWS () -> ''"); t.ok (n.skipWS (), " 'cd' : skipWS () -> true"); t.ok (n.getUntilWS (s), " '' : getUntilWS () -> true"); t.is (s, "cd", " 'cd' : getUntilWS () -> 'cd'"); t.ok (n.depleted (), " '' : depleted () -> true"); // bool skipN (const int quantity = 1); t.diag ("Nibbler::skipN"); n = Nibbler ("abcde"); t.ok (n.skipN (), " 'abcde' : skipN () -> true"); t.ok (n.skipN (2), " 'bcde' : skipN (2 -> true"); t.notok (n.skipN (3), " 'de' : skipN (3 -> false"); t.notok (n.depleted (), " 'de' : depleted () -> true"); // bool skip (char); t.diag ("Nibbler::skip"); n = Nibbler (" a"); t.ok (n.skip (' '), " ' a' : skip (' ') -> true"); t.ok (n.skip (' '), " ' a' : skip (' ') -> true"); t.notok (n.skip (' '), " 'a' : skip (' ') -> false"); t.notok (n.depleted (), " 'a' : depleted () -> false"); t.ok (n.skip ('a'), " 'a' : skip ('a') -> true"); t.ok (n.depleted (), " '' : depleted () -> true"); // bool skipAll (char); t.diag ("Nibbler::skipAll"); n = Nibbler ("aaaabb"); t.ok (n.skipAll ('a'), " 'aaaabb' : skipAll ('a') -> true"); t.notok (n.skipAll ('a'), " 'bb' : skipAll ('a') -> false"); t.ok (n.skipAll ('b'), " 'bb' : skipAll ('b') -> true"); t.notok (n.skipAll ('b'), " '' : skipAll ('b') -> false"); t.ok (n.depleted (), " '' : depleted () -> true"); // bool skipAllOneOf (const std::string&); t.diag ("Nibbler::skipAllOneOf"); n = Nibbler ("abababcc"); t.ok (n.skipAllOneOf ("ab"), "'abababcc' : skipAllOneOf ('ab') -> true"); t.notok (n.skipAllOneOf ("ab"), " 'cc' : skipAllOneOf ('ab') -> false"); t.ok (n.skipAllOneOf ("c"), " 'cc' : skipAllOneOf ('ab') -> false"); t.ok (n.depleted (), " '' : depleted () -> true"); // bool skipWS (); t.diag ("Nibbler::skipWS"); n = Nibbler (" \tfoo"); t.ok (n.skipWS (), " ' \\tfoo' : skipWS () -> true"); t.notok (n.skipWS (), " 'foo' : skipWS () -> false"); t.ok (n.getUntilEOS (s), " 'foo' : getUntilEOS () -> true"); t.is (s, "foo", " 'foo' : getUntilEOS () -> 'foo'"); t.ok (n.depleted (), " '' : depleted () -> true"); #ifdef NIBBLER_FEATURE_REGEX // bool skipRx (const std::string&); t.diag ("Nibbler::skipRx"); n = Nibbler ("one two"); t.ok (n.skipRx ("o."), " 'one two' : skipRx ('o.') -> true"); t.notok (n.skipRx ("A+"), " 'e two' : skipRx ('A+') -> false"); t.ok (n.skipRx ("e+"), " 'e two' : skipRx ('e+') -> true"); t.ok (n.skipRx ("...."), " ' two' : skipRx ('....') -> true"); t.ok (n.depleted (), " '' : depleted () -> true"); #endif // bool getQuoted (char, std::string&); t.diag ("Nibbler::getQuoted"); n = Nibbler ("''"); t.ok (n.getQuoted ('\'', s), " '''' : getQuoted (''') -> true"); t.is (s, "", " '''' : getQuoted (''') -> ''"); n = Nibbler ("'\"'"); t.ok (n.getQuoted ('\'', s), " ''\"'' : getQuoted (''') -> true"); t.is (s, "\"", " ''\"'' : getQuoted (''') -> '\"'"); n = Nibbler ("'x'"); t.ok (n.getQuoted ('\'', s), " ''x'' : getQuoted (''') -> true"); t.is (s, "x", " ''x'' : getQuoted (''') -> ''"); n = Nibbler ("'x"); t.notok (n.getQuoted ('\'', s), " ''x' : getQuoted (''') -> false"); n = Nibbler ("x"); t.notok (n.getQuoted ('\'', s), " 'x' : getQuoted (''') -> false"); // 90 n = Nibbler ("\"one\\\"two\""); t.notok (n.getQuoted ('\'', s), "\"one\\\"two\" : getQuoted (''') -> false"); n = Nibbler ("\"one\\\"two\""); t.ok (n.getQuoted ('"', s, false), "\"one\\\"two\" : getQuoted ('\"', false, false) -> true"); t.is (s, "one\\\"two", "getQuoted ('\"', false) -> one\\\"two"); n = Nibbler ("\"one\\\"two\""); t.ok (n.getQuoted ('"', s, true), "\"one\\\"two\" : getQuoted ('\"', false, true) -> true"); t.is (s, "\"one\\\"two\"", "getQuoted ('\"', true) -> \"one\\\"two\""); n = Nibbler ("\"one\\\"two\""); t.ok (n.getQuoted ('"', s, false), "\"one\\\"two\" : getQuoted ('\"', true, false) -> true"); t.is (s, "one\\\"two", "getQuoted ('\"', false) -> one\\\"two"); n = Nibbler ("\"one\\\"two\""); t.ok (n.getQuoted ('"', s, true), "\"one\\\"two\" : getQuoted ('\"', s, true) -> true"); t.is (s, "\"one\\\"two\"", "getQuoted ('\"', s, true) -> \"one\\\"two\""); n = Nibbler ("\"one\\\\\""); t.ok (n.getQuoted ('\"', s, true), "\"one\\\" : getQuoted ('\"', s, true) -> true"); t.is (s, "\"one\\\\\"", "getQuoted ('\"', s, true) -> \"one\\\\\""); n = Nibbler ("\"one\\\\\""); t.ok (n.getQuoted ('\"', s, false), "one\\ : getQuoted ('\"', s, false) -> true"); t.is (s, "one\\\\", "getQuoted ('\"', s, false) -> \"one\\\\\""); // bool getDigit (int&); t.diag ("Nibbler::getDigit"); n = Nibbler ("12x"); t.ok (n.getDigit (i), " '12x' : getDigit () -> true"); t.is (i, 1, " '12x' : getDigit () -> 1"); t.ok (n.getDigit (i), " '2x' : getDigit () -> true"); t.is (i, 2, " '2x' : getDigit () -> 2"); t.notok (n.getDigit (i), " 'x' : getDigit () -> false"); // bool getInt (int&); t.diag ("Nibbler::getInt"); n = Nibbler ("123 -4"); t.ok (n.getInt (i), " '123 -4' : getInt () -> true"); t.is (i, 123, " '123 -4' : getInt () -> '123'"); t.ok (n.skip (' '), " ' -4' : skip (' ') -> true"); t.ok (n.getInt (i), " '-4' : getInt () -> true"); t.is (i, -4, " '-4' : getInt () -> '-4'"); t.ok (n.depleted (), " '' : depleted () -> true"); // bool getHex (int&); t.diag ("Nibbler::getHex"); n = Nibbler ("123 7b"); t.ok (n.getHex (i), " '123 7b' : getHex () -> true"); t.is (i, 291, " '123 7b' : getHex () -> '291'"); t.ok (n.skip (' '), " ' 7b' : skip (' ') -> true"); t.ok (n.getHex (i), " '7b' : getHex () -> true"); t.is (i, 123, " '7b' : getHex () -> '123'"); t.ok (n.depleted (), " '' : depleted () -> true"); // bool getUnsignedInt (int&i); t.diag ("Nibbler::getUnsignedInt"); n = Nibbler ("123 4"); t.ok (n.getUnsignedInt (i), " '123 4' : getUnsignedInt () -> true"); t.is (i, 123, " '123 4' : getUnsignedInt () -> '123'"); t.ok (n.skip (' '), " ' 4' : skip (' ') -> true"); t.ok (n.getUnsignedInt (i), " '4' : getUnsignedInt () -> true"); t.is (i, 4, " '4' : getUnsignedInt () -> '4'"); t.ok (n.depleted (), " '' : depleted () -> true"); // bool getNumber (double&); t.diag ("Nibbler::getNumber"); n = Nibbler ("-1.234 2.3e4"); t.ok (n.getNumber (d), "'-1.234 2.3e4' : getNumber () -> true"); t.is (d, -1.234, 0.000001, "'-1.234 2.3e4' : getNumber () -> '-1.234'"); t.ok (n.skip (' '), " ' 2.3e4' : skip (' ') -> true"); t.ok (n.getNumber (d), " '2.3e4' : getNumber () -> true"); t.is (d, 2.3e4, " '2.3e4' : getNumber () -> '2.3e4'"); t.ok (n.depleted (), " '' : depleted () -> true"); n = Nibbler ("2.0"); t.ok (n.getNumber (d), "'2.0' : getNumber () -> true"); t.is (d, 2.0, 0.000001, "'2.0' : getNumber () -> '2.0'"); t.ok (n.depleted (), " '' : depleted () -> true"); n = Nibbler ("-864000.00000"); t.ok (n.getNumber (d), "'-864000.00000' : getNumber () -> true"); t.is (d, -864000.0, "'-864000.00000' : getNumber () -> -864000.0"); t.ok (n.depleted (), " '' : depleted () -> true"); // bool getLiteral (const std::string&); t.diag ("Nibbler::getLiteral"); n = Nibbler ("foobar"); t.ok (n.getLiteral ("foo"), " 'foobar' : getLiteral ('foo') -> true"); t.notok (n.getLiteral ("foo"), " 'bar' : getLiteral ('foo') -> false"); t.ok (n.getLiteral ("bar"), " 'bar' : getLiteral ('bar') -> true"); t.ok (n.depleted (), " '' : depleted () -> true"); #ifdef NIBBLER_FEATURE_REGEX // bool getRx (const std::string&, std::string&); t.diag ("Nibbler::getRx"); n = Nibbler ("one two three"); t.ok (n.getRx ("^(o..)", s), "'one two three' : getRx ('^(o..)') -> true"); t.is (s, "one", "'one two three' : getRx ('^(o..)') -> 'one'"); t.ok (n.skip (' '), " ' two three' : skip (' ') -> true"); t.ok (n.getRx ("t..", s), " 'two three' : getRx ('t..') -> true"); t.is (s, "two", " 'two three' : getRx ('t..') -> 'two'"); t.notok (n.getRx ("th...", s), " ' three' : getRx ('th...') -> false"); t.ok (n.skip (' '), " ' three' : skip (' ') -> true"); t.ok (n.getRx ("th...", s), " 'three' : getRx ('th...') -> true"); t.is (s, "three", " 'three' : getRx ('th...') -> 'three'"); t.ok (n.depleted (), " '' : depleted () -> true"); #endif // bool getUUID (std::string&); t.diag ("Nibbler::getUUID"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-C8D9-E0F1a2b3c4d5"); t.ok (n.getUUID (s), "uuid 1 found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C8D9-E0F1a2b3c4d5", "uuid 1 -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("00000000-0000-0000-0000-000000000000,a0b1c2d3-e4f5-A6B7-C8D9-E0F1a2b3c4d5"); t.ok (n.getUUID (s), "uuid 1 found"); t.is (s, "00000000-0000-0000-0000-000000000000", "uuid 1 -> correct"); t.ok (n.skip (','), "comma -> skipped"); t.ok (n.getUUID (s), "uuid 2 -> found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C8D9-E0F1a2b3c4d5", "uuid 2 -> correct"); t.ok (n.depleted (), "depleted"); // bool getPartialUUID (std::string&); t.diag ("Nibbler::getPartialUUID"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-C8D9-E0F1a2b3c4d5"); t.ok (n.getPartialUUID (s), "partial uuid [36] found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C8D9-E0F1a2b3c4d5", "partial uuid [36] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-C8D9-E0F1a2b3c4d"); t.ok (n.getPartialUUID (s), "partial uuid [35] found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C8D9-E0F1a2b3c4d", "partial uuid [35] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-C8D9-E0F1a2b3c4"); t.ok (n.getPartialUUID (s), "partial uuid [34] found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C8D9-E0F1a2b3c4", "partial uuid [34] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-C8D9-E0F1a2b3c"); t.ok (n.getPartialUUID (s), "partial uuid [33] found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C8D9-E0F1a2b3c", "partial uuid [33] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-C8D9-E0F1a2b3"); t.ok (n.getPartialUUID (s), "partial uuid [32] found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C8D9-E0F1a2b3", "partial uuid [32] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-C8D9-E0F1a2b"); t.ok (n.getPartialUUID (s), "partial uuid [31] found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C8D9-E0F1a2b", "partial uuid [31] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-C8D9-E0F1a2"); t.ok (n.getPartialUUID (s), "partial uuid [30] found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C8D9-E0F1a2", "partial uuid [30] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-C8D9-E0F1a"); t.ok (n.getPartialUUID (s), "partial uuid [29] found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C8D9-E0F1a", "partial uuid [29] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-C8D9-E0F1"); t.ok (n.getPartialUUID (s), "partial uuid [28] found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C8D9-E0F1", "partial uuid [28] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-C8D9-E0F"); t.ok (n.getPartialUUID (s), "partial uuid [27] found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C8D9-E0F", "partial uuid [27] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-C8D9-E0"); t.ok (n.getPartialUUID (s), "partial uuid [26] found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C8D9-E0", "partial uuid [26] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-C8D9-E"); t.ok (n.getPartialUUID (s), "partial uuid [25] found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C8D9-E", "partial uuid [25] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-C8D9-"); t.ok (n.getPartialUUID (s), "partial uuid [24] found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C8D9-", "partial uuid [24] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-C8D9"); t.ok (n.getPartialUUID (s), "partial uuid [23] found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C8D9", "partial uuid [23] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-C8D"); t.ok (n.getPartialUUID (s), "partial uuid [22] found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C8D", "partial uuid [22] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-C8"); t.ok (n.getPartialUUID (s), "partial uuid [21] found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C8", "partial uuid [21] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-C"); t.ok (n.getPartialUUID (s), "partial uuid [20] found"); t.is (s, "a0b1c2d3-e4f5-A6B7-C", "partial uuid [20] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B7-"); t.ok (n.getPartialUUID (s), "partial uuid [19] found"); t.is (s, "a0b1c2d3-e4f5-A6B7-", "partial uuid [19] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B7"); t.ok (n.getPartialUUID (s), "partial uuid [18] found"); t.is (s, "a0b1c2d3-e4f5-A6B7", "partial uuid [18] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6B"); t.ok (n.getPartialUUID (s), "partial uuid [17] found"); t.is (s, "a0b1c2d3-e4f5-A6B", "partial uuid [17] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A6"); t.ok (n.getPartialUUID (s), "partial uuid [16] found"); t.is (s, "a0b1c2d3-e4f5-A6", "partial uuid [16] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-A"); t.ok (n.getPartialUUID (s), "partial uuid [15] found"); t.is (s, "a0b1c2d3-e4f5-A", "partial uuid [15] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5-"); t.ok (n.getPartialUUID (s), "partial uuid [14] found"); t.is (s, "a0b1c2d3-e4f5-", "partial uuid [14] -> correct"); t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5"); t.notok (n.getPartialUUID (s), "partial uuid [13] not found"); t.notok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f"); t.notok (n.getPartialUUID (s), "partial uuid [12] not found"); t.notok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4"); t.notok (n.getPartialUUID (s), "partial uuid [11] not found"); t.notok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e"); t.notok (n.getPartialUUID (s), "partial uuid [10] not found"); t.notok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-"); t.notok (n.getPartialUUID (s), "partial uuid [9] not found"); t.notok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3"); t.notok (n.getPartialUUID (s), "partial uuid [8] not found"); t.notok (n.depleted (), "not depleted"); // bool getDateISO (time_t&); t.diag ("Nibbler::getDateISO"); n = Nibbler ("19980119T070000Z"); t.ok (n.getDateISO (ti), "'19980119T070000Z': getDateISO () -> true"); t.is (ti, 885193200, "'19980119T070000Z': getDateISO () -> 885193200"); t.ok (n.depleted (), "depleted"); n = Nibbler ("20090213T233130Z"); t.ok (n.getDateISO (ti), "'20090213T233130Z': getDateISO () -> true"); t.is (ti, 1234567890, "'20090213T233130Z': getDateISO () -> 1234567890"); t.ok (n.depleted (), "depleted"); #ifdef NIBBLER_FEATURE_DATE // bool getDate (time_t&, const std::string&); t.diag ("Nibbler::getDate"); n = Nibbler ("1/1/2008"); t.ok (n.getDate ("m/d/Y", ti), "m/d/Y ok"); dt = Date (ti); t.is (dt.month (), 1, "ctor (std::string) -> m"); t.is (dt.day (), 1, "ctor (std::string) -> d"); t.is (dt.year (), 2008, "ctor (std::string) -> y"); n = Nibbler ("20080101"); t.ok (n.getDate ("YMD", ti), "YMD ok"); dt = Date (ti); t.is (dt.month (), 1, "ctor (std::string) -> m"); t.is (dt.day (), 1, "ctor (std::string) -> d"); t.is (dt.year (), 2008, "ctor (std::string) -> y"); n = Nibbler ("12/31/2007"); t.ok (n.getDate ("m/d/Y", ti), "m/d/Y ok"); dt = Date (ti); t.is (dt.month (), 12, "ctor (std::string) -> m"); t.is (dt.day (), 31, "ctor (std::string) -> d"); t.is (dt.year (), 2007, "ctor (std::string) -> y"); n = Nibbler ("20071231"); t.ok (n.getDate ("YMD", ti), "YMD ok"); dt = Date (ti); t.is (dt.month (), 12, "ctor (std::string) -> m"); t.is (dt.day (), 31, "ctor (std::string) -> d"); t.is (dt.year (), 2007, "ctor (std::string) -> y"); n = Nibbler ("Tue 01 Jan 2008 (01)"); t.ok (n.getDate ("a D b Y (V)", ti), "a D b Y (V)"); dt = Date (ti); t.is (dt.month (), 1, "ctor (std::string) -> m"); t.is (dt.day (), 1, "ctor (std::string) -> d"); t.is (dt.year (), 2008, "ctor (std::string) -> y"); n = Nibbler ("Tuesday, January 1, 2008"); t.ok (n.getDate ("A, B d, Y", ti), "A, B d, Y ok"); dt = Date (ti); t.is (dt.month (), 1, "ctor (std::string) -> m"); t.is (dt.day (), 1, "ctor (std::string) -> d"); t.is (dt.year (), 2008, "ctor (std::string) -> y"); n = Nibbler ("w01 Tue 2008-01-01"); t.ok (n.getDate ("wV a Y-M-D", ti), "wV a Y-M-D ok"); dt = Date (ti); t.is (dt.month (), 1, "ctor (std::string) -> m"); t.is (dt.day (), 1, "ctor (std::string) -> d"); t.is (dt.year (), 2008, "ctor (std::string) -> y"); n = Nibbler ("6/7/2010 1:23:45"); t.ok (n.getDate ("m/d/Y h:N:S", ti), "m/d/Y h:N:S ok"); dt = Date (ti); t.is (dt.month (), 6, "ctor (std::string) -> m"); t.is (dt.day (), 7, "ctor (std::string) -> d"); t.is (dt.year (), 2010, "ctor (std::string) -> Y"); t.is (dt.hour (), 1, "ctor (std::string) -> h"); t.is (dt.minute (), 23, "ctor (std::string) -> N"); t.is (dt.second (), 45, "ctor (std::string) -> S"); n = Nibbler ("6/7/2010 01:23:45"); t.ok (n.getDate ("m/d/Y H:N:S", ti), "m/d/Y H:N:S ok"); dt = Date (ti); t.is (dt.month (), 6, "ctor (std::string) -> m"); t.is (dt.day (), 7, "ctor (std::string) -> d"); t.is (dt.year (), 2010, "ctor (std::string) -> Y"); t.is (dt.hour (), 1, "ctor (std::string) -> h"); t.is (dt.minute (), 23, "ctor (std::string) -> N"); t.is (dt.second (), 45, "ctor (std::string) -> S"); n = Nibbler ("6/7/2010 12:34:56"); t.ok (n.getDate ("m/d/Y H:N:S", ti), "m/d/Y H:N:S ok"); dt = Date (ti); t.is (dt.month (), 6, "ctor (std::string) -> m"); t.is (dt.day (), 7, "ctor (std::string) -> d"); t.is (dt.year (), 2010, "ctor (std::string) -> Y"); t.is (dt.hour (), 12, "ctor (std::string) -> h"); t.is (dt.minute (), 34, "ctor (std::string) -> N"); t.is (dt.second (), 56, "ctor (std::string) -> S"); n = Nibbler ("2010"); t.ok (n.getDate ("Y", ti), "Y ok"); dt = Date (ti); t.is (dt.month (), 1, "ctor (std::string) -> m"); t.is (dt.day (), 1, "ctor (std::string) -> d"); t.is (dt.year (), 2010, "ctor (std::string) -> Y"); t.is (dt.hour (), 0, "ctor (std::string) -> h"); t.is (dt.minute (), 0, "ctor (std::string) -> N"); t.is (dt.second (), 0, "ctor (std::string) -> S"); n = Nibbler ("17:18:19"); t.ok (n.getDate ("H:N:S", ti), "H:N:S ok"); dt = Date (ti); Date now = Date (); t.is (dt.month (), now.month(), "ctor (std::string) -> m"); t.is (dt.day (), now.day(), "ctor (std::string) -> d"); t.is (dt.year (), now.year(), "ctor (std::string) -> Y"); t.is (dt.hour (), 17, "ctor (std::string) -> h"); t.is (dt.minute (), 18, "ctor (std::string) -> N"); t.is (dt.second (), 19, "ctor (std::string) -> S"); #endif // bool getOneOf (const std::vector &, std::string&); t.diag ("Nibbler::getOneOf"); options.push_back ("one"); options.push_back ("two"); options.push_back ("three"); n = Nibbler ("onetwothreefour"); t.ok (n.getOneOf (options, s), "'onetwothreefour': getOneOf () -> true"); t.is (s, "one", "'onetwothreefour': getOneOf () -> one"); t.ok (n.getOneOf (options, s), " 'twothreefour': getOneOf () -> true"); t.is (s, "two", " 'twothreefour': getOneOf () -> two"); t.ok (n.getOneOf (options, s), " 'threefour': getOneOf () -> true"); t.is (s, "three", " 'threefour': getOneOf () -> three"); t.notok (n.getOneOf (options, s), " 'four': getOneOf () -> false"); // bool getName (std::string&); t.diag ("Nibbler::getName"); n = Nibbler ("a1 one one.two 9"); t.ok (n.getName (s), "'a1 one one.two 9' getName -> ok"); t.is (s, "a1", " ' one one.two 9' getName -> 'a1'"); t.ok (n.skipWS (), " 'one one.two 9' skipWS -> ok"); t.ok (n.getName (s), " 'one one.two 9' getName -> ok"); t.is (s, "one", " ' one.two 9' getName -> 'one'"); t.ok (n.skipWS (), " 'one.two 9' skipWS -> ok"); t.ok (n.getName (s), " 'one.two 9' getName -> ok"); t.is (s, "one", " '.two 9' getName -> 'one'"); t.ok (n.skip ('.'), " 'two 9' skip . -> ok"); t.ok (n.getName (s), " 'two 9' getName -> ok"); t.is (s, "two", " ' 9' getName -> 'two'"); t.ok (n.skipWS (), " '9' skipWS -> ok"); t.notok (n.getName (s), " '9' getName -> not ok"); t.ok (n.skip ('9'), " '' skip 9 -> ok"); t.ok (n.depleted (), "depleted"); n = Nibbler ("entrée"); t.ok (n.getName (s), "'entrée' -> ok"); t.is (s, "entrée", "'entrée' -> 'entrée'"); // bool getWord (std::string&); t.diag ("Nibbler::getWord"); n = Nibbler ("one two th3ee"); t.ok (n.getWord (s), "'one' getWord -> ok"); t.is (s, "one", "'one' getWord -> 'one'"); t.ok (n.skipWS (), "skipWS"); t.ok (n.getWord (s), "'two' getWord -> ok"); t.is (s, "two", "'two' getWord -> 'two'"); t.ok (n.skipWS (), "skipWS"); t.ok (n.getWord (s), "'th' getWord -> ok"); t.is (s, "th", "'th' getWord -> 'th'"); t.ok (n.skip ('3'), "skip(3)"); t.ok (n.getWord (s), "'ee' getWord -> ok"); t.is (s, "ee", "'ee' getWord -> 'ee'"); t.ok (n.depleted (), "depleted"); t.diag ("Nibbler::getWord"); n = Nibbler ("one TWO,three,f "); t.ok (n.getWord (s), "'one TWO,three,f ' getWord -> ok"); t.is (s, "one", " ' TWO,three,f ' getWord -> one"); t.ok (n.skipWS (), " 'TWO,three,f ' skipWS -> ok"); t.ok (n.getWord (s), " 'TWO,three,f ' getWord -> ok"); t.is (s, "TWO", " ',three,f ' getWord -> TWO"); t.ok (n.skip (','), " 'three,f ' skip , -> ok"); t.ok (n.getWord (s), " 'three,f ' getWord -> ok"); t.is (s, "three", " ',f ' getWord -> three"); t.ok (n.skip (','), " 'f ' skip , -> ok"); t.ok (n.getWord (s), " 'f ' getWord -> ok"); t.is (s, "f", " ' ' getWord -> f"); t.ok (n.skipWS (), " '' skip , -> ok"); t.ok (n.depleted (), " '' depleted -> true"); // bool getN (int, std::string&); t.diag ("Nibbler::getN"); n = Nibbler ("111223"); t.ok (n.getN (3, s), " '111223' : getN (3) -> true"); t.is (s, "111", " '111223' : getN (3) -> '111'"); t.ok (n.getN (2, s), " '223' : getN (2) -> true"); t.is (s, "22", " '223' : getN (2) -> '22'"); t.ok (n.getN (1, s), " '3' : getN (1) -> true"); t.is (s, "3", " '3' : getN (1) -> '1'"); t.ok (n.depleted (), " '' : depleted () -> true"); // bool getUntilEOL (std::string&); t.diag ("Nibbler::getUntilEOL"); n = Nibbler ("one\ntwo"); t.ok (n.getUntilEOL (s), "'one\\ntwo' : getUntilEOL () -> true"); t.is (s, "one", "'one\\ntwo' : getUntilEOL () -> 'one'"); t.ok (n.skip ('\n'), " '\\ntwo' : skip ('\\n') -> true"); t.ok (n.getUntilEOL (s), " 'two' : getUntilEOL () -> true"); t.is (s, "two", " 'two' : getUntilEOL () -> 'two'"); t.ok (n.depleted (), " '' : depleted () -> true"); // bool getUntilEOS (std::string&); t.diag ("Nibbler::getUntilEOS"); n = Nibbler ("one two"); t.ok (n.getUntilEOS (s), " 'one two' : getUntilEOS () -> 'one two'"); t.ok (n.depleted (), " '' : depleted () -> true"); // char next (); t.diag ("Nibbler::next"); n = Nibbler ("hello"); t.is (n.next (), 'h', " 'hello' : next () -> 'h'"); t.is (n.next (), 'h', " 'hello' : next () -> 'h'"); t.ok (n.skipN (4), " 'hello' : skipN (4) -> true"); t.is (n.next (), 'o', " 'o' : next () -> 'o'"); t.ok (n.skipN (1), " 'o' : skipN () -> true"); t.ok (n.depleted (), " '' : depleted () -> true"); // std::string next (const int quantity); t.diag ("Nibbler::next"); n = Nibbler ("hello"); t.is (n.next (1), "h", " 'hello' : next (1) -> 'h'"); t.is (n.next (1), "h", " 'hello' : next (1) -> 'h'"); t.is (n.next (2), "he", " 'hello' : next (2) -> 'he'"); t.is (n.next (3), "hel", " 'hello' : next (3) -> 'hel'"); t.is (n.next (4), "hell", " 'hello' : next (4) -> 'hell'"); t.is (n.next (5), "hello", " 'hello' : next (5) -> 'hello'"); t.is (n.next (6), "", " 'hello' : next (6) -> ''"); // bool depleted (); t.diag ("Nibbler::depleted"); n = Nibbler (" "); t.notok (n.depleted (), " ' ' : depleted () -> false"); t.ok (n.skipN (), " '' : skip () -> true"); t.ok (n.depleted (), " '' : depleted () -> true"); // void save (); // void restore (); n = Nibbler ("abcde"); t.ok (n.skipN (), " 'abcde' : skip () -> true"); n.save (); t.ok (n.skipN (), " 'bcde' : skip () -> true"); t.ok (n.skipN (), " 'cde' : skip () -> true"); t.ok (n.skipN (), " 'de' : skip () -> true"); n.restore (); t.is (n.next (1), "b", " 'bcde' : skip () -> 'b'"); } catch (const std::string& e) {t.diag (e);} return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/oldest.t000075500000000000000000000124111213035135600151100ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 54; # Create the rc file. if (open my $fh, '>', 'oldest.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'oldest.rc', 'Created oldest.rc'); } # Add 11 tasks. Oldest should show 1-10, newest should show 2-11. qx{../src/task rc:oldest.rc add one 2>&1}; diag ("3 second delay"); sleep 1; qx{../src/task rc:oldest.rc add two 2>&1}; sleep 1; qx{../src/task rc:oldest.rc add three 2>&1}; sleep 1; my $output = qx{../src/task rc:oldest.rc oldest 2>&1}; like ($output, qr/one/, 'oldest: one'); like ($output, qr/two/, 'oldest: two'); like ($output, qr/three/, 'oldest: three'); like ($output, qr/one.*two.*three/ms, 'oldest: sort'); $output = qx{../src/task rc:oldest.rc newest 2>&1}; like ($output, qr/three/, 'newest: three'); like ($output, qr/two/, 'newest: two'); like ($output, qr/one/, 'newest: one'); like ($output, qr/three.*two.*one/ms, 'newest: sort'); qx{../src/task rc:oldest.rc add four 2>&1}; diag ("7 second delay"); sleep 1; qx{../src/task rc:oldest.rc add five 2>&1}; sleep 1; qx{../src/task rc:oldest.rc add six 2>&1}; sleep 1; qx{../src/task rc:oldest.rc add seven 2>&1}; sleep 1; qx{../src/task rc:oldest.rc add eight 2>&1}; sleep 1; qx{../src/task rc:oldest.rc add nine 2>&1}; sleep 1; qx{../src/task rc:oldest.rc add ten 2>&1}; sleep 1; qx{../src/task rc:oldest.rc add eleven 2>&1}; $output = qx{../src/task rc:oldest.rc oldest 2>&1}; like ($output, qr/one/, 'oldest: one'); # 10 like ($output, qr/two/, 'oldest: two'); like ($output, qr/three/, 'oldest: three'); like ($output, qr/four/, 'oldest: four'); like ($output, qr/five/, 'oldest: five'); like ($output, qr/six/, 'oldest: six'); like ($output, qr/seven/, 'oldest: seven'); like ($output, qr/eight/, 'oldest: eight'); like ($output, qr/nine/, 'oldest: nine'); like ($output, qr/ten/, 'oldest: ten'); unlike ($output, qr/eleven/, 'no: eleven'); # 20 $output = qx{../src/task rc:oldest.rc oldest limit:3 2>&1}; like ($output, qr/one/, 'oldest: one'); like ($output, qr/two/, 'oldest: two'); like ($output, qr/three/, 'oldest: three'); unlike ($output, qr/four/, 'no: four'); unlike ($output, qr/five/, 'no: five'); unlike ($output, qr/six/, 'no: six'); unlike ($output, qr/seven/, 'no: seven'); unlike ($output, qr/eight/, 'no: eight'); unlike ($output, qr/nine/, 'no: nine'); unlike ($output, qr/ten/, 'no: ten'); # 30 unlike ($output, qr/eleven/, 'no: eleven'); $output = qx{../src/task rc:oldest.rc newest 2>&1}; unlike ($output, qr/one/, 'no: one'); like ($output, qr/two/, 'newest: two'); like ($output, qr/three/, 'newest: three'); like ($output, qr/four/, 'newest: four'); like ($output, qr/five/, 'newest: five'); like ($output, qr/six/, 'newest: six'); like ($output, qr/seven/, 'newest: seven'); like ($output, qr/eight/, 'newest: eight'); like ($output, qr/nine/, 'newest: nine'); # 40 like ($output, qr/ten/, 'newest: ten'); like ($output, qr/eleven/, 'newest: eleven'); $output = qx{../src/task rc:oldest.rc newest limit:3 2>&1}; unlike ($output, qr/one/, 'no: one'); unlike ($output, qr/two/, 'no: two'); unlike ($output, qr/three/, 'no: three'); unlike ($output, qr/four/, 'no: four'); unlike ($output, qr/five/, 'no: five'); unlike ($output, qr/six/, 'no: six'); unlike ($output, qr/seven/, 'no: seven'); unlike ($output, qr/eight/, 'no: eight'); # 50 like ($output, qr/nine/, 'newest: nine'); like ($output, qr/ten/, 'newest: ten'); like ($output, qr/eleven/, 'newest: eleven'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key oldest.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'oldest.rc', 'Cleanup'); exit 0; task-2.2.0-test/op_and.t000075500000000000000000000102011213035135600150510ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 26; # Create the rc file. if (open my $fh, '>', 'op.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'op.rc', 'Created op.rc'); } # Setup: Add a task qx{../src/task rc:op.rc add one project:A priority:H 2>&1}; qx{../src/task rc:op.rc add two project:A 2>&1}; qx{../src/task rc:op.rc add three priority:H 2>&1}; qx{../src/task rc:op.rc add four 2>&1}; # Test the 'and' operator. my $output = qx{../src/task rc:op.rc ls project:A priority:H 2>&1}; like ($output, qr/one/, 'ls project:A priority:H --> one'); unlike ($output, qr/two/, 'ls project:A priority:H --> !two'); unlike ($output, qr/three/, 'ls project:A priority:H --> !three'); unlike ($output, qr/four/, 'ls project:A priority:H --> !four'); $output = qx{../src/task rc:op.rc ls project:A and priority:H 2>&1}; like ($output, qr/one/, 'ls project:A priority:H --> one'); unlike ($output, qr/two/, 'ls project:A priority:H --> !two'); unlike ($output, qr/three/, 'ls project:A priority:H --> !three'); unlike ($output, qr/four/, 'ls project:A priority:H --> !four'); $output = qx{../src/task rc:op.rc ls project:A and priority.not:H 2>&1}; unlike ($output, qr/one/, 'ls project:A priority:H --> !one'); like ($output, qr/two/, 'ls project:A priority:H --> two'); unlike ($output, qr/three/, 'ls project:A priority:H --> !three'); unlike ($output, qr/four/, 'ls project:A priority:H --> !four'); $output = qx{../src/task rc:op.rc ls project=A priority=H 2>&1}; like ($output, qr/one/, 'ls project:A priority:H --> one'); unlike ($output, qr/two/, 'ls project:A priority:H --> !two'); unlike ($output, qr/three/, 'ls project:A priority:H --> !three'); unlike ($output, qr/four/, 'ls project:A priority:H --> !four'); $output = qx{../src/task rc:op.rc ls project=A and priority=H 2>&1}; like ($output, qr/one/, 'ls project:A priority:H --> one'); unlike ($output, qr/two/, 'ls project:A priority:H --> !two'); unlike ($output, qr/three/, 'ls project:A priority:H --> !three'); unlike ($output, qr/four/, 'ls project:A priority:H --> !four'); $output = qx{../src/task rc:op.rc ls project=A and priority!=H 2>&1}; unlike ($output, qr/one/, 'ls project:A priority:H --> !one'); like ($output, qr/two/, 'ls project:A priority:H --> two'); unlike ($output, qr/three/, 'ls project:A priority:H --> !three'); unlike ($output, qr/four/, 'ls project:A priority:H --> !four'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key op.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'op.rc', 'Cleanup'); exit 0; task-2.2.0-test/op_gt.t000075500000000000000000000076751213035135600147460ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 26; # Create the rc file. if (open my $fh, '>', 'op.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'op.rc', 'Created op.rc'); } # Setup: Add a task qx{../src/task rc:op.rc add one due:yesterday priority:H 2>&1}; qx{../src/task rc:op.rc add two due:tomorrow priority:M 2>&1}; qx{../src/task rc:op.rc add three priority:L 2>&1}; qx{../src/task rc:op.rc add four 2>&1}; # Test the '>' operator. my $output = qx{../src/task rc:op.rc ls due.after:today 2>&1}; unlike ($output, qr/one/, 'ls due.after:today --> !one'); like ($output, qr/two/, 'ls due.after:today --> two'); unlike ($output, qr/three/, 'ls due.after:today --> !three'); unlike ($output, qr/four/, 'ls due.after:today --> !four'); $output = qx{../src/task rc:op.rc ls 'due > today' 2>&1}; unlike ($output, qr/one/, 'ls due > today --> !one'); like ($output, qr/two/, 'ls due > today --> two'); unlike ($output, qr/three/, 'ls due > today --> !three'); unlike ($output, qr/four/, 'ls due > today --> !four'); $output = qx{../src/task rc:op.rc ls priority.above:L 2>&1}; like ($output, qr/one/, 'ls priority.above:L --> one'); like ($output, qr/two/, 'ls priority.above:L --> two'); unlike ($output, qr/three/, 'ls priority.above:L --> !three'); unlike ($output, qr/four/, 'ls priority.above:L --> !four'); $output = qx{../src/task rc:op.rc ls 'priority > L' 2>&1}; like ($output, qr/one/, 'ls priority > L --> one'); like ($output, qr/two/, 'ls priority > L --> two'); unlike ($output, qr/three/, 'ls priority > L --> !three'); unlike ($output, qr/four/, 'ls priority > L --> !four'); $output = qx{../src/task rc:op.rc ls 'description > t' 2>&1}; unlike ($output, qr/one/, 'ls description > t --> !one'); like ($output, qr/two/, 'ls description > t --> two'); like ($output, qr/three/, 'ls description > t --> three'); unlike ($output, qr/four/, 'ls description > t --> !four'); $output = qx{../src/task rc:op.rc 'urgency > 10.0' ls 2>&1}; like ($output, qr/one/, 'ls urgency > 10 --> one'); like ($output, qr/two/, 'ls urgency > 10 --> two'); unlike ($output, qr/three/, 'ls urgency > 10 --> !three'); unlike ($output, qr/four/, 'ls urgency > 10 --> !four'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key op.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'op.rc', 'Cleanup'); exit 0; task-2.2.0-test/op_gte.t000075500000000000000000000060311213035135600150740ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 14; # Create the rc file. if (open my $fh, '>', 'op.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'op.rc', 'Created op.rc'); } # Setup: Add a task qx{../src/task rc:op.rc add one priority:H 2>&1}; qx{../src/task rc:op.rc add two priority:M 2>&1}; qx{../src/task rc:op.rc add three priority:L 2>&1}; qx{../src/task rc:op.rc add four 2>&1}; # Test the '>=' operator. my $output = qx{../src/task rc:op.rc ls 'priority >= M' 2>&1}; like ($output, qr/one/, 'ls priority >= M --> one'); like ($output, qr/two/, 'ls priority >= M --> two'); unlike ($output, qr/three/, 'ls priority >= M --> !three'); unlike ($output, qr/four/, 'ls priority >= M --> !four'); $output = qx{../src/task rc:op.rc ls 'description >= t' 2>&1}; unlike ($output, qr/one/, 'ls description >= t --> !one'); like ($output, qr/two/, 'ls description >= t --> two'); like ($output, qr/three/, 'ls description >= t --> three'); unlike ($output, qr/four/, 'ls description >= t --> !four'); $output = qx{../src/task rc:op.rc 'urgency >= 2.0' ls 2>&1}; like ($output, qr/one/, 'ls urgency >= 2.0 --> one'); like ($output, qr/two/, 'ls urgency >= 2.0 --> two'); unlike ($output, qr/three/, 'ls urgency >= 2.0 --> !three'); unlike ($output, qr/four/, 'ls urgency >= 2.0 --> !four'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key op.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'op.rc', 'Cleanup'); exit 0; task-2.2.0-test/op_lt.t000075500000000000000000000077201213035135600147420ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 26; # Create the rc file. if (open my $fh, '>', 'op.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'op.rc', 'Created op.rc'); } # Setup: Add a task qx{../src/task rc:op.rc add one due:yesterday priority:H 2>&1}; qx{../src/task rc:op.rc add two due:tomorrow priority:M 2>&1}; qx{../src/task rc:op.rc add three priority:L 2>&1}; qx{../src/task rc:op.rc add four 2>&1}; # Test the '<' operator. my $output = qx{../src/task rc:op.rc ls due.before:today 2>&1}; like ($output, qr/one/, 'ls due.before:today --> one'); unlike ($output, qr/two/, 'ls due.before:today --> !two'); unlike ($output, qr/three/, 'ls due.before:today --> !three'); unlike ($output, qr/four/, 'ls due.before:today --> !four'); $output = qx{../src/task rc:op.rc ls 'due < today' 2>&1}; like ($output, qr/one/, 'ls due < today --> one'); unlike ($output, qr/two/, 'ls due < today --> !two'); unlike ($output, qr/three/, 'ls due < today --> !three'); unlike ($output, qr/four/, 'ls due < today --> !four'); $output = qx{../src/task rc:op.rc ls priority.below:H 2>&1}; unlike ($output, qr/one/, 'ls priority.below:H --> !one'); like ($output, qr/two/, 'ls priority.below:H --> two'); like ($output, qr/three/, 'ls priority.below:H --> three'); like ($output, qr/four/, 'ls priority.below:H --> four'); $output = qx{../src/task rc:op.rc ls 'priority < H' 2>&1}; unlike ($output, qr/one/, 'ls priority < H --> !one'); like ($output, qr/two/, 'ls priority < H --> two'); like ($output, qr/three/, 'ls priority < H --> three'); like ($output, qr/four/, 'ls priority < H --> four'); $output = qx{../src/task rc:op.rc ls 'description < t' 2>&1}; like ($output, qr/one/, 'ls description < t --> one'); unlike ($output, qr/two/, 'ls description < t --> !two'); unlike ($output, qr/three/, 'ls description < t --> !three'); like ($output, qr/four/, 'ls description < t --> four'); $output = qx{../src/task rc:op.rc 'urgency < 10.0' ls 2>&1}; unlike ($output, qr/one/, 'ls description < 10 --> !one'); unlike ($output, qr/two/, 'ls description < 10 --> !two'); like ($output, qr/three/, 'ls description < 10 --> three'); like ($output, qr/four/, 'ls description < 10 --> four'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key op.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'op.rc', 'Cleanup'); exit 0; task-2.2.0-test/op_lte.t000075500000000000000000000060301213035135600151000ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 14; # Create the rc file. if (open my $fh, '>', 'op.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'op.rc', 'Created op.rc'); } # Setup: Add a task qx{../src/task rc:op.rc add one priority:H 2>&1}; qx{../src/task rc:op.rc add two priority:M 2>&1}; qx{../src/task rc:op.rc add three priority:L 2>&1}; qx{../src/task rc:op.rc add four 2>&1}; # Test the '<=' operator. my $output = qx{../src/task rc:op.rc ls 'priority <= M' 2>&1}; unlike ($output, qr/one/, 'ls priority <= H --> !one'); like ($output, qr/two/, 'ls priority <= H --> two'); like ($output, qr/three/, 'ls priority <= H --> three'); like ($output, qr/four/, 'ls priority <= H --> four'); $output = qx{../src/task rc:op.rc ls 'description <= t' 2>&1}; like ($output, qr/one/, 'ls description <= t --> one'); unlike ($output, qr/two/, 'ls description <= t --> !two'); unlike ($output, qr/three/, 'ls description <= t --> !three'); like ($output, qr/four/, 'ls description <= t --> four'); $output = qx{../src/task rc:op.rc 'urgency <= 2.0' ls 2>&1}; unlike ($output, qr/one/, 'ls urgency <= 2.0 --> !one'); unlike ($output, qr/two/, 'ls urgency <= 2.0 --> !two'); like ($output, qr/three/, 'ls urgency <= 2.0 --> three'); like ($output, qr/four/, 'ls urgency <= 2.0 --> four'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key op.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'op.rc', 'Cleanup'); exit 0; task-2.2.0-test/op_or.t000075500000000000000000000070171213035135600147420ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 18; # Create the rc file. if (open my $fh, '>', 'op.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'op.rc', 'Created op.rc'); } # Setup: Add a task qx{../src/task rc:op.rc add one project:A priority:H 2>&1}; qx{../src/task rc:op.rc add two project:A 2>&1}; qx{../src/task rc:op.rc add three priority:H 2>&1}; qx{../src/task rc:op.rc add four 2>&1}; # Test the 'or' operator. my $output = qx{../src/task rc:op.rc ls project:A or priority:H 2>&1}; like ($output, qr/one/, 'ls project:A or priority:H --> one'); like ($output, qr/two/, 'ls project:A or priority:H --> two'); like ($output, qr/three/, 'ls project:A or priority:H --> three'); unlike ($output, qr/four/, 'ls project:A or priority:H --> !four'); $output = qx{../src/task rc:op.rc ls project:A or priority=H 2>&1}; like ($output, qr/one/, 'ls project:A or priority=H --> one'); like ($output, qr/two/, 'ls project:A or priority=H --> two'); like ($output, qr/three/, 'ls project:A or priority=H --> three'); unlike ($output, qr/four/, 'ls project:A or priority=H --> !four'); $output = qx{../src/task rc:op.rc ls project=A or priority:H 2>&1}; like ($output, qr/one/, 'ls project=A or priority:H --> one'); like ($output, qr/two/, 'ls project=A or priority:H --> two'); like ($output, qr/three/, 'ls project=A or priority:H --> three'); unlike ($output, qr/four/, 'ls project=A or priority:H --> !four'); $output = qx{../src/task rc:op.rc ls project=A or priority=H 2>&1}; like ($output, qr/one/, 'ls project=A or priority=H --> one'); like ($output, qr/two/, 'ls project=A or priority=H --> two'); like ($output, qr/three/, 'ls project=A or priority=H --> three'); unlike ($output, qr/four/, 'ls project=A or priority=H --> !four'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key op.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'op.rc', 'Cleanup'); exit 0; task-2.2.0-test/op_xor.t000075500000000000000000000067501213035135600151350ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 18; # Create the rc file. if (open my $fh, '>', 'op.rc') { print $fh "data.location=.\n", "confirmation=no\n"; close $fh; ok (-r 'op.rc', 'Created op.rc'); } # Setup: Add a task qx{../src/task rc:op.rc add one project:A priority:H 2>&1}; qx{../src/task rc:op.rc add two project:A 2>&1}; qx{../src/task rc:op.rc add three priority:H 2>&1}; qx{../src/task rc:op.rc add four 2>&1}; # Test the 'xor' operator. my $output = qx{../src/task rc:op.rc ls project:A xor priority:H 2>&1}; unlike ($output, qr/one/, 'ls project:A priority:H --> !one'); like ($output, qr/two/, 'ls project:A priority:H --> two'); like ($output, qr/three/, 'ls project:A priority:H --> three'); unlike ($output, qr/four/, 'ls project:A priority:H --> !four'); $output = qx{../src/task rc:op.rc ls project:A xor priority=H 2>&1}; unlike ($output, qr/one/, 'ls project:A priority=H --> !one'); like ($output, qr/two/, 'ls project:A priority=H --> two'); like ($output, qr/three/, 'ls project:A priority=H --> three'); unlike ($output, qr/four/, 'ls project:A priority=H --> !four'); $output = qx{../src/task rc:op.rc ls project=A xor priority:H 2>&1}; unlike ($output, qr/one/, 'ls project=A priority:H --> !one'); like ($output, qr/two/, 'ls project=A priority:H --> two'); like ($output, qr/three/, 'ls project=A priority:H --> three'); unlike ($output, qr/four/, 'ls project=A priority:H --> !four'); $output = qx{../src/task rc:op.rc ls project=A xor priority=H 2>&1}; unlike ($output, qr/one/, 'ls project=A priority=H --> !one'); like ($output, qr/two/, 'ls project=A priority=H --> two'); like ($output, qr/three/, 'ls project=A priority=H --> three'); unlike ($output, qr/four/, 'ls project=A priority=H --> !four'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key op.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'op.rc', 'Cleanup'); exit 0; task-2.2.0-test/overdue.t000075500000000000000000000046071213035135600152770ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'due.rc') { print $fh "data.location=.\n", "due=4\n"; close $fh; ok (-r 'due.rc', 'Created due.rc'); } # Add an overdue task, a due task, and a regular task. The "overdue" report # should list only the one task. qx{../src/task rc:due.rc add due:yesterday one 2>&1}; qx{../src/task rc:due.rc add due:tomorrow two 2>&1}; qx{../src/task rc:due.rc add due:30d three 2>&1}; my $output = qx{../src/task rc:due.rc overdue 2>&1}; like ($output, qr/one/, 'overdue: task 1 shows up'); unlike ($output, qr/two/, 'overdue: task 2 does not show up'); unlike ($output, qr/three/, 'overdue: task 3 does not show up'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key due.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'due.rc', 'Cleanup'); exit 0; task-2.2.0-test/override.t000075500000000000000000000046701213035135600154450ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 3; # Create the rc file. if (open my $fh, '>', 'or.rc') { print $fh "data.location=.\n", "annotations=none\n", "report.zzz.columns=id,due,description\n", "report.zzz.labels=ID,Due,Description\n", "report.zzz.sort=due+\n", "report.zzz.filter=status:pending rc.annotations:full\n"; close $fh; ok (-r 'or.rc', 'Created or.rc'); } # The zzz report is defined with an override in the filter that contradicts # the value in the rc. The filter override should prevail. qx{../src/task rc:or.rc add ONE 2>&1}; qx{../src/task rc:or.rc 1 annotate TWO 2>&1}; my $output = qx{../src/task rc:or.rc zzz 2>&1}; like ($output, qr/ONE.+TWO/ms, 'filter override > rc setting'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key or.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'or.rc', 'Cleanup'); exit 0; task-2.2.0-test/path.t.cpp000064400000000000000000000077431213035135600153440ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include Context context; int main (int argc, char** argv) { UnitTest t (32); // Path (); Path p0; t.ok (p0._data == "", "Path::Path"); // Path (const Path&); Path p1 = Path ("foo"); t.ok (p1._data == "foo", "Path::operator="); // Path (const std::string&); Path p2 ("~"); t.ok (p2._data != "~", "~ expanded to " + p2._data); Path p3 ("/tmp"); t.ok (p3._data == "/tmp", "/tmp -> /tmp"); // Path& operator= (const Path&); Path p3_copy (p3); t.is (p3._data, p3_copy._data, "Path::Path (Path&)"); // operator (std::string) const; t.is ((std::string) p3, "/tmp", "Path::operator (std::string) const"); // std::string name () const; Path p4 ("/a/b/c/file.ext"); t.is (p4.name (), "file.ext", "/a/b/c/file.ext name is file.ext"); // std::string parent () const; t.is (p4.parent (), "/a/b/c", "/a/b/c/file.ext parent is /a/b/c"); // std::string extension () const; t.is (p4.extension (), "ext", "/a/b/c/file.ext extension is ext"); // bool exists () const; t.ok (p2.exists (), "~ exists"); t.ok (p3.exists (), "/tmp exists"); // bool is_directory () const; t.ok (p2.is_directory (), "~ is_directory"); t.ok (p3.is_directory (), "/tmp is_directory"); // bool readable () const; t.ok (p2.readable (), "~ readable"); t.ok (p3.readable (), "/tmp readable"); // bool writable () const; t.ok (p2.writable (), "~ writable"); t.ok (p3.writable (), "/tmp writable"); // bool executable () const; t.ok (p2.executable (), "~ executable"); t.ok (p3.executable (), "/tmp executable"); // static std::string expand (const std::string&); t.ok (Path::expand ("~") != "~", "Path::expand ~ != ~"); t.ok (Path::expand ("~/") != "~/", "Path::expand ~/ != ~/"); // static std::vector glob (const std::string&); std::vector out = Path::glob ("/tmp"); t.ok (out.size () == 1, "/tmp -> 1 result"); t.is (out[0], "/tmp", "/tmp -> /tmp"); out = Path::glob ("/t?p"); t.ok (out.size () == 1, "/t?p -> 1 result"); t.is (out[0], "/tmp", "/t?p -> /tmp"); out = Path::glob ("/[s-u]mp"); t.ok (out.size () == 1, "/[s-u]mp -> 1 result"); t.is (out[0], "/tmp", "/[s-u]mp -> /tmp"); // bool is_absolute () const; t.notok (p0.is_absolute (), "'' !is_absolute"); t.notok (p1.is_absolute (), "foo !is_absolute"); t.ok (p2.is_absolute (), "~ is_absolute (after expansion)"); t.ok (p3.is_absolute (), "/tmp is_absolute"); t.ok (p4.is_absolute (), "/a/b/c/file.ext is_absolute"); return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/prepend.t000075500000000000000000000044701213035135600152610ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'prepend.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'prepend.rc', 'Created prepend.rc'); } # Add a task, then prepend more decsription. qx{../src/task rc:prepend.rc add bar 2>&1}; qx{../src/task rc:prepend.rc 1 prepend foo 2>&1}; my $output = qx{../src/task rc:prepend.rc info 1 2>&1}; like ($output, qr/Description\s+foo\sbar\n/, 'prepend worked'); # Should cause an error when nothing is appended. $output = qx{../src/task rc:prepend.rc 1 prepend 2>&1}; unlike ($output, qr/Prepended 0 tasks/, 'blank prepend failed'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key prepend.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'prepend.rc', 'Cleanup'); exit 0; task-2.2.0-test/pri_sort.t000075500000000000000000000074671213035135600154760ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 34; # Create the rc file. if (open my $fh, '>', 'pri.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'pri.rc', 'Created pri.rc'); } # Verify that priorities can be select with the 'over' and 'under' modifiers. qx{../src/task rc:pri.rc add H pri:H 2>&1}; qx{../src/task rc:pri.rc add M pri:M 2>&1}; qx{../src/task rc:pri.rc add L pri:L 2>&1}; qx{../src/task rc:pri.rc add _ 2>&1}; my $output = qx{../src/task rc:pri.rc ls priority.under:H 2>&1}; unlike ($output, qr/H/, 'pri H !< H'); like ($output, qr/M/, 'pri M < H'); like ($output, qr/L/, 'pri L < H'); like ($output, qr/_/, 'pri _ < H'); $output = qx{../src/task rc:pri.rc ls priority.under:M 2>&1}; unlike ($output, qr/H/, 'pri H !< M'); unlike ($output, qr/M/, 'pri M !< M'); like ($output, qr/L/, 'pri L < M'); like ($output, qr/_/, 'pri _ < M'); $output = qx{../src/task rc:pri.rc ls priority.under:L 2>&1}; unlike ($output, qr/H/, 'pri H !< L'); unlike ($output, qr/M/, 'pri M !< L'); unlike ($output, qr/L/, 'pri L !< L'); like ($output, qr/_/, 'pri _ < L'); $output = qx{../src/task rc:pri.rc ls priority.under: 2>&1}; unlike ($output, qr/H/, 'pri H !< _'); unlike ($output, qr/M/, 'pri M !< _'); unlike ($output, qr/L/, 'pri L !< _'); unlike ($output, qr/_/, 'pri _ !< _'); $output = qx{../src/task rc:pri.rc ls priority.over:H 2>&1}; unlike ($output, qr/H/, 'pri H !> H'); unlike ($output, qr/M/, 'pri M !> H'); unlike ($output, qr/L/, 'pri L !> H'); unlike ($output, qr/_/, 'pri _ !> H'); $output = qx{../src/task rc:pri.rc ls priority.over:M 2>&1}; like ($output, qr/H/, 'pri H > M'); unlike ($output, qr/M/, 'pri M !> M'); unlike ($output, qr/L/, 'pri L !> M'); unlike ($output, qr/_/, 'pri _ !> M'); $output = qx{../src/task rc:pri.rc ls priority.over:L 2>&1}; like ($output, qr/H/, 'pri H > L'); like ($output, qr/M/, 'pri M > L'); unlike ($output, qr/L/, 'pri L !> L'); unlike ($output, qr/_/, 'pri _ !> L'); $output = qx{../src/task rc:pri.rc ls priority.over: 2>&1}; like ($output, qr/H/, 'pri H > _'); like ($output, qr/M/, 'pri M > _'); like ($output, qr/L/, 'pri L > _'); unlike ($output, qr/_/, 'pri _ !> _'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key pri.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'pri.rc', 'Cleanup'); exit 0; task-2.2.0-test/problems000075500000000000000000000005701213035135600152020ustar00rootroot00000000000000#! /usr/bin/env perl use strict; use warnings; if (open my $fh, '<', 'all.log') { my $test_file; my %errors; while (my $line = <$fh>) { $test_file = $1 if $line =~ /^# (\S+\.t)$/; $errors{$test_file}++ if $line =~ /^not /; } close $fh; printf "%-24s %4d\n", $_, $errors{$_} for sort {$errors{$b} <=> $errors{$a}} keys %errors; } exit 0; task-2.2.0-test/project.t000075500000000000000000000136571213035135600153010ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 18; # Create the rc file. if (open my $fh, '>', 'pro.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'pro.rc', 'Created pro.rc'); } # Test the project status numbers. my $output = qx{../src/task rc:pro.rc add one pro:foo 2>&1 >/dev/null}; like ($output, qr/The project 'foo' has changed\. Project 'foo' is 0% complete \(1 of 1 tasks remaining\)\./, 'add one'); $output = qx{../src/task rc:pro.rc add two pro:'foo' 2>&1 >/dev/null}; like ($output, qr/The project 'foo' has changed\. Project 'foo' is 0% complete \(2 of 2 tasks remaining\)\./, 'add two'); $output = qx{../src/task rc:pro.rc add three pro:'foo' 2>&1 >/dev/null}; like ($output, qr/The project 'foo' has changed\. Project 'foo' is 0% complete \(3 of 3 tasks remaining\)\./, 'add three'); $output = qx{../src/task rc:pro.rc add four pro:'foo' 2>&1 >/dev/null}; like ($output, qr/The project 'foo' has changed\. Project 'foo' is 0% complete \(4 of 4 tasks remaining\)\./, 'add four'); $output = qx{../src/task rc:pro.rc 1 done 2>&1 >/dev/null}; like ($output, qr/Project 'foo' is 25% complete \(3 of 4 tasks remaining\)\./, 'done one'); $output = qx{../src/task rc:pro.rc 2 delete 2>&1 >/dev/null}; like ($output, qr/The project 'foo' has changed\. Project 'foo' is 33% complete \(2 of 3 tasks remaining\)\./, 'delete two'); $output = qx{../src/task rc:pro.rc 3 modify pro:bar 2>&1 >/dev/null}; like ($output, qr/The project 'foo' has changed\. Project 'foo' is 50% complete \(1 of 2 tasks remaining\)\./, 'change project'); like ($output, qr/The project 'bar' has changed\. Project 'bar' is 0% complete \(1 of 1 tasks remaining\)\./, 'change project'); # Test projects with spaces in them. $output = qx{../src/task rc:pro.rc 3 modify pro:\\"foo bar\\" 2>&1 >/dev/null}; like ($output, qr/The project 'foo bar' has changed\./, 'project with spaces'); # Bug 1056: Project indentation. # see also the tests of helper functions for CmdProjects in util.t.cpp qx{../src/task rc:pro.rc add testing project:existingParent 2>&1 >/dev/null}; qx{../src/task rc:pro.rc add testing project:existingParent.child 2>&1 >/dev/null}; qx{../src/task rc:pro.rc add testing project:abstractParent.kid 2>&1 >/dev/null}; qx{../src/task rc:pro.rc add testing project:.myProject 2>&1 >/dev/null}; qx{../src/task rc:pro.rc add testing project:myProject. 2>&1 >/dev/null}; qx{../src/task rc:pro.rc add testing project:.myProject. 2>&1 >/dev/null}; $output = qx{../src/task rc:pro.rc projects 2>&1}; my @lines = split ('\n',$output); # It's easier to make a pattern for the end than the beginning because priority # counts are more predictable than project names. my $project_name_column; if ($lines[4] =~ s/\d+\s+\d+\s+\d+\s+\d+\s+\d+$//) { $project_name_column = $lines[4]; } else { $project_name_column = "error"; } like ($project_name_column, qr/^\.myProject\s*$/, '\'.myProject\' not indented'); if ($lines[5] =~ s/\d+\s+\d+\s+\d+\s+\d+\s+\d+$//) { $project_name_column = $lines[5]; } else { $project_name_column = "error"; } like ($project_name_column, qr/^\.myProject\.\s*$/, '\'.myProject.\' not indented'); if ($lines[6] =~ s/\d+\s+\d+\s+\d+\s+\d+\s+\d+$//) { $project_name_column = "error"; } else { $project_name_column = $lines[6]; } like ($project_name_column, qr/^abstractParent\s*$/, 'abstract parent not indented and no priority columns'); if ($lines[7] =~ s/\d+\s+\d+\s+\d+\s+\d+\s+\d+$//) { $project_name_column = $lines[7]; } else { $project_name_column = "error"; } like ($project_name_column, qr/^ kid\s*$/, 'child indented and without parent name'); if ($lines[8] =~ s/\d+\s+\d+\s+\d+\s+\d+\s+\d+$//) { $project_name_column = $lines[8]; } else { $project_name_column = "error"; } like ($project_name_column, qr/^existingParent\s*$/, 'existing parent not indented and has priority columns'); if ($lines[9] =~ s/\d+\s+\d+\s+\d+\s+\d+\s+\d+$//) { $project_name_column = $lines[9]; } else { $project_name_column = "error"; } like ($project_name_column, qr/^ child\s*$/, 'child of existing parent indented and without parent name'); if ($lines[12] =~ s/\d+\s+\d+\s+\d+\s+\d+\s+\d+$//) { $project_name_column = $lines[12]; } else { $project_name_column = "error"; } like ($project_name_column, qr/^myProject\.\s*$/, '\'myProject.\' not indented'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key pro.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'pro.rc', 'Cleanup'); exit 0; task-2.2.0-test/rc.override.t000075500000000000000000000036041213035135600160440ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'rc.rc') { print $fh "data.location=.\n", "foo=bar\n"; close $fh; ok (-r 'rc.rc', 'Created rc.rc'); } my $output = qx{../src/task rc:rc.rc show 2>&1}; like ($output, qr/^.*foo.+bar.*$/m, 'unmodified'); $output = qx{../src/task rc:rc.rc rc.foo:baz show 2>&1}; like ($output, qr/^.*foo.*baz.*$/m, 'overridden'); unlink 'rc.rc'; ok (!-r 'rc.rc', 'Removed rc.rc'); exit 0; task-2.2.0-test/rc.t000075500000000000000000000072041213035135600142260ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use File::Path; use Test::More tests => 15; # Create the rc file, using rc.name:value. unlink 'foo.rc'; rmtree 'foo', 0, 0; qx{echo 'y'|../src/task rc:foo.rc rc.data.location:foo 2>&1}; ok (-r 'foo.rc', 'Created default rc file'); ok (-d 'foo', 'Created default data directory'); rmtree 'foo', 0, 0; ok (!-r 'foo', 'Removed foo'); unlink 'foo.rc'; ok (!-r 'foo.rc', 'Removed foo.rc'); # Do it all again, with rc.name=value. qx{echo 'y'|../src/task rc:foo.rc rc.data.location:foo 2>&1}; ok (-r 'foo.rc', 'Created default rc file'); ok (-d 'foo', 'Created default data directory'); # Add a setting. qx{echo 'y'|../src/task rc:foo.rc config must_be_unique old 2>&1}; my $output = qx{../src/task rc:foo.rc show 2>&1}; like ($output, qr/^must_be_unique\s+old/ms, 'config setting a new value'); qx{echo 'y'|../src/task rc:foo.rc config must_be_unique new 2>&1}; $output = qx{../src/task rc:foo.rc show 2>&1}; like ($output, qr/^must_be_unique\s+new/ms, 'config overwriting an existing value'); qx{echo 'y'|../src/task rc:foo.rc config must_be_unique '' 2>&1}; $output = qx{../src/task rc:foo.rc show 2>&1}; like ($output, qr/^must_be_unique/ms, 'config setting a blank value'); qx{echo 'y'|../src/task rc:foo.rc config must_be_unique 2>&1}; $output = qx{../src/task rc:foo.rc show 2>&1}; unlike ($output, qr/^must_be_unique/ms, 'config removing a value'); # 'report.:b' is designed to get past the config command checks for recognized # names. qx{echo 'y'|../src/task rc:foo.rc config -- report.:b +c 2>&1}; $output = qx{../src/task rc:foo.rc show 2>&1}; like ($output, qr/^report\.:b\s+\+c/ms, 'the -- operator is working'); # Make sure the value is accepted if it has multiple words. qx{echo 'y'|../src/task rc:foo.rc config must_be_unique 'one two three' 2>&1}; $output = qx{../src/task rc:foo.rc show 2>&1}; like ($output, qr/^must_be_unique\s+one two three/ms, 'config allows multi-word quoted values'); qx{echo 'y'|../src/task rc:foo.rc config must_be_unique one two three 2>&1}; $output = qx{../src/task rc:foo.rc show 2>&1}; like ($output, qr/^must_be_unique\s+one two three/ms, 'config allows multi-word unquoted values'); rmtree 'foo', 0, 0; ok (!-r 'foo', 'Removed foo'); unlink 'foo.rc'; ok (!-r 'foo.rc', 'Removed foo.rc'); exit 0; task-2.2.0-test/recur.limit.t000075500000000000000000000050151213035135600160550ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'recur.rc') { print $fh "data.location=.\n", "defaultwidth=100\n"; close $fh; ok (-r 'recur.rc', 'Created recur.rc'); } # Add a recurring task, then see how many future pending tasks are # generated by default, and by overriding rc.recurrence.limit. qx{../src/task rc:recur.rc add ONE due:tomorrow recur:weekly 2>&1}; my $output = qx{../src/task rc:recur.rc long 2>&1}; my @tasks = $output =~ /(ONE)/g; is (scalar @tasks, 1, 'recurrence.limit default to 1'); $output = qx{../src/task rc:recur.rc rc.recurrence.limit:4 long 2>&1}; @tasks = $output =~ /(ONE)/g; is (scalar @tasks, 4, 'recurrence.limit override to 4'); $output = qx{../src/task rc:recur.rc diag 2>&1}; like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key recur.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'recur.rc', 'Cleanup'); exit 0; task-2.2.0-test/recur.sort.t000075500000000000000000000053131213035135600157270ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'recur.rc') { print $fh "data.location=.\n", "report.asc.columns=id,recur,description\n", "report.asc.sort=recur+\n", "report.desc.columns=id,recur,description\n", "report.desc.sort=recur-\n"; close $fh; ok (-r 'recur.rc', 'Created recur.rc'); } # Create a few recurring tasks, and test the sort order of the recur column. qx{../src/task rc:recur.rc add due:tomorrow recur:daily first 2>&1}; qx{../src/task rc:recur.rc add due:tomorrow recur:weekly second 2>&1}; qx{../src/task rc:recur.rc add due:tomorrow recur:3d third 2>&1}; my $output = qx{../src/task rc:recur.rc asc 2>&1}; like ($output, qr/first .* third .* second/msx, 'daily 3d weekly'); $output = qx{../src/task rc:recur.rc desc 2>&1}; like ($output, qr/second .* third .* first/msx, 'weekly 3d daily'); $output = qx{../src/task rc:recur.rc diag 2>&1}; like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key recur.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'recur.rc', 'Cleanup'); exit 0; task-2.2.0-test/recur.t000075500000000000000000000077271213035135600147540ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 11; # Create the rc file. if (open my $fh, '>', 'recur.rc') { print $fh "data.location=.\n", "confirmation=off\n", "recurrence.limit=1\n"; close $fh; ok (-r 'recur.rc', 'Created recur.rc'); } # Create a recurring and non-recurring task. qx{../src/task rc:recur.rc add simple 2>&1}; qx{../src/task rc:recur.rc add complex due:today recur:daily 2>&1}; # List tasks to generate child tasks. Should result in: # 1 simple # 3 complex # 4 complex my $output = qx{../src/task rc:recur.rc minimal 2>&1}; like ($output, qr/1.+simple\n/ms, '1 simple'); like ($output, qr/3.+complex\n/ms, '3 complex'); like ($output, qr/4.+complex\n/ms, '4 complex'); # Modify a child task and do not propagate the change. $output = qx{echo 'n' | ../src/task rc:recur.rc 3 modify complex2 2>&1}; $output = qx{../src/task rc:recur.rc 3 info 2>&1}; like ($output, qr/Description\s+complex2\s/ms, '3 modified'); $output = qx{../src/task rc:recur.rc 4 info 2>&1}; like ($output, qr/Description\s+complex\s/ms, '4 not modified'); # Modify a child task and propagate the change. $output = qx{echo 'y' | ../src/task rc:recur.rc 3 modify complex3 2>&1}; $output = qx{../src/task rc:recur.rc 3 info 2>&1}; like ($output, qr/Description\s+complex3\s/ms, '3 modified'); $output = qx{../src/task rc:recur.rc 4 info 2>&1}; like ($output, qr/Description\s+complex3\s/ms, '4 not modified'); # Delete a child task, not propagate. $output = qx{echo 'n' | ../src/task rc:recur.rc 3 delete 2>&1}; like ($output, qr/Deleted 1 task\./, '3 deleted'); # Delete a child task, propagate. #$output = qx{../src/task rc:recur.rc minimal 2>&1}; #$output = qx{echo 'y' | ../src/task rc:recur.rc 3 delete 2>&1}; #like ($output, qr/Deleted 1 task\./, 'Child + parent deleted'); #$output = qx{../src/task rc:recur.rc minimal 2>&1}; # TODO Delete a recurring task. #$output = qx{echo 'y' | ../src/task rc:recur.rc 4 delete 2>&1}; #diag ('---'); #diag ($output); #diag ('---'); # TODO Wait a recurring task # TODO Upgrade a task to a recurring task # TODO Downgrade a recurring task to a regular task # TODO Duplicate a recurring child task # TODO Duplicate a recurring parent task $output = qx{../src/task rc:recur.rc diag 2>&1}; like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key recur.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'recur.rc', 'Cleanup'); exit 0; task-2.2.0-test/recur.until.t000075500000000000000000000052411213035135600160730ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 8; # Create the rc file. if (open my $fh, '>', 'recur.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'recur.rc', 'Created recur.rc'); } # Create a few recurring tasks, and test the sort order of the recur column. qx{../src/task rc:recur.rc add foo due:now recur:2sec until:5sec 2>&1}; diag ("Sleeping for 6 seconds"); sleep 6; my $output = qx{../src/task rc:recur.rc list 2>&1}; like ($output, qr/^\s+2/ms, 'Found 2'); like ($output, qr/^\s+3/ms, 'Found 3'); like ($output, qr/^\s+4/ms, 'Found 4'); like ($output, qr/^\s+5/ms, 'Found 5'); qx{../src/task rc:recur.rc 2 do 2>&1}; qx{../src/task rc:recur.rc 3 do 2>&1}; qx{../src/task rc:recur.rc 4 do 2>&1}; qx{../src/task rc:recur.rc 5 do 2>&1}; $output = qx{../src/task rc:recur.rc list 2>&1 >/dev/null}; like ($output, qr/and was deleted/, 'Parent task deleted'); $output = qx{../src/task rc:recur.rc diag 2>&1}; like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key recur.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'recur.rc', 'Cleanup'); exit 0; task-2.2.0-test/recur.weekdays.t000075500000000000000000000046761213035135600165670ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'recur.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'recur.rc', 'Created recur.rc'); } # Create a few recurring tasks, and test the sort order of the recur column. qx{../src/task rc:recur.rc add due:friday recur:weekdays one 2>&1}; my $output = qx{../src/task rc:recur.rc list 2>&1}; like ($output, qr/one/, 'recur weekdays'); $output = qx{../src/task rc:recur.rc info 1 2>&1}; like ($output, qr/Recurrence\s+weekdays/, 'task recurs every weekday'); qx{../src/task rc:recur.rc 1 do 2>&1}; $output = qx{../src/task rc:recur.rc list 2>&1}; $output = qx{../src/task rc:recur.rc diag 2>&1}; like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key recur.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'recur.rc', 'Cleanup'); exit 0; task-2.2.0-test/roundtrip.t000075500000000000000000000062011213035135600156440ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'roundtrip.rc') { print $fh "data.location=.\n", "verbose=off\n", "confirmation=no\n", "defaultwidth=100\n"; close $fh; ok (-r 'roundtrip.rc', 'Created roundtrip.rc'); } # Add two tasks. qx{../src/task rc:roundtrip.rc add priority:H project:A one 2>&1}; qx{../src/task rc:roundtrip.rc add +tag1 +tag2 two 2>&1}; # trip 1. qx{../src/task rc:roundtrip.rc export > ./roundtrip.txt 2>&1}; unlink 'pending.data', 'completed.data', 'undo.data'; qx{../src/task rc:roundtrip.rc rc.debug:1 import ./roundtrip.txt 2>&1}; # trip 2. qx{../src/task rc:roundtrip.rc export > ./roundtrip.txt 2>&1}; unlink 'pending.data', 'completed.data', 'undo.data'; qx{../src/task rc:roundtrip.rc import ./roundtrip.txt 2>&1}; # Exammine. # ID Project Pri Added Started Due Recur Countdown Age Deps Tags Description # -- ------- --- -------- ------- --- ----- --------- --- ---- --------- --------- # 1 A H 8/7/2010 - one # 2 8/7/2010 - tag1 tag2 two my $output = qx{../src/task rc:roundtrip.rc long 2>&1}; like ($output, qr/1.+A.+H.+\d+\/\d+\/\d+.+(?:-|\d+).+one/, '2 round trips task 1 identical'); like ($output, qr/2.+\d+\/\d+\/\d+.+(?:-|\d+).+tag1\stag2\stwo/, '2 round trips task 2 identical'); # Cleanup. unlink qw(roundtrip.txt pending.data completed.data undo.data backlog.data synch.key roundtrip.rc); ok (! -r 'roundtrip.txt' && ! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'roundtrip.rc', 'Cleanup'); exit 0; task-2.2.0-test/run_all.in000075500000000000000000000021571213035135600154230ustar00rootroot00000000000000#! /bin/sh if [ x"$1" = x"--verbose" ]; then for i in ${TESTBLOB} do echo '#' $i ./$i > test.log 2>&1 while read LINE do echo $LINE done < test.log rm test.log done else date > all.log # Perl is used here to get the time in seconds # because 'date +%s' isn't supported on Solaris. STARTEPOCH=`perl -e 'print time'` VRAMSTEG=`which vramsteg` BAR=0 if [ -x "$VRAMSTEG" ]; then BAR=1 COUNT=0 TOTAL=`ls ${TESTBLOB} | wc -l` START=`$VRAMSTEG --now` fi for i in ${TESTBLOB} do echo '#' $i >>all.log if [ $BAR -eq 1 ]; then $VRAMSTEG --label 'All tests' --min 0 --max $TOTAL --current $COUNT --percentage --start $START --estimate COUNT=`expr $COUNT + 1` fi ./$i >> all.log 2>&1 done if [ $BAR -eq 1 ]; then $VRAMSTEG --remove fi date >> all.log ENDEPOCH=`perl -e 'print time'` RUNTIME=`expr $ENDEPOCH - $STARTEPOCH` printf "Pass: %5d\n" `grep -c '^ok' all.log` printf "Fail: %5d\n" `grep -c '^not' all.log` printf "Skipped: %5d\n" `grep -c '^skip' all.log` printf "Runtime: %5d seconds\n" $RUNTIME fi task-2.2.0-test/rx.t.cpp000064400000000000000000000076051213035135600150360ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include Context context; int main (int argc, char** argv) { UnitTest ut (23); std::string text = "This is a test."; RX r1 ("i. ", true); ut.ok (r1.match (text), text + " =~ /i. /"); std::vector matches; ut.ok (r1.match (matches, text), text + " =~ /i. /"); ut.ok (matches.size () == 2, "2 match"); ut.is (matches[0], "is ", "$1 == is\\s"); ut.is (matches[1], "is ", "$1 == is\\s"); text = "abcdefghijklmnopqrstuvwxyz"; RX r3 ("t..", true); ut.ok (r3.match (text), "t.."); RX r4 ("T..", false); ut.ok (r4.match (text), "T.."); RX r5 ("T..", true); ut.ok (!r5.match (text), "! T.."); text = "this is a test of the regex engine."; // |...:....|....:....|....:....|....: RX r6 ("^this"); ut.ok (r6.match (text), "^this matches"); RX r7 ("engine\\.$"); ut.ok (r7.match (text), "engine\\.$ matches"); std::vector results; std::vector start; std::vector end; RX r8 ("e..", true); ut.ok (r8.match (results, text), "e.. there are matches"); ut.ok (r8.match (start, end, text), "e.. there are matches"); ut.is (results.size (), (size_t) 4, "e.. == 4 matches"); ut.is (results[0], "est", "e..[0] == 'est'"); ut.is (start[0], 11, "e..[0] == 11->"); ut.is (end[0], 14, "e..[0] == ->14"); results.clear (); RX r9 ("e", true); ut.ok (r9.match (results, text), "e there are matches"); ut.is (results.size (), (size_t) 6, "e == 6 matches"); start.clear (); end.clear (); ut.ok (r9.match (start, end, text), "e there are matches"); ut.is (start.size (), (size_t) 6, "e == 6 matches"); #if defined(DARWIN) || defined(CYGWIN) || defined(FREEBSD) text = "this is the end."; ut.pass (text + " =~ /\\bthe/"); ut.pass (text + " =~ /the\\b/"); ut.pass (text + " =~ /\\bthe\\b/"); #elif defined(SOLARIS) RX r10 ("\\"); ut.ok (r11.match (text), text + " =~ /the\\>/"); RX r12 ("\\"); ut.ok (r12.match (text), text + " =~ /\\/"); #else RX r10 ("\\bthe"); text = "this is the end."; ut.ok (r10.match (text), text + " =~ /\\bthe/"); RX r11 ("the\\b"); ut.ok (r11.match (text), text + " =~ /the\\b/"); RX r12 ("\\bthe\\b"); ut.ok (r12.match (text), text + " =~ /\\bthe\\b/"); #endif return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/sequence.t000075500000000000000000000124151213035135600154320ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 26; # Create the rc file. if (open my $fh, '>', 'seq.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'seq.rc', 'Created seq.rc'); } # Test sequences in done/undo qx{../src/task rc:seq.rc add one mississippi 2>&1}; qx{../src/task rc:seq.rc add two mississippi 2>&1}; qx{../src/task rc:seq.rc 1,2 do 2>&1}; my $output = qx{../src/task rc:seq.rc info 1 2>&1}; like ($output, qr/Status\s+Completed/, 'sequence do 1'); $output = qx{../src/task rc:seq.rc info 2 2>&1}; like ($output, qr/Status\s+Completed/, 'sequence do 2'); qx{../src/task rc:seq.rc undo 2>&1}; qx{../src/task rc:seq.rc undo 2>&1}; $output = qx{../src/task rc:seq.rc info 1 2>&1}; like ($output, qr/Status\s+Pending/, 'sequence undo 1'); $output = qx{../src/task rc:seq.rc info 2 2>&1}; like ($output, qr/Status\s+Pending/, 'sequence undo 2'); # Test sequences in delete/undelete qx{../src/task rc:seq.rc 1,2 delete 2>&1}; $output = qx{../src/task rc:seq.rc info 1 2>&1}; like ($output, qr/Status\s+Deleted/, 'sequence delete 1'); $output = qx{../src/task rc:seq.rc info 2 2>&1}; like ($output, qr/Status\s+Deleted/, 'sequence delete 2'); qx{../src/task rc:seq.rc undo 2>&1}; qx{../src/task rc:seq.rc undo 2>&1}; $output = qx{../src/task rc:seq.rc info 1 2>&1}; like ($output, qr/Status\s+Pending/, 'sequence undo 1'); $output = qx{../src/task rc:seq.rc info 2 2>&1}; like ($output, qr/Status\s+Pending/, 'sequence undo 2'); # Test sequences in start/stop qx{../src/task rc:seq.rc 1,2 start 2>&1}; $output = qx{../src/task rc:seq.rc info 1 2>&1}; like ($output, qr/Start/, 'sequence start 1'); $output = qx{../src/task rc:seq.rc info 2 2>&1}; like ($output, qr/Start/, 'sequence start 2'); qx{../src/task rc:seq.rc 1,2 stop 2>&1}; $output = qx{../src/task rc:seq.rc info 1 2>&1}; like ($output, qr/Start\sdeleted/, 'sequence stop 1'); $output = qx{../src/task rc:seq.rc info 2 2>&1}; like ($output, qr/Start\sdeleted/, 'sequence stop 2'); # Test sequences in modify qx{../src/task rc:seq.rc 1,2 modify +tag 2>&1}; $output = qx{../src/task rc:seq.rc info 1 2>&1}; like ($output, qr/Tags\s+tag/, 'sequence modify 1'); $output = qx{../src/task rc:seq.rc info 2 2>&1}; like ($output, qr/Tags\s+tag/, 'sequence modify 2'); qx{../src/task rc:seq.rc 1,2 modify -tag 2>&1}; $output = qx{../src/task rc:seq.rc info 1 2>&1}; unlike ($output, qr/Tags\s+tag/, 'sequence unmodify 1'); $output = qx{../src/task rc:seq.rc info 2 2>&1}; unlike ($output, qr/Tags\s+tag/, 'sequence unmodify 2'); # Test sequences in substitutions qx{../src/task rc:seq.rc 1,2 modify /miss/Miss/ 2>&1}; $output = qx{../src/task rc:seq.rc info 1 2>&1}; like ($output, qr/Description\s+one Miss/, 'sequence substitution 1'); $output = qx{../src/task rc:seq.rc info 2 2>&1}; like ($output, qr/Description\s+two Miss/, 'sequence substitution 2'); # Test sequences in info $output = qx{../src/task rc:seq.rc info 1,2 2>&1}; like ($output, qr/Description\s+one Miss/, 'sequence info 1'); like ($output, qr/Description\s+two Miss/, 'sequence info 2'); # Test sequences in duplicate qx{../src/task rc:seq.rc 1,2 duplicate pri:H 2>&1}; $output = qx{../src/task rc:seq.rc info 3 2>&1}; like ($output, qr/Priority\s+H/, 'sequence duplicate 1'); $output = qx{../src/task rc:seq.rc info 4 2>&1}; like ($output, qr/Priority\s+H/, 'sequence duplicate 2'); # Test sequences in annotate qx{../src/task rc:seq.rc 1,2 annotate note 2>&1}; $output = qx{../src/task rc:seq.rc info 1 2>&1}; like ($output, qr/\d+\/\d+\/\d+ note/, 'sequence 1 annotate'); $output = qx{../src/task rc:seq.rc info 2 2>&1}; like ($output, qr/\d+\/\d+\/\d+ note/, 'sequence 2 annotate'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key seq.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'seq.rc', 'Cleanup'); exit 0; task-2.2.0-test/shadow.t000075500000000000000000000076021213035135600151110ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 18; # Create the rc file. if (open my $fh, '>', 'shadow.rc') { print $fh "data.location=.\n", "confirmation=off\n", "shadow.file=./shadow.txt\n", "shadow.command=rc:shadow.rc stats\n", "shadow.notify=on\n"; close $fh; ok (-r 'shadow.rc', 'Created shadow.rc'); } my $output = qx{../src/task rc:shadow.rc add one 2>&1 >/dev/null}; like ($output, qr/\[Shadow file '\.\/shadow\.txt' updated\.\]/, 'shadow file updated on add'); $output = qx{../src/task rc:shadow.rc list 2>&1 >/dev/null}; unlike ($output, qr/\[Shadow file '\.\/shadow\.txt' updated\.\]/, 'shadow file not updated on list'); $output = qx{../src/task rc:shadow.rc 1 delete 2>&1 >/dev/null}; like ($output, qr/\[Shadow file '\.\/shadow\.txt' updated\.\]/, 'shadow file updated on delete'); $output = qx{../src/task rc:shadow.rc list 2>&1 >/dev/null}; unlike ($output, qr/\[Shadow file '\.\/shadow\.txt' updated\.\]/, 'shadow file not updated on list'); # Inspect the shadow file. my $file = slurp ('./shadow.txt'); like ($file, qr/Pending\s+0\n/, 'Pending 0'); like ($file, qr/Recurring\s+0\n/, 'Recurring 0'); like ($file, qr/Completed\s+0\n/, 'Completed 0'); like ($file, qr/Deleted\s+1\n/, 'Deleted 1'); like ($file, qr/Total\s+1\n/, 'Total 1'); like ($file, qr/Task used for\s+-\n/, 'Task used for -'); like ($file, qr/Task added every\s+-\n/, 'Task added every -'); like ($file, qr/Task deleted every\s+-\n/, 'Task deleted every -'); like ($file, qr/Average desc length\s+3 characters\n/, 'Average desc length 3 characters'); like ($file, qr/Tasks tagged\s+0%\n/, 'Tasks tagged 0%'); like ($file, qr/Unique tags\s+0\n/, 'Unique tags 0'); like ($file, qr/Projects\s+0\n/, 'Projects 0'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key shadow.txt shadow.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'shadow.txt' && ! -r 'shadow.rc', 'Cleanup'); exit 0; ################################################################################ sub slurp { my ($file) = @_; local $/; if (open my $fh, '<', $file) { my $contents = <$fh>; close $fh; return $contents; } ''; } task-2.2.0-test/shell.t000075500000000000000000000046271213035135600147370ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'shell.rc') { print $fh "data.location=.\n", "shell.prompt=testprompt>\n", "defaultwidth=0\n", "default.command=ls\n"; close $fh; ok (-r 'shell.rc', 'Created shell.rc'); } # Test the prompt. my $output = qx{echo "quit" | ../src/task rc:shell.rc shell 2>&1}; like ($output, qr/testprompt>/, 'custom prompt is being used'); # Test a simple add, then info. qx{echo "add foo" | ../src/task rc:shell.rc shell 2>&1}; $output = qx{echo "1 info" | ../src/task rc:shell.rc shell 2>&1}; like ($output, qr/Description\s+foo/, 'add/info working'); unlink 'shell.rc'; ok (!-r 'shell.rc', 'Removed shell.rc'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key shell.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'shell.rc', 'Cleanup'); exit 0; task-2.2.0-test/sorting.t000075500000000000000000000230171213035135600153070ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 100; # Create the rc file. if (open my $fh, '>', 'sorting.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'sorting.rc', 'Created sorting.rc'); } # Test assorted sort orders. qx{../src/task rc:sorting.rc add zero 2>&1}; qx{../src/task rc:sorting.rc add priority:H project:A due:yesterday one 2>&1}; qx{../src/task rc:sorting.rc add priority:M project:B due:today two 2>&1}; qx{../src/task rc:sorting.rc add priority:L project:C due:tomorrow three 2>&1}; qx{../src/task rc:sorting.rc add priority:H project:C due:today four 2>&1}; qx{../src/task rc:sorting.rc 2 start 2>&1}; #diag (qx{../src/task rc:sorting.rc list}); my %tests = ( # Single sort column. 'priority-' => ['(?:one.+four|four.+one).+two.+three.+zero'], 'priority+' => ['zero.+three.+two.+(?:one.+four|four.+one)'], 'project-' => ['(?:three.+four|four.+three).+two.+one.+zero'], 'project+' => ['zero.+one.+two.+(?:three.+four|four.+three)'], 'start-' => ['one.+zero', 'one.+two', 'one.+three', 'one.+four'], 'start+' => ['zero.+one', 'two.+one', 'three.+one', 'four.+one'], 'due-' => ['three.+(?:two.+four|four.+two).+one.+zero'], 'due+' => ['one.+(?:two.+four|four.+two).+three.+zero'], 'description-' => ['zero.+two.+three.+one.+four'], 'description+' => ['four.+one.+three.+two.+zero'], # Two sort columns. 'priority-,project-' => ['four.+one.+two.+three.+zero'], 'priority-,project+' => ['one.+four.+two.+three.+zero'], 'priority+,project-' => ['zero.+three.+two.+four.+one'], 'priority+,project+' => ['zero.+three.+two.+one.+four'], 'priority-,start-' => ['one.+four.+two.+three.+zero'], 'priority-,start+' => ['four.+one.+two.+three.+zero'], 'priority+,start-' => ['zero.+three.+two.+one.+four'], 'priority+,start+' => ['zero.+three.+two.+four.+one'], 'priority-,due-' => ['four.+one.+two.+three.+zero'], 'priority-,due+' => ['one.+four.+two.+three.+zero'], 'priority+,due-' => ['zero.+three.+two.+four.+one'], 'priority+,due+' => ['zero.+three.+two.+one.+four'], 'priority-,description-' => ['one.+four.+two.+three.+zero'], 'priority-,description+' => ['four.+one.+two.+three.+zero'], 'priority+,description-' => ['zero.+three.+two.+one.+four'], 'priority+,description+' => ['zero.+three.+two.+four.+one'], 'project-,priority-' => ['four.+three.+two.+one.+zero'], 'project-,priority+' => ['three.+four.+two.+one.+zero'], 'project+,priority-' => ['zero.+one.+two.+four.+three'], 'project+,priority+' => ['zero.+one.+two.+three.+four'], 'project-,start-' => ['three.+four.+two.+one.+zero'], 'project-,start+' => ['(?:four.+three|three.+four).+two.+one.+zero'], 'project+,start-' => ['zero.+one.+two.+three.+four'], 'project+,start+' => ['zero.+one.+two.+(?:four.+three|three.+four)'], 'project-,due-' => ['three.+four.+two.+one.+zero'], 'project-,due+' => ['four.+three.+two.+one.+zero'], 'project+,due-' => ['zero.+one.+two.+three.+four'], 'project+,due+' => ['zero.+one.+two.+four.+three'], 'project-,description-' => ['three.+four.+two.+one.+zero'], 'project-,description+' => ['four.+three.+two.+one.+zero'], 'project+,description-' => ['zero.+one.+two.+three.+four'], 'project+,description+' => ['zero.+one.+two.+four.+three'], 'start-,priority-' => ['one.+four.+two.+three.+zero'], 'start-,priority+' => ['one.+zero.+three.+two.+four'], 'start+,priority-' => ['four.+two.+three.+zero.+one'], 'start+,priority+' => ['zero.+three.+two.+four.+one'], 'start-,project-' => ['one.+(?:three.+four|four.+three).+two.+zero'], 'start-,project+' => ['one.+zero.+two.+(?:three.+four|four.+three)'], 'start+,project-' => ['(?:three.+four|four.+three).+two.+zero.+one'], 'start+,project+' => ['zero.+two.+(?:three.+four|four.+three).+one'], 'start-,due-' => ['one.+three.+(?:four.+two|two.+four).+zero'], 'start-,due+' => ['one.+(?:four.+two|two.+four).+three.+zero'], 'start+,due-' => ['three.+(?:four.+two|two.+four).+zero.+one'], 'start+,due+' => ['(?:four.+two|two.+four).+three.+zero.+one'], 'start-,description-' => ['one.+zero.+two.+three.+four'], 'start-,description+' => ['one.+four.+three.+two.+zero'], 'start+,description-' => ['zero.+two.+three.+four.+one'], 'start+,description+' => ['four.+three.+two.+zero.+one'], 'due-,priority-' => ['three.+four.+two.+one.+zero'], 'due-,priority+' => ['three.+two.+four.+one.+zero'], 'due+,priority-' => ['one.+four.+two.+three.+zero'], 'due+,priority+' => ['one.+two.+four.+three.+zero'], 'due-,project-' => ['three.+four.+two.+one.+zero'], 'due-,project+' => ['three.+two.+four.+one.+zero'], 'due+,project-' => ['one.+four.+two.+three.+zero'], 'due+,project+' => ['one.+two.+four.+three.+zero'], 'due-,start-' => ['three.+(?:four.+two|two.+four).+one.+zero'], 'due-,start+' => ['three.+(?:four.+two|two.+four).+one.+zero'], 'due+,start-' => ['one.+(?:four.+two|two.+four).+three.+zero'], 'due+,start+' => ['one.+(?:four.+two|two.+four).+three.+zero'], 'due-,description-' => ['three.+two.+four.+one.+zero'], 'due-,description+' => ['three.+four.+two.+one.+zero'], 'due+,description-' => ['one.+two.+four.+three.+zero'], 'due+,description+' => ['one.+four.+two.+three.+zero'], 'description-,priority-' => ['zero.+two.+three.+one.+four'], 'description-,priority+' => ['zero.+two.+three.+one.+four'], 'description+,priority-' => ['four.+one.+three.+two.+zero'], 'description+,priority+' => ['four.+one.+three.+two.+zero'], 'description-,project-' => ['zero.+two.+three.+one.+four'], 'description-,project+' => ['zero.+two.+three.+one.+four'], 'description+,project-' => ['four.+one.+three.+two.+zero'], 'description+,project+' => ['four.+one.+three.+two.+zero'], 'description-,start-' => ['zero.+two.+three.+one.+four'], 'description-,start+' => ['zero.+two.+three.+one.+four'], 'description+,start-' => ['four.+one.+three.+two.+zero'], 'description+,start+' => ['four.+one.+three.+two.+zero'], 'description-,due-' => ['zero.+two.+three.+one.+four'], 'description-,due+' => ['zero.+two.+three.+one.+four'], 'description+,due-' => ['four.+one.+three.+two.+zero'], 'description+,due+' => ['four.+one.+three.+two.+zero'], # Four sort columns. 'start+,project+,due+,priority+' => ['zero.+two.+four.+three.+one'], 'project+,due+,priority+,start+' => ['zero.+one.+two.+four.+three'], ); for my $sort (sort keys %tests) { my $output = qx{../src/task rc:sorting.rc rc.report.list.sort:${sort} list 2>&1}; for my $expectation (@{$tests{$sort}}) { like ($output, qr/$expectation/ms, "sort:${sort}"); } } # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key sorting.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'sorting.rc', 'Cleanup'); exit 0; task-2.2.0-test/special.t000075500000000000000000000053631213035135600152460ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'special.rc') { print $fh "data.location=.\n", "color.keyword.red=red\n", "color.alternate=\n", "color.tagged=\n", "color.pri.H=\n", "color.completed=\n", "nag=NAG\n", "_forcecolor=1\n"; close $fh; ok (-r 'special.rc', 'Created special.rc'); } # Prove that +nocolor suppresses all color for a task. qx{../src/task rc:special.rc add should have no red +nocolor priority:H 2>&1}; qx{../src/task rc:special.rc add should be red +nonag 2>&1}; my $output = qx{../src/task rc:special.rc ls 2>&1}; like ($output, qr/\s1\s+H\s+should have no red/, 'no red in first task due to +nocolor'); like ($output, qr/\033\[31mshould be red\s+\033\[0m/, 'red in second task'); # Prove that +nonag suppresses nagging when a low priority task is completed # ahead of a high priority one. $output = qx{../src/task rc:special.rc 2 done 2>&1}; unlike ($output, qr/NAG/, '+nonag suppressed nagging for task 2'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key special.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'special.rc', 'Cleanup'); exit 0; task-2.2.0-test/start.t000075500000000000000000000100511213035135600147510ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 17; # Create the rc file. if (open my $fh, '>', 'start.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'start.rc', 'Created start.rc'); } # Test the add/start/stop commands. qx{../src/task rc:start.rc add one 2>&1}; qx{../src/task rc:start.rc add two 2>&1}; my $output = qx{../src/task rc:start.rc active 2>&1}; unlike ($output, qr/one/, 'one not active'); unlike ($output, qr/two/, 'two not active'); qx{../src/task rc:start.rc 1 start 2>&1}; qx{../src/task rc:start.rc 2 start 2>&1}; $output = qx{../src/task rc:start.rc active 2>&1}; like ($output, qr/one/, 'one active'); like ($output, qr/two/, 'two active'); qx{../src/task rc:start.rc 1 stop 2>&1}; $output = qx{../src/task rc:start.rc active 2>&1}; unlike ($output, qr/one/, 'one not active'); like ($output, qr/two/, 'two active'); qx{../src/task rc:start.rc 2 stop 2>&1}; $output = qx{../src/task rc:start.rc active 2>&1}; unlike ($output, qr/one/, 'one not active'); unlike ($output, qr/two/, 'two not active'); qx{../src/task rc:start.rc 2 done 2>&1}; $output = qx{../src/task rc:start.rc list 2>&1}; unlike ($output, qr/two/, 'two deleted'); # Create the rc file. if (open my $fh, '>', 'start2.rc') { print $fh "data.location=.\n", "journal.time=on\n"; close $fh; ok (-r 'start2.rc', 'Created start2.rc'); } qx{../src/task rc:start2.rc 1 start 2>&1}; $output = qx{../src/task rc:start2.rc list 2>&1}; like ($output, qr/Started task/, 'one start and annotated'); qx{../src/task rc:start2.rc 1 stop 2>&1}; $output = qx{../src/task rc:start2.rc list 2>&1}; like ($output, qr/Stopped task/, 'one stopped and annotated'); # Create the rc file. if (open my $fh, '>', 'start3.rc') { print $fh "data.location=.\n", "journal.time=on\n", "journal.time.start.annotation=Nu kör vi\n", "journal.time.stop.annotation=Nu stannar vi\n"; close $fh; ok (-r 'start3.rc', 'Created start3.rc'); } qx{../src/task rc:start3.rc 1 start 2>&1}; $output = qx{../src/task rc:start3.rc list 2>&1}; like ($output, qr/Nu.+kör.+vi/ms, 'one start and annotated with custom description'); qx{../src/task rc:start3.rc 1 stop 2>&1}; $output = qx{../src/task rc:start3.rc list 2>&1}; like ($output, qr/Nu.+stannar.+vi/ms, 'one stopped and annotated with custom description'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key start.rc start2.rc start3.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'start.rc' && ! -r 'start2.rc' && ! -r 'start3.rc', 'Cleanup'); exit 0; task-2.2.0-test/subproject.t000075500000000000000000000055421213035135600160050ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 10; # Create the rc file. if (open my $fh, '>', 'sp.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'sp.rc', 'Created sp.rc'); } my $setup = "../src/task rc:sp.rc add project:abc abc 2>&1;" . "../src/task rc:sp.rc add project:ab ab 2>&1;" . "../src/task rc:sp.rc add project:a a 2>&1;" . "../src/task rc:sp.rc add project:b b 2>&1;"; qx{$setup}; my $output = qx{../src/task rc:sp.rc list project:b 2>&1}; like ($output, qr/\bb\s*$/m, 'abc,ab,a,b | b -> b'); $output = qx{../src/task rc:sp.rc list project:a 2>&1}; like ($output, qr/\babc\s*$/m, 'abc,ab,a,b | a -> abc'); like ($output, qr/\bab\s*$/m, 'abc,ab,a,b | a -> ab'); like ($output, qr/\ba\s*$/m, 'abc,ab,a,b | a -> a'); $output = qx{../src/task rc:sp.rc list project:ab 2>&1}; like ($output, qr/\babc\s*$/m, 'abc,ab,a,b | a -> abc'); like ($output, qr/\bab\s*$/m, 'abc,ab,a,b | a -> ab'); $output = qx{../src/task rc:sp.rc list project:abc 2>&1}; like ($output, qr/\babc\s*$/m, 'abc,ab,a,b | a -> abc'); $output = qx{../src/task rc:sp.rc list project:abcd 2>&1 >/dev/null}; like ($output, qr/No matches./, 'abc,ab,a,b | abcd -> nul'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key sp.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'sp.rc', 'Cleanup'); exit 0; task-2.2.0-test/substitute.t000075500000000000000000000066001213035135600160340ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 9; # Create the rc file. if (open my $fh, '>', 'subst.rc') { print $fh "data.location=.\n", "regex=off\n"; close $fh; ok (-r 'subst.rc', 'Created subst.rc'); } # Test the substitution command. qx{../src/task rc:subst.rc add foo foo foo 2>&1}; qx{../src/task rc:subst.rc 1 modify /foo/FOO/ 2>&1}; my $output = qx{../src/task rc:subst.rc info 1 2>&1}; like ($output, qr/FOO foo foo/, 'substitution in description'); qx{../src/task rc:subst.rc 1 modify /foo/FOO/g 2>&1}; $output = qx{../src/task rc:subst.rc info 1 2>&1}; like ($output, qr/FOO FOO FOO/, 'global substitution in description'); # Test the substitution command on annotations. qx{../src/task rc:subst.rc 1 annotate bar bar bar 2>&1}; qx{../src/task rc:subst.rc 1 modify /bar/BAR/ 2>&1}; $output = qx{../src/task rc:subst.rc info 1 2>&1}; like ($output, qr/BAR bar bar/, 'substitution in annotation'); qx{../src/task rc:subst.rc 1 modify /bar/BAR/g 2>&1}; $output = qx{../src/task rc:subst.rc info 1 2>&1}; like ($output, qr/BAR BAR BAR/, 'global substitution in annotation'); qx{../src/task rc:subst.rc 1 modify /FOO/aaa/ 2>&1}; qx{../src/task rc:subst.rc 1 modify /FOO/bbb/ 2>&1}; qx{../src/task rc:subst.rc 1 modify /FOO/ccc/ 2>&1}; $output = qx{../src/task rc:subst.rc info 1 2>&1}; like ($output, qr/aaa bbb ccc/, 'individual successive substitution in description'); qx{../src/task rc:subst.rc 1 modify /bbb// 2>&1}; $output = qx{../src/task rc:subst.rc info 1 2>&1}; like ($output, qr/aaa ccc/, 'word deletion in description'); # Regexes qx{../src/task rc:subst.rc rc.regex:on 1 modify "/c{3}/CcC/" 2>&1}; $output = qx{../src/task rc:subst.rc info 1 2>&1}; like ($output, qr/aaa CcC/, 'regex'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key subst.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'subst.rc', 'Cleanup'); exit 0; task-2.2.0-test/t.t.cpp000064400000000000000000000144351213035135600146470ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { UnitTest test (37); test.is ((int)Task::textToStatus ("pending"), (int)Task::pending, "textToStatus pending"); test.is ((int)Task::textToStatus ("completed"), (int)Task::completed, "textToStatus completed"); test.is ((int)Task::textToStatus ("deleted"), (int)Task::deleted, "textToStatus deleted"); test.is ((int)Task::textToStatus ("recurring"), (int)Task::recurring, "textToStatus recurring"); test.is (Task::statusToText (Task::pending), "pending", "statusToText pending"); test.is (Task::statusToText (Task::completed), "completed", "statusToText completed"); test.is (Task::statusToText (Task::deleted), "deleted", "statusToText deleted"); test.is (Task::statusToText (Task::recurring), "recurring", "statusToText recurring"); // Round-trip testing. Task t3; t3.set ("name", "value"); std::string before = t3.composeF4 (); t3.parse (before); std::string after = t3.composeF4 (); t3.parse (after); after = t3.composeF4 (); t3.parse (after); after = t3.composeF4 (); test.is (before, after, "Task::composeF4 -> parse round trip 4 iterations"); // Legacy Format 1 // [tags] [attributes] description\n // X [tags] [attributes] description\n std::string sample = "[tag1 tag2] [att1:value1 att2:value2] Description"; sample = "X " "[one two] " "[att1:value1 att2:value2] " "Description"; bool good = true; try { Task ff1 (sample); } catch (...) { good = false; } test.notok (good, "Support for ff1 removed"); // Legacy Format 2 // uuid status [tags] [attributes] description\n sample = "00000000-0000-0000-0000-000000000000 " "- " "[tag1 tag2] " "[att1:value1 att2:value2] " "Description"; Task ff2 (sample); std::string value = ff2.get ("uuid"); test.is (value, "00000000-0000-0000-0000-000000000000", "ff2 uuid"); value = ff2.get ("status"); test.is (value, "pending", "ff2 status"); test.ok (ff2.hasTag ("tag1"), "ff2 tag1"); test.ok (ff2.hasTag ("tag2"), "ff2 tag2"); test.is (ff2.getTagCount (), 2, "ff2 # tags"); value = ff2.get ("att1"); test.is (value, "value1", "ff2 att1"); value = ff2.get ("att2"); test.is (value, "value2", "ff2 att2"); value = ff2.get ("description"); test.is (value, "Description", "ff2 description"); // Legacy Format 3 // uuid status [tags] [attributes] [annotations] description\n sample = "00000000-0000-0000-0000-000000000000 " "- " "[tag1 tag2] " "[att1:value1 att2:value2] " "[123:ann1 456:ann2] Description"; Task ff3 (sample); value = ff2.get ("uuid"); test.is (value, "00000000-0000-0000-0000-000000000000", "ff3 uuid"); value = ff2.get ("status"); test.is (value, "pending", "ff3 status"); test.ok (ff2.hasTag ("tag1"), "ff3 tag1"); test.ok (ff2.hasTag ("tag2"), "ff3 tag2"); test.is (ff2.getTagCount (), 2, "ff3 # tags"); value = ff3.get ("att1"); test.is (value, "value1", "ff3 att1"); value = ff3.get ("att2"); test.is (value, "value2", "ff3 att2"); value = ff3.get ("description"); test.is (value, "Description", "ff3 description"); // Current Format 4 // [name:"value" ...]\n sample = "[" "uuid:\"00000000-0000-0000-0000-000000000000\" " "status:\"P\" " "tags:\"tag1&commaltag2\" " "att1:\"value1\" " "att2:\"value2\" " "description:\"Description\"" "]"; Task ff4 (sample); value = ff2.get ("uuid"); test.is (value, "00000000-0000-0000-0000-000000000000", "ff4 uuid"); value = ff2.get ("status"); test.is (value, "pending", "ff4 status"); test.ok (ff2.hasTag ("tag1"), "ff4 tag1"); test.ok (ff2.hasTag ("tag2"), "ff4 tag2"); test.is (ff2.getTagCount (), 2, "ff4 # tags"); value = ff4.get ("att1"); test.is (value, "value1", "ff4 att1"); value = ff4.get ("att2"); test.is (value, "value2", "ff4 att2"); value = ff4.get ("description"); test.is (value, "Description", "ff4 description"); /* TODO Task::composeCSV TODO Task::composeYAML TODO Task::id TODO Task::*Status TODO Task::*Tag* TODO Task::*Annotation* TODO Task::addDependency TODO Task::addDependency TODO Task::removeDependency TODO Task::removeDependency TODO Task::getDependencies TODO Task::getDependencies TODO Task::urgency */ // Task::operator== Task left ("[one:1 two:2 three:3]"); Task right (left); test.ok (left == right, "left == right -> true"); left.set ("one", "1.0"); test.notok (left == right, "left == right -> false"); // Task::validate Task bad ("[entry:1000000001 start:1000000000]"); good = true; try { bad.validate (); } catch (...) { good = false; } test.notok (good, "Task::validate entry <= start"); return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/t2.t.cpp000064400000000000000000000071451213035135600147310ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { UnitTest t (18); // (blank) bool good = true; Task task; try {task = Task ("");} catch (const std::string& e){t.diag (e); good = false;} t.notok (good, "Task::Task ('')"); // [] good = true; try {task = Task ("[]");} catch (const std::string& e){t.diag (e); good = false;} t.notok (good, "Task::Task ('[]')"); // [name:"value"] good = true; try {task = Task ("[name:\"value\"]");} catch (const std::string& e){t.diag (e); good = false;} t.ok (good, "Task::Task ('[name:\"value\"]')"); t.is (task.get ("name"), "value", "name=value"); // [name:"one two"] good = true; try {task = Task ("[name:\"one two\"]");} catch (const std::string& e){t.diag (e); good = false;} t.ok (good, "Task::Task ('[name:\"one two\"]')"); t.is (task.get ("name"), "one two", "name=one two"); // [one:two three:four] good = true; try {task = Task ("[one:\"two\" three:\"four\"]");} catch (const std::string& e){t.diag (e); good = false;} t.ok (good, "Task::Task ('[one:\"two\" three:\"four\"]')"); t.is (task.get ("one"), "two", "one=two"); t.is (task.get ("three"), "four", "three=four"); // Task::set task.clear (); task.set ("name", "value"); t.is (task.composeF4 (), "[name:\"value\"]\n", "Task::set"); // Task::has t.ok (task.has ("name"), "Task::has"); t.notok (task.has ("woof"), "Task::has not"); // Task::get_int task.set ("one", 1); t.is (task.composeF4 (), "[name:\"value\" one:\"1\"]\n", "Task::set"); t.is (task.get_int ("one"), 1, "Task::get_int"); // Task::get_ulong task.set ("two", "4294967295"); t.is (task.composeF4 (), "[name:\"value\" one:\"1\" two:\"4294967295\"]\n", "Task::set"); t.is ((size_t)task.get_ulong ("two"), (size_t)4294967295UL, "Task::get_ulong"); // Task::remove task.remove ("one"); task.remove ("two"); t.is (task.composeF4 (), "[name:\"value\"]\n", "Task::remove"); // Task::all t.is (task.size (), (size_t)1, "Task::all size"); return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/tag.t000075500000000000000000000056701213035135600144020ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 8; # Create the rc file. if (open my $fh, '>', 'tag.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'tag.rc', 'Created tag.rc'); } # Add task with tags. my $output = qx{../src/task rc:tag.rc add +one This +two is a test +three 2>&1; ../src/task rc:tag.rc info 1 2>&1}; like ($output, qr/^Tags\s+one two three\n/m, 'tags found'); # Remove tags. $output = qx{../src/task rc:tag.rc 1 modify -three -two -one 2>&1; ../src/task rc:tag.rc info 1 2>&1}; unlike ($output, qr/^Tags/m, '-three -two -one tag removed'); # Add tags. $output = qx{../src/task rc:tag.rc 1 modify +four +five +six 2>&1; ../src/task rc:tag.rc info 1 2>&1}; like ($output, qr/^Tags\s+four five six\n/m, 'tags found'); # Remove tags. $output = qx{../src/task rc:tag.rc 1 modify -four -five -six 2>&1; ../src/task rc:tag.rc info 1 2>&1}; unlike ($output, qr/^Tags/m, '-four -five -six tag removed'); # Add and remove tags. $output = qx{../src/task rc:tag.rc 1 modify +duplicate -duplicate 2>&1; ../src/task rc:tag.rc info 1 2>&1}; unlike ($output, qr/^Tags/m, '+duplicate -duplicate NOP'); # Remove missing tag. $output = qx{../src/task rc:tag.rc 1 modify -missing 2>&1; ../src/task rc:tag.rc info 1 2>&1}; unlike ($output, qr/^Tags/m, '-missing NOP'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key tag.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'tag.rc', 'Cleanup'); exit 0; task-2.2.0-test/taskmod.t.cpp000064400000000000000000000077611213035135600160520ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { UnitTest t (16); bool good = true; // base timestamp unsigned long timestamp = (unsigned long)time(NULL); timestamp -= timestamp % 100; // create some tasks Task tasks[3]; // base task tasks[0] = Task("[description:\"Desc1\" uuid:\"df95dac3-5f2b-af88-5416-03a3163d00fd\"]"); // first modification tasks[1] = tasks[0]; tasks[1].addTag("tag1"); // second modification tasks[2] = tasks[1]; tasks[2].setStatus(Task::completed); // create taskmods Taskmod mods[4]; mods[0] = Taskmod(); mods[0].setTimestamp(timestamp); mods[0].setBefore(tasks[0]); mods[0].setAfter(tasks[1]); mods[1] = Taskmod(); mods[1].setTimestamp(timestamp + 2); mods[1].setBefore(tasks[1]); mods[1].setAfter(tasks[2]); // getUuid() not Taskmod empty = Taskmod(); good = true; try { empty.getUuid(); } catch (const std::string& e) { t.diag(e); good = false; } t.notok (good, "Taskmod::getUuid() not"); // issetAfter() not Taskmod newMod = Taskmod(); t.notok(newMod.issetAfter(), "Taskmod::issetAfter() not"); // getUuid() newMod.setAfter(tasks[1]); try { std::string uuid = newMod.getUuid(); t.is(uuid, "df95dac3-5f2b-af88-5416-03a3163d00fd", "Taskmod::getUuid()"); } catch (const std::string& e) { t.diag(e); t.fail("Taskmod::getUuid()"); } // isValid() not t.notok(newMod.isValid(), "Taskmod::isValid() not") ; // issetBefore() not t.notok(newMod.issetBefore(), "Taskmod::issetBefore() not"); // isValid() newMod.setTimestamp(timestamp+1); t.ok(newMod.isValid(), "Taskmod::isValid()"); // isNew() t.ok(newMod.isNew(), "Taskmod::isNew()"); // issetBefore() newMod.setBefore(tasks[0]); t.ok(newMod.issetBefore(), "Taskmod::issetBefore()"); // isNew() not t.notok(newMod.isNew(), "Taskmod::isNew() not"); // < t.ok(mods[0] < newMod, "Taskmod::operator<"); t.notok(newMod < mods[0], "Taskmod::operator< not"); // > t.ok(mods[1] > mods[0], "Taskmod::operator>"); t.notok(mods[0] > mods[1], "Taskmod::operator> not"); // != t.ok(mods[0] != mods[1], "Taskmod::operator!=" ); // copy constructor Taskmod clone1 = Taskmod(mods[0]); t.ok(mods[0] == clone1, "Taskmod::Taskmod(const Taskmod&)"); // = Taskmod clone2 = mods[0]; t.ok(mods[0] == clone2, "Taskmod::operator="); return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/tdb2.t.cpp000064400000000000000000000114231213035135600152310ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { /* UnitTest t (15); */ UnitTest t (9); try { // Remove any residual test files. rmdir ("./extensions"); unlink ("./pending.data"); unlink ("./completed.data"); unlink ("./undo.data"); /* unlink ("./backlog.data"); */ unlink ("./synch.key"); // Set the context to allow GC. context.config.set ("gc", "on"); context.config.set ("debug", "on"); context.tdb2.set_location ("."); // Try reading an empty database. std::vector pending = context.tdb2.pending.get_tasks (); std::vector completed = context.tdb2.completed.get_tasks (); std::vector undo = context.tdb2.undo.get_lines (); /* std::vector backlog = context.tdb2.backlog.get_tasks (); std::vector synch_key = context.tdb2.synch_key.get_lines (); */ t.is ((int) pending.size (), 0, "TDB2 Read empty pending"); t.is ((int) completed.size (), 0, "TDB2 Read empty completed"); t.is ((int) undo.size (), 0, "TDB2 Read empty undo"); /* t.is ((int) backlog.size (), 0, "TDB2 Read empty backlog"); t.is ((int) synch_key.size (), 0, "TDB2 Read empty synch.key"); */ // Add a task. Task task ("[description:\"description\" name:\"value\"]"); context.tdb2.add (task); pending = context.tdb2.pending.get_tasks (); completed = context.tdb2.completed.get_tasks (); undo = context.tdb2.undo.get_lines (); /* backlog = context.tdb2.backlog.get_tasks (); synch_key = context.tdb2.synch_key.get_lines (); */ t.is ((int) pending.size (), 1, "TDB2 after add, 1 pending task"); t.is ((int) completed.size (), 0, "TDB2 after add, 0 completed tasks"); t.is ((int) undo.size (), 3, "TDB2 after add, 3 undo lines"); /* t.is ((int) backlog.size (), 1, "TDB2 after add, 1 backlog task"); t.is ((int) synch_key.size (), 0, "TDB2 after add, 0 synch.key"); */ task.set ("description", "This is a test"); context.tdb2.modify (task); pending = context.tdb2.pending.get_tasks (); completed = context.tdb2.completed.get_tasks (); undo = context.tdb2.undo.get_lines (); /* backlog = context.tdb2.backlog.get_tasks (); synch_key = context.tdb2.synch_key.get_lines (); */ t.is ((int) pending.size (), 1, "TDB2 after add, 1 pending task"); t.is ((int) completed.size (), 0, "TDB2 after add, 0 completed tasks"); t.is ((int) undo.size (), 7, "TDB2 after add, 7 undo lines"); /* t.is ((int) backlog.size (), 2, "TDB2 after add, 2 backlog task"); t.is ((int) synch_key.size (), 0, "TDB2 after add, 0 synch.key"); */ context.tdb2.commit (); // Reset for reuse. context.tdb2.clear (); context.tdb2.set_location ("."); // TODO commit // TODO complete a task // TODO gc } catch (const std::string& error) { t.diag (error); return -1; } catch (...) { t.diag ("Unknown error."); return -2; } rmdir ("./extensions"); unlink ("./pending.data"); unlink ("./completed.data"); unlink ("./undo.data"); unlink ("./backlog.data"); unlink ("./synch.key"); return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/template.t000075500000000000000000000043471213035135600154420ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; use File::Basename; my $ut = basename ($0); my $rc = $ut . '.rc'; # Create the rc file. if (open my $fh, '>', $rc) { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r $rc, "$ut: Created $rc"); } # Note: all commands checked for $? == 0 # Note: all commands redirect 2>&1 # Bug - qx{../src/task rc:$rc add sample 2>&1}; ok ($? == 0, "$ut: add sample"); my $output = qx{../src/task rc:$rc ls 2>&1}; like ($output, qr/sample/ms, "$ut: sample task found"); ## Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key), $rc; ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r $rc, "$ut: Cleanup"); exit 0; task-2.2.0-test/test.cpp000064400000000000000000000243471213035135600151240ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include /////////////////////////////////////////////////////////////////////////////// UnitTest::UnitTest () : mPlanned (0) , mCounter (0) , mPassed (0) , mFailed (0) , mSkipped (0) { } /////////////////////////////////////////////////////////////////////////////// UnitTest::UnitTest (int planned) : mPlanned (planned) , mCounter (0) , mPassed (0) , mFailed (0) , mSkipped (0) { std::cout << "1.." << mPlanned << "\n"; } /////////////////////////////////////////////////////////////////////////////// UnitTest::~UnitTest () { float percentPassed = 0.0; if (mPlanned > 0) percentPassed = (100.0 * mPassed) / std::max (mPlanned, mPassed + mFailed + mSkipped); if (mCounter < mPlanned) { std::cout << "# Only " << mCounter << " tests, out of a planned " << mPlanned << " were run.\n"; mSkipped += mPlanned - mCounter; } else if (mCounter > mPlanned) std::cout << "# " << mCounter << " tests were run, but only " << mPlanned << " were planned.\n"; std::cout << "# " << mPassed << " passed, " << mFailed << " failed, " << mSkipped << " skipped. " << std::setprecision (3) << percentPassed << "% passed.\n"; } /////////////////////////////////////////////////////////////////////////////// void UnitTest::plan (int planned) { mPlanned = planned; mCounter = 0; mPassed = 0; mFailed = 0; mSkipped = 0; std::cout << "1.." << mPlanned << "\n"; } /////////////////////////////////////////////////////////////////////////////// void UnitTest::planMore (int extra) { mPlanned += extra; std::cout << "1.." << mPlanned << "\n"; } /////////////////////////////////////////////////////////////////////////////// void UnitTest::ok (bool expression, const std::string& name) { ++mCounter; if (expression) { ++mPassed; std::cout << "ok " << mCounter << " - " << name << "\n"; } else { ++mFailed; std::cout << "not ok " << mCounter << " - " << name << "\n"; } } /////////////////////////////////////////////////////////////////////////////// void UnitTest::notok (bool expression, const std::string& name) { ++mCounter; if (!expression) { ++mPassed; std::cout << "ok " << mCounter << " - " << name << "\n"; } else { ++mFailed; std::cout << "not ok " << mCounter << " - " << name << "\n"; } } /////////////////////////////////////////////////////////////////////////////// void UnitTest::is (bool actual, bool expected, const std::string& name) { ++mCounter; if (actual == expected) { ++mPassed; std::cout << "ok " << mCounter << " - " << name << "\n"; } else { ++mFailed; std::cout << "not ok " << mCounter << " - " << name << "\n# expected: " << expected << "\n# got: " << actual << "\n"; } } /////////////////////////////////////////////////////////////////////////////// void UnitTest::is (size_t actual, size_t expected, const std::string& name) { ++mCounter; if (actual == expected) { ++mPassed; std::cout << "ok " << mCounter << " - " << name << "\n"; } else { ++mFailed; std::cout << "not ok " << mCounter << " - " << name << "\n# expected: " << expected << "\n# got: " << actual << "\n"; } } /////////////////////////////////////////////////////////////////////////////// void UnitTest::is (int actual, int expected, const std::string& name) { ++mCounter; if (actual == expected) { ++mPassed; std::cout << "ok " << mCounter << " - " << name << "\n"; } else { ++mFailed; std::cout << "not ok " << mCounter << " - " << name << "\n# expected: " << expected << "\n# got: " << actual << "\n"; } } /////////////////////////////////////////////////////////////////////////////// void UnitTest::is (double actual, double expected, const std::string& name) { ++mCounter; if (actual == expected) { ++mPassed; std::cout << "ok " << mCounter << " - " << name << "\n"; } else { ++mFailed; std::cout << "not ok " << mCounter << " - " << name << "\n# expected: " << expected << "\n# got: " << actual << "\n"; } } /////////////////////////////////////////////////////////////////////////////// void UnitTest::is (double actual, double expected, double tolerance, const std::string& name) { ++mCounter; if (fabs (actual - expected) <= tolerance) { ++mPassed; std::cout << "ok " << mCounter << " - " << name << "\n"; } else { ++mFailed; std::cout << "not ok " << mCounter << " - " << name << "\n# expected: " << expected << "\n# got: " << actual << "\n"; } } /////////////////////////////////////////////////////////////////////////////// void UnitTest::is (unsigned char actual, unsigned char expected, const std::string& name) { ++mCounter; if (actual == expected) { ++mPassed; std::cout << "ok " << mCounter << " - " << name << "\n"; } else { ++mFailed; std::cout << "not ok " << mCounter << " - " << name << "\n# expected: " << expected << "\n# got: " << actual << "\n"; } } /////////////////////////////////////////////////////////////////////////////// void UnitTest::is ( const std::string& actual, const std::string& expected, const std::string& name) { ++mCounter; if (actual == expected) { ++mPassed; std::cout << "ok " << mCounter << " - " << name << "\n"; } else { ++mFailed; std::cout << "not ok " << mCounter << " - " << name << "\n# expected: '" << expected << "'" << "\n# got: '" << actual << "'\n"; } } /////////////////////////////////////////////////////////////////////////////// void UnitTest::is ( const char* actual, const char* expected, const std::string& name) { ++mCounter; if (! strcmp (actual, expected)) { ++mPassed; std::cout << "ok " << mCounter << " - " << name << "\n"; } else { ++mFailed; std::cout << "not ok " << mCounter << " - " << name << "\n# expected: '" << expected << "'" << "\n# got: '" << actual << "'\n"; } } /////////////////////////////////////////////////////////////////////////////// void UnitTest::diag (const std::string& text) { std::string::size_type start = text.find_first_not_of (" \t\n\r\f"); std::string::size_type end = text.find_last_not_of (" \t\n\r\f"); std::cout << "# " << text.substr (start, end - start + 1) << "\n"; } /////////////////////////////////////////////////////////////////////////////// void UnitTest::pass (const std::string& text) { ++mCounter; ++mPassed; std::cout << "ok " << mCounter << " " << text << "\n"; } /////////////////////////////////////////////////////////////////////////////// void UnitTest::fail (const std::string& text) { ++mCounter; ++mFailed; std::cout << "not ok " << mCounter << " " << text << "\n"; } /////////////////////////////////////////////////////////////////////////////// void UnitTest::skip (const std::string& text) { ++mCounter; ++mSkipped; std::cout << "skip " << mCounter << " " << text << "\n"; } /////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/test.h000064400000000000000000000045741213035135600145710ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_UNITTEST #define INCLUDED_UNITTEST #include class UnitTest { public: UnitTest (); UnitTest (int); ~UnitTest (); void plan (int); void planMore (int); void ok (bool, const std::string&); void notok (bool, const std::string&); void is (bool, bool, const std::string&); void is (size_t, size_t, const std::string&); void is (int, int, const std::string&); void is (double, double, const std::string&); void is (double, double, double, const std::string&); void is (unsigned char, unsigned char, const std::string&); void is (const std::string&, const std::string&, const std::string&); void is (const char*, const char*, const std::string&); void diag (const std::string&); void pass (const std::string&); void fail (const std::string&); void skip (const std::string&); private: int mPlanned; int mCounter; int mPassed; int mFailed; int mSkipped; }; #endif //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/text.t.cpp000064400000000000000000000671001213035135600153650ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { UnitTest t (264); // void wrapText (std::vector & lines, const std::string& text, const int width, bool hyphenate) std::string text = "This is a test of the line wrapping code."; std::vector lines; wrapText (lines, text, 10, true); t.is (lines.size (), (size_t) 5, "wrapText 'This is a test of the line wrapping code.' -> total 5 lines"); t.is (lines[0], "This is a", "wrapText line 0 -> 'This is a'"); t.is (lines[1], "test of", "wrapText line 1 -> 'test of'"); t.is (lines[2], "the line", "wrapText line 2 -> 'the line'"); t.is (lines[3], "wrapping", "wrapText line 3 -> 'wrapping'"); t.is (lines[4], "code.", "wrapText line 4 -> 'code.'"); text = "This ☺ is a test of utf8 line extraction."; lines.clear (); wrapText (lines, text, 7, true); t.is (lines.size (), (size_t) 7, "wrapText 'This ☺ is a test of utf8 line extraction.' -> total 7 lines"); t.is (lines[0], "This ☺", "wrapText line 0 -> 'This ☺'"); t.is (lines[1], "is a", "wrapText line 1 -> 'is a'"); t.is (lines[2], "test of", "wrapText line 2 -> 'test of'"); t.is (lines[3], "utf8", "wrapText line 3 -> 'utf8'"); t.is (lines[4], "line", "wrapText line 4 -> 'line'"); t.is (lines[5], "extrac-", "wrapText line 5 -> 'extrac-'"); t.is (lines[6], "tion.", "wrapText line 6 -> 'tion.'"); text = "one two three\n four"; lines.clear (); wrapText (lines, text, 13, true); t.is (lines.size (), (size_t) 2, "wrapText 'one two three\\n four' -> 2 lines"); t.is (lines[0], "one two three", "wrapText line 0 -> 'one two three'"); t.is (lines[1], " four", "wrapText line 1 -> ' four'"); // void extractLine (std::string& text, std::string& line, int length, bool hyphenate, unsigned int& offset) text = "This ☺ is a test of utf8 line extraction."; unsigned int offset = 0; std::string line; extractLine (line, text, 7, true, offset); t.is (line, "This ☺", "extractLine 7 'This ☺ is a test of utf8 line extraction.' -> 'This ☺'"); // void extractLine (std::string& text, std::string& line, int length, bool hyphenate, unsigned int& offset) text = "line 1\nlengthy second line that exceeds width"; offset = 0; extractLine (line, text, 10, true, offset); t.is (line, "line 1", "extractLine 10 'line 1\\nlengthy second line that exceeds width' -> 'line 1'"); extractLine (line, text, 10, true, offset); t.is (line, "lengthy", "extractLine 10 'lengthy second line that exceeds width' -> 'lengthy'"); extractLine (line, text, 10, true, offset); t.is (line, "second", "extractLine 10 'second line that exceeds width' -> 'second'"); extractLine (line, text, 10, true, offset); t.is (line, "line that", "extractLine 10 'line that exceeds width' -> 'line that'"); extractLine (line, text, 10, true, offset); t.is (line, "exceeds", "extractLine 10 'exceeds width' -> 'exceeds'"); extractLine (line, text, 10, true, offset); t.is (line, "width", "extractLine 10 'width' -> 'width'"); t.notok (extractLine (line, text, 10, true, offset), "extractLine 10 '' -> ''"); // void split (std::vector& results, const std::string& input, const char delimiter) std::vector items; std::string unsplit = ""; split (items, unsplit, '-'); t.is (items.size (), (size_t) 0, "split '' '-' -> 0 items"); unsplit = "a"; split (items, unsplit, '-'); t.is (items.size (), (size_t) 1, "split 'a' '-' -> 1 item"); t.is (items[0], "a", "split 'a' '-' -> 'a'"); split (items, unsplit, '-'); t.is (items.size (), (size_t) 1, "split 'a' '-' -> 1 item"); t.is (items[0], "a", "split 'a' '-' -> 'a'"); unsplit = "-"; split (items, unsplit, '-'); t.is (items.size (), (size_t) 2, "split '-' '-' -> '' ''"); t.is (items[0], "", "split '-' '-' -> [0] ''"); t.is (items[1], "", "split '-' '-' -> [1] ''"); split_minimal (items, unsplit, '-'); t.is (items.size (), (size_t) 0, "split '-' '-' ->"); unsplit = "-a-bc-def"; split (items, unsplit, '-'); t.is (items.size (), (size_t) 4, "split '-a-bc-def' '-' -> '' 'a' 'bc' 'def'"); t.is (items[0], "", "split '-a-bc-def' '-' -> [0] ''"); t.is (items[1], "a", "split '-a-bc-def' '-' -> [1] 'a'"); t.is (items[2], "bc", "split '-a-bc-def' '-' -> [2] 'bc'"); t.is (items[3], "def", "split '-a-bc-def' '-' -> [3] 'def'"); split_minimal (items, unsplit, '-'); t.is (items.size (), (size_t) 3, "split '-a-bc-def' '-' -> 'a' 'bc' 'def'"); t.is (items[0], "a", "split '-a-bc-def' '-' -> [1] 'a'"); t.is (items[1], "bc", "split '-a-bc-def' '-' -> [2] 'bc'"); t.is (items[2], "def", "split '-a-bc-def' '-' -> [3] 'def'"); // void split (std::vector& results, const std::string& input, const std::string& delimiter) unsplit = ""; split (items, unsplit, "--"); t.is (items.size (), (size_t) 0, "split '' '--' -> 0 items"); unsplit = "a"; split (items, unsplit, "--"); t.is (items.size (), (size_t) 1, "split 'a' '--' -> 1 item"); t.is (items[0], "a", "split 'a' '-' -> 'a'"); unsplit = "--"; split (items, unsplit, "--"); t.is (items.size (), (size_t) 2, "split '-' '--' -> '' ''"); t.is (items[0], "", "split '-' '-' -> [0] ''"); t.is (items[1], "", "split '-' '-' -> [1] ''"); unsplit = "--a--bc--def"; split (items, unsplit, "--"); t.is (items.size (), (size_t) 4, "split '-a-bc-def' '--' -> '' 'a' 'bc' 'def'"); t.is (items[0], "", "split '-a-bc-def' '--' -> [0] ''"); t.is (items[1], "a", "split '-a-bc-def' '--' -> [1] 'a'"); t.is (items[2], "bc", "split '-a-bc-def' '--' -> [2] 'bc'"); t.is (items[3], "def", "split '-a-bc-def' '--' -> [3] 'def'"); unsplit = "one\ntwo\nthree"; split (items, unsplit, "\n"); t.is (items.size (), (size_t) 3, "split 'one\\ntwo\\nthree' -> 'one', 'two', 'three'"); t.is (items[0], "one", "split 'one\\ntwo\\nthree' -> [0] 'one'"); t.is (items[1], "two", "split 'one\\ntwo\\nthree' -> [1] 'two'"); t.is (items[2], "three", "split 'one\\ntwo\\nthree' -> [2] 'three'"); // void splitq (std::vector&, const std::string&, const char); unsplit = "one 'two' '' 'three four' \"five six seven\" eight'nine ten'"; splitq (items, unsplit, ' '); t.is (items.size () , (size_t) 6, "splitq 'one \\'two\\' \\'\\' \\'three four\\' \"five six seven\" eight'nine ten'"); t.is (items[0], "one", "splitq 'one \\'two\\' \\'\\' \\'three four\\' \"five six seven\" eight'nine ten' -> [0] 'one'"); t.is (items[1], "two", "splitq 'one \\'two\\' \\'\\' \\'three four\\' \"five six seven\" eight'nine ten' -> [1] 'two'"); t.is (items[2], "", "splitq 'one \\'two\\' \\'\\' \\'three four\\' \"five six seven\" eight'nine ten' -> [2] ''"); t.is (items[3], "three four", "splitq 'one \\'two\\' \\'\\' \\'three four\\' \"five six seven\" eight'nine ten' -> [3] 'three four'"); t.is (items[4], "five six seven", "splitq 'one \\'two\\' \\'\\' \\'three four\\' \"five six seven\" eight'nine ten' -> [4] 'five six seven'"); t.is (items[5], "eight'nine ten'", "splitq 'one \\'two\\' \\'\\' \\'three four\\' \"five six seven\" eight'nine ten' -> [4] 'eight\\'nine ten\\''"); // void join (std::string& result, const std::string& separator, const std::vector& items) std::vector unjoined; std::string joined; join (joined, "", unjoined); t.is (joined.length (), (size_t) 0, "join -> length 0"); t.is (joined, "", "join -> ''"); unjoined.push_back (""); unjoined.push_back ("a"); unjoined.push_back ("bc"); unjoined.push_back ("def"); join (joined, "", unjoined); t.is (joined.length (), (size_t) 6, "join '' 'a' 'bc' 'def' -> length 6"); t.is (joined, "abcdef", "join '' 'a' 'bc' 'def' -> 'abcdef'"); join (joined, "-", unjoined); t.is (joined.length (), (size_t) 9, "join '' - 'a' - 'bc' - 'def' -> length 9"); t.is (joined, "-a-bc-def", "join '' - 'a' - 'bc' - 'def' -> '-a-bc-def'"); // void join (std::string& result, const std::string& separator, const std::vector& items) std::vector unjoined2; join (joined, "", unjoined2); t.is (joined.length (), (size_t) 0, "join -> length 0"); t.is (joined, "", "join -> ''"); unjoined2.push_back (0); unjoined2.push_back (1); unjoined2.push_back (2); join (joined, "", unjoined2); t.is (joined.length (), (size_t) 3, "join 0 1 2 -> length 3"); t.is (joined, "012", "join 0 1 2 -> '012'"); join (joined, "-", unjoined2); t.is (joined.length (), (size_t) 5, "join 0 1 2 -> length 5"); t.is (joined, "0-1-2", "join 0 1 2 -> '0-1-2'"); // std::string trimLeft (const std::string& in, const std::string& t /*= " "*/) t.is (trimLeft (""), "", "trimLeft '' -> ''"); t.is (trimLeft (" "), "", "trimLeft ' ' -> ''"); t.is (trimLeft ("", " \t"), "", "trimLeft '' -> ''"); t.is (trimLeft ("xxx"), "xxx", "trimLeft 'xxx' -> 'xxx'"); t.is (trimLeft ("xxx", " \t"), "xxx", "trimLeft 'xxx' -> 'xxx'"); t.is (trimLeft (" \t xxx \t "), "\t xxx \t ", "trimLeft ' \\t xxx \\t ' -> '\\t xxx \\t '"); t.is (trimLeft (" \t xxx \t ", " \t"), "xxx \t ", "trimLeft ' \\t xxx \\t ' -> 'xxx \\t '"); // std::string trimRight (const std::string& in, const std::string& t /*= " "*/) t.is (trimRight (""), "", "trimRight '' -> ''"); t.is (trimRight (" "), "", "trimRight ' ' -> ''"); t.is (trimRight ("", " \t"), "", "trimRight '' -> ''"); t.is (trimRight ("xxx"), "xxx", "trimRight 'xxx' -> 'xxx'"); t.is (trimRight ("xxx", " \t"), "xxx", "trimRight 'xxx' -> 'xxx'"); t.is (trimRight (" \t xxx \t "), " \t xxx \t", "trimRight ' \\t xxx \\t ' -> ' \\t xxx \\t'"); t.is (trimRight (" \t xxx \t ", " \t"), " \t xxx", "trimRight ' \\t xxx \\t ' -> ' \\t xxx'"); // std::string trim (const std::string& in, const std::string& t /*= " "*/) t.is (trim (""), "", "trim '' -> ''"); t.is (trim (" "), "", "trim ' ' -> ''"); t.is (trim ("", " \t"), "", "trim '' -> ''"); t.is (trim ("xxx"), "xxx", "trim 'xxx' -> 'xxx'"); t.is (trim ("xxx", " \t"), "xxx", "trim 'xxx' -> 'xxx'"); t.is (trim (" \t xxx \t "), "\t xxx \t", "trim ' \\t xxx \\t ' -> '\\t xxx \\t'"); t.is (trim (" \t xxx \t ", " \t"), "xxx", "trim ' \\t xxx \\t ' -> 'xxx'"); // std::string unquoteText (const std::string& text) t.is (unquoteText (""), "", "unquoteText '' -> ''"); t.is (unquoteText ("x"), "x", "unquoteText 'x' -> 'x'"); t.is (unquoteText ("'x"), "'x", "unquoteText ''x' -> ''x'"); t.is (unquoteText ("x'"), "x'", "unquoteText 'x'' -> 'x''"); t.is (unquoteText ("\"x"), "\"x", "unquoteText '\"x' -> '\"x'"); t.is (unquoteText ("x\""), "x\"", "unquoteText 'x\"' -> 'x\"'"); t.is (unquoteText ("''"), "", "unquoteText '''' -> ''"); t.is (unquoteText ("'''"), "'", "unquoteText ''''' -> '''"); t.is (unquoteText ("\"\""), "", "unquoteText '\"\"' -> ''"); t.is (unquoteText ("\"\"\""), "\"", "unquoteText '\"\"\"' -> '\"'"); t.is (unquoteText ("''''"), "''", "unquoteText '''''' -> ''''"); t.is (unquoteText ("\"\"\"\""), "\"\"", "unquoteText '\"\"\"\"' -> '\"\"'"); t.is (unquoteText ("'\"\"'"), "\"\"", "unquoteText '''\"\"' -> '\"\"'"); t.is (unquoteText ("\"''\""), "''", "unquoteText '\"''\"' -> ''''"); t.is (unquoteText ("'x'"), "x", "unquoteText ''x'' -> 'x'"); t.is (unquoteText ("\"x\""), "x", "unquoteText '\"x\"' -> 'x'"); // int longestWord (const std::string&) t.is (longestWord (" "), 0, "longestWord ( ) --> 0"); t.is (longestWord ("this is a test"), 4, "longestWord (this is a test) --> 4"); t.is (longestWord ("this is a better test"), 6, "longestWord (this is a better test) --> 6"); t.is (longestWord ("house Çirçös clown"), 6, "longestWord (Çirçös) --> 6"); // int longestLine (const std::string&) t.is (longestLine ("one two three four"), 18, "longestLine (one two three four) --> 18"); t.is (longestLine ("one\ntwo three four"), 14, "longestLine (one\\ntwo three four) --> 14"); t.is (longestLine ("one\ntwo\nthree\nfour"), 5, "longestLine (one\\ntwo\\nthree\\nfour) --> 5"); // std::string commify (const std::string& data) t.is (commify (""), "", "commify '' -> ''"); t.is (commify ("1"), "1", "commify '1' -> '1'"); t.is (commify ("12"), "12", "commify '12' -> '12'"); t.is (commify ("123"), "123", "commify '123' -> '123'"); t.is (commify ("1234"), "1,234", "commify '1234' -> '1,234'"); t.is (commify ("12345"), "12,345", "commify '12345' -> '12,345'"); t.is (commify ("123456"), "123,456", "commify '123456' -> '123,456'"); t.is (commify ("1234567"), "1,234,567", "commify '1234567' -> '1,234,567'"); t.is (commify ("12345678"), "12,345,678", "commify '12345678' -> '12,345,678'"); t.is (commify ("123456789"), "123,456,789", "commify '123456789' -> '123,456,789'"); t.is (commify ("1234567890"), "1,234,567,890", "commify '1234567890' -> '1,234,567,890'"); t.is (commify ("pre"), "pre", "commify 'pre' -> 'pre'"); t.is (commify ("pre1234"), "pre1,234", "commify 'pre1234' -> 'pre1,234'"); t.is (commify ("1234post"), "1,234post", "commify '1234post' -> '1,234post'"); t.is (commify ("pre1234post"), "pre1,234post", "commify 'pre1234post' -> 'pre1,234post'"); // std::string lowerCase (const std::string& input) t.is (lowerCase (""), "", "lowerCase '' -> ''"); t.is (lowerCase ("pre01_:POST"), "pre01_:post", "lowerCase 'pre01_:POST' -> 'pre01_:post'"); // std::string upperCase (const std::string& input) t.is (upperCase (""), "", "upperCase '' -> ''"); t.is (upperCase ("pre01_:POST"), "PRE01_:POST", "upperCase 'pre01_:POST' -> 'PRE01_:POST'"); // bool nontrivial (const std::string&); t.notok (nontrivial (""), "nontrivial '' -> false"); t.notok (nontrivial (" "), "nontrivial ' ' -> false"); t.notok (nontrivial ("\t\t"), "nontrivial '\\t\\t' -> false"); t.notok (nontrivial (" \t \t"), "nontrivial ' \\t \\t' -> false"); t.ok (nontrivial ("a"), "nontrivial 'a' -> true"); t.ok (nontrivial (" a"), "nontrivial ' a' -> true"); t.ok (nontrivial ("a "), "nontrivial 'a ' -> true"); t.ok (nontrivial (" \t\ta"), "nontrivial ' \\t\\ta' -> true"); t.ok (nontrivial ("a\t\t "), "nontrivial 'a\\t\\t ' -> true"); // bool digitsOnly (const std::string&); t.ok (digitsOnly (""), "digitsOnly '' -> true"); t.ok (digitsOnly ("0"), "digitsOnly '0' -> true"); t.ok (digitsOnly ("123"), "digitsOnly '123' -> true"); t.notok (digitsOnly ("12fa"), "digitsOnly '12fa' -> false"); // bool noSpaces (const std::string&); t.ok (noSpaces (""), "noSpaces '' -> true"); t.ok (noSpaces ("a"), "noSpaces 'a' -> true"); t.ok (noSpaces ("abc"), "noSpaces 'abc' -> true"); t.notok (noSpaces (" "), "noSpaces ' ' -> false"); t.notok (noSpaces ("ab cd"), "noSpaces 'ab cd' -> false"); // bool noVerticalSpace (const std::string&); t.ok (noVerticalSpace (""), "noVerticalSpace '' -> true"); t.ok (noVerticalSpace ("a"), "noVerticalSpace 'a' -> true"); t.ok (noVerticalSpace ("abc"), "noVerticalSpace 'abc' -> true"); t.notok (noVerticalSpace ("a\nb"), "noVerticalSpace 'a\\nb' -> false"); t.notok (noVerticalSpace ("a\rb"), "noVerticalSpace 'a\\rb' -> false"); t.notok (noVerticalSpace ("a\fb"), "noVerticalSpace 'a\\fb' -> false"); text = "Hello, world."; // 0123456789012 // s e s e // bool isWordStart (const std::string&, std::string::size_type); t.notok (isWordStart ("", 0), "isWordStart (\"\", 0) -> false"); t.ok (isWordStart ("foo", 0), "isWordStart (\"foo\", 0) -> true"); t.ok (isWordStart (text, 0), "isWordStart (\"Hello, world.\", 0) -> true"); t.notok (isWordStart (text, 1), "isWordStart (\"Hello, world.\", 1) -> false"); t.notok (isWordStart (text, 2), "isWordStart (\"Hello, world.\", 2) -> false"); t.notok (isWordStart (text, 3), "isWordStart (\"Hello, world.\", 3) -> false"); t.notok (isWordStart (text, 4), "isWordStart (\"Hello, world.\", 4) -> false"); t.notok (isWordStart (text, 5), "isWordStart (\"Hello, world.\", 5) -> false"); t.notok (isWordStart (text, 6), "isWordStart (\"Hello, world.\", 6) -> false"); t.ok (isWordStart (text, 7), "isWordStart (\"Hello, world.\", 7) -> true"); t.notok (isWordStart (text, 8), "isWordStart (\"Hello, world.\", 8) -> false"); t.notok (isWordStart (text, 9), "isWordStart (\"Hello, world.\", 9) -> false"); t.notok (isWordStart (text, 10), "isWordStart (\"Hello, world.\", 10) -> false"); t.notok (isWordStart (text, 11), "isWordStart (\"Hello, world.\", 11) -> false"); t.notok (isWordStart (text, 12), "isWordStart (\"Hello, world.\", 12) -> false"); // bool isWordEnd (const std::string&, std::string::size_type); t.notok (isWordEnd ("", 0), "isWordEnd (\"\", 0) -> false"); t.ok (isWordEnd ("foo", 2), "isWordEnd (\"foo\", 2) -> true"); t.notok (isWordEnd (text, 0), "isWordEnd (\"Hello, world.\", 0) -> false"); t.notok (isWordEnd (text, 1), "isWordEnd (\"Hello, world.\", 1) -> false"); t.notok (isWordEnd (text, 2), "isWordEnd (\"Hello, world.\", 2) -> false"); t.notok (isWordEnd (text, 3), "isWordEnd (\"Hello, world.\", 3) -> false"); t.ok (isWordEnd (text, 4), "isWordEnd (\"Hello, world.\", 4) -> true"); t.notok (isWordEnd (text, 5), "isWordEnd (\"Hello, world.\", 5) -> false"); t.notok (isWordEnd (text, 6), "isWordEnd (\"Hello, world.\", 6) -> false"); t.notok (isWordEnd (text, 7), "isWordEnd (\"Hello, world.\", 7) -> false"); t.notok (isWordEnd (text, 8), "isWordEnd (\"Hello, world.\", 8) -> false"); t.notok (isWordEnd (text, 9), "isWordEnd (\"Hello, world.\", 9) -> false"); t.notok (isWordEnd (text, 10), "isWordEnd (\"Hello, world.\", 10) -> false"); t.ok (isWordEnd (text, 11), "isWordEnd (\"Hello, world.\", 11) -> true"); t.notok (isWordEnd (text, 12), "isWordEnd (\"Hello, world.\", 12) -> false"); // bool compare (const std::string&, const std::string&, bool caseless = false); // Make sure degenerate cases are handled. t.ok (compare ("", ""), "'' == ''"); t.notok (compare ("foo", ""), "foo != ''"); t.notok (compare ("", "foo"), "'' != foo"); // Make sure the default is case-sensitive. t.ok (compare ("foo", "foo"), "foo == foo"); t.notok (compare ("foo", "FOO"), "foo != foo"); // Test case-sensitive. t.notok (compare ("foo", "xx", true), "foo != xx"); t.ok (compare ("foo", "foo", true), "foo == foo"); t.notok (compare ("foo", "FOO", true), "foo != FOO"); t.notok (compare ("FOO", "foo", true), "FOO != foo"); t.ok (compare ("FOO", "FOO", true), "FOO == FOO"); // Test case-insensitive. t.notok (compare ("foo", "xx", false), "foo != foo (caseless)"); t.ok (compare ("foo", "foo", false), "foo == foo (caseless)"); t.ok (compare ("foo", "FOO", false), "foo == FOO (caseless)"); t.ok (compare ("FOO", "foo", false), "FOO == foo (caseless)"); t.ok (compare ("FOO", "FOO", false), "FOO == FOO (caseless)"); // std::string::size_type find (const std::string&, const std::string&, bool caseless = false); // Make sure degenerate cases are handled. t.is ((int) find ("foo", ""), (int) 0, "foo !contains ''"); t.is ((int) find ("", "foo"), (int) std::string::npos, "'' !contains foo"); // Make sure the default is case-sensitive. t.is ((int) find ("foo", "fo"), 0, "foo contains fo"); t.is ((int) find ("foo", "FO"), (int) std::string::npos, "foo !contains fo"); // Test case-sensitive. t.is ((int) find ("foo", "xx", true), (int) std::string::npos, "foo !contains xx"); t.is ((int) find ("foo", "oo", true), 1, "foo contains oo"); t.is ((int) find ("foo", "fo", true), 0, "foo contains fo"); t.is ((int) find ("foo", "FO", true), (int) std::string::npos, "foo !contains fo"); t.is ((int) find ("FOO", "fo", true), (int) std::string::npos, "foo !contains fo"); t.is ((int) find ("FOO", "FO", true), 0, "foo contains fo"); // Test case-insensitive. t.is ((int) find ("foo", "xx", false), (int) std::string::npos, "foo !contains xx (caseless)"); t.is ((int) find ("foo", "oo", false), 1, "foo contains oo (caseless)"); t.is ((int) find ("foo", "fo", false), 0, "foo contains fo (caseless)"); t.is ((int) find ("foo", "FO", false), 0, "foo contains FO (caseless)"); t.is ((int) find ("FOO", "fo", false), 0, "FOO contains fo (caseless)"); t.is ((int) find ("FOO", "FO", false), 0, "FOO contains FO (caseless)"); // Test start offset. t.is ((int) find ("one two three", "e", 3, true), (int) 11, "offset obeyed"); t.is ((int) find ("one two three", "e", 11, true), (int) 11, "offset obeyed"); // int strippedLength (const std::string&); t.is (strippedLength (std::string ("")), 0, "strippedLength -> 0"); t.is (strippedLength (std::string ("abc")), 3, "strippedLength abc -> 3"); t.is (strippedLength (std::string ("one\033[5;38;255mtwo\033[0mthree")), 11, "strippedLength one^[[5;38;255mtwo^[[0mthree -> 11"); t.is (strippedLength (std::string ("\033[0m")), 0, "strippedLength ^[[0m -> 0"); t.is (strippedLength (std::string ("\033[1m\033[0m")), 0, "strippedLength ^[[1m^[[0m -> 0"); // std::string format (char); t.is (format ('A'), "A", "format ('A') -> A"); // std::string format (int); t.is (format (0), "0", "format (0) -> 0"); t.is (format (-1), "-1", "format (-1) -> -1"); // std::string formatHex (int); t.is (formatHex (0), "0", "formatHex (0) -> 0"); t.is (formatHex (10), "a", "formatHex (10) -> a"); t.is (formatHex (123), "7b", "formatHex (123) -> 7b"); // std::string format (float, int, int); t.is (format (1.23456789, 8, 1), " 1", "format (1.23456789, 8, 1) -> _______1"); t.is (format (1.23456789, 8, 2), " 1.2", "format (1.23456789, 8, 2) -> _____1.2"); t.is (format (1.23456789, 8, 3), " 1.23", "format (1.23456789, 8, 3) -> ____1.23"); t.is (format (1.23456789, 8, 4), " 1.235", "format (1.23456789, 8, 4) -> ___1.235"); t.is (format (1.23456789, 8, 5), " 1.2346", "format (1.23456789, 8, 5) -> __1.2346"); t.is (format (1.23456789, 8, 6), " 1.23457", "format (1.23456789, 8, 6) -> 1.23457"); t.is (format (1.23456789, 8, 7), "1.234568", "format (1.23456789, 8, 7) -> 1.234568"); t.is (format (1.23456789, 8, 8), "1.2345679", "format (1.23456789, 8, 8) -> 1.2345679"); t.is (format (2444238.56789, 12, 11), "2444238.5679", "format (2444238.56789, 12, 11) -> 2444238.5679"); // std::string format (double, int, int); // std::string leftJustify (const std::string&, const int); t.is (leftJustify (123, 3), "123", "leftJustify 123,3 -> '123'"); t.is (leftJustify (123, 4), "123 ", "leftJustify 123,4 -> '123 '"); t.is (leftJustify (123, 5), "123 ", "leftJustify 123,5 -> '123 '"); // std::string leftJustify (const std::string&, const int); t.is (leftJustify ("foo", 3), "foo", "leftJustify foo,3 -> 'foo'"); t.is (leftJustify ("foo", 4), "foo ", "leftJustify foo,4 -> 'foo '"); t.is (leftJustify ("foo", 5), "foo ", "leftJustify foo,5 -> 'foo '"); t.is (leftJustify ("föo", 5), "föo ", "leftJustify föo,5 -> 'föo '"); // std::string rightJustify (const std::string&, const int); t.is (rightJustify (123, 3), "123", "rightJustify 123,3 -> '123'"); t.is (rightJustify (123, 4), " 123", "rightJustify 123,4 -> ' 123'"); t.is (rightJustify (123, 5), " 123", "rightJustify 123,5 -> ' 123'"); // std::string rightJustify (const std::string&, const int); t.is (rightJustify ("foo", 3), "foo", "rightJustify foo,3 -> 'foo'"); t.is (rightJustify ("foo", 4), " foo", "rightJustify foo,4 -> ' foo'"); t.is (rightJustify ("foo", 5), " foo", "rightJustify foo,5 -> ' foo'"); t.is (rightJustify ("föo", 5), " föo", "rightJustify föo,5 -> ' föo'"); // int utf8_length (const std::string&); t.is ((int) utf8_length ("Çirçös"), 6, "utf8_length (Çirçös) == 6"); t.is ((int) utf8_length ("ツネナラム"), 5, "utf8_length (ツネナラム) == 5"); t.is ((int) utf8_length ("Zwölf Boxkämpfer"), 16, "utf8_length (Zwölf Boxkämpfer) == 16"); return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/timesheet.t000075500000000000000000000101511213035135600156040ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'time.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'time.rc', 'Created time.rc'); } # Create some tasks that were started/finished in different weeks, then verify # the presence and grouping in the timesheet report. # P0 pending, this week # PS0 started, this week # PS1 started, last week # PS2 started, 2wks ago # D0 deleted, this week # D1 deleted, last week # D2 deleted, 2wks ago # C0 completed, this week # C1 completed, last week # C2 completed, 2wks ago my $now = time (); my $seven = $now - 7 * 86_400; my $fourteen = $now - 14 * 86_400; if (open my $fh, '>', 'pending.data') { print $fh <&1}; like ($output, qr/Completed.+C0.+Started.+PS0/ms, 'one week of started and completed'); $output = qx{../src/task rc:time.rc timesheet 2 2>&1}; like ($output, qr/Completed.+C0.+Started.+PS0.+Completed.+C1.+Started.+PS1/ms, 'two weeks of started and completed'); $output = qx{../src/task rc:time.rc timesheet 3 2>&1}; like ($output, qr/Completed.+C0.+Started.+PS0.+Completed.+C1.+Started.+PS1.+Completed.+C2.+Started.+PS2/ms, 'three weeks of started and completed'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key time.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'time.rc', 'Cleanup'); exit 0; task-2.2.0-test/uda_date.t000075500000000000000000000052151213035135600153700ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'uda.rc') { print $fh "data.location=.\n", "confirmation=off\n", "uda.extra.type=date\n", "uda.extra.label=Extra\n", "report.uda.description=UDA Test\n", "report.uda.columns=id,extra,description\n", "report.uda.sort=extra,description\n", "report.uda.labels=ID,Extra,Description\n"; close $fh; ok (-r 'uda.rc', 'Created uda.rc'); } # Add tasks with and without the UDA. qx{../src/task rc:uda.rc add with extra:tomorrow 2>&1}; qx{../src/task rc:uda.rc add without 2>&1}; my $output = qx{../src/task rc:uda.rc uda 2>&1}; like ($output, qr/1\s+[\d\/]+\s+with/, 'UDA date stored'); like ($output, qr/2\s+without/, 'UDA date blank'); # Add bad data. $output = qx{../src/task rc:uda.rc add bad extra:unrecognized_date 2>&1}; unlike ($output, qr/Created task \d+/, 'UDA date bad data not accepted'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key uda.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'uda.rc', 'Cleanup'); exit 0; task-2.2.0-test/uda_duration.t000075500000000000000000000054641213035135600163060ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 6; # Create the rc file. if (open my $fh, '>', 'uda.rc') { print $fh "data.location=.\n", "confirmation=off\n", "uda.extra.type=duration\n", "uda.extra.label=Extra\n", "report.uda.description=UDA Test\n", "report.uda.columns=id,extra,description\n", "report.uda.sort=extra,description\n", "report.uda.labels=ID,Extra,Description\n"; close $fh; ok (-r 'uda.rc', 'Created uda.rc'); } # Add tasks with and without the UDA. qx{../src/task rc:uda.rc add with extra:1day 2>&1}; qx{../src/task rc:uda.rc add without 2>&1}; my $output = qx{../src/task rc:uda.rc uda 2>&1}; like ($output, qr/1\s+1d\s+with/, 'UDA duration stored'); like ($output, qr/2\s+without/, 'UDA duration blank'); # Ensure 'extra' is stored as seconds. $output = qx{../src/task rc:uda.rc 1 export 2>&1}; like ($output, qr/"extra":"86400"/, 'UDA duration stored in seconds'); # Add bad data. $output = qx{../src/task rc:uda.rc add bad extra:unrecognized_duration 2>&1}; unlike ($output, qr/Created task \d+/, 'UDA duration bad data not accepted'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key uda.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'uda.rc', 'Cleanup'); exit 0; task-2.2.0-test/uda_numeric.t000075500000000000000000000052171213035135600161170ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'uda.rc') { print $fh "data.location=.\n", "confirmation=off\n", "uda.extra.type=numeric\n", "uda.extra.label=Extra\n", "report.uda.description=UDA Test\n", "report.uda.columns=id,extra,description\n", "report.uda.sort=extra,description\n", "report.uda.labels=ID,Extra,Description\n"; close $fh; ok (-r 'uda.rc', 'Created uda.rc'); } # Add tasks with and without the UDA. qx{../src/task rc:uda.rc add with extra:123 2>&1}; qx{../src/task rc:uda.rc add without 2>&1}; my $output = qx{../src/task rc:uda.rc uda 2>&1}; like ($output, qr/1\s+\d+\s+with/, 'UDA numeric stored'); like ($output, qr/2\s+without/, 'UDA numeric blank'); # Add bad data. $output = qx{../src/task rc:uda.rc add bad extra:unrecognized_numeric 2>&1}; unlike ($output, qr/Created task \d+/, 'UDA numeric bad data not accepted'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key uda.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'uda.rc', 'Cleanup'); exit 0; task-2.2.0-test/uda_orphan.t000075500000000000000000000066571213035135600157550ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 10; # Create the rc file. if (open my $fh, '>', 'uda.rc') { print $fh "data.location=.\n", "confirmation=off\n", "uda.extra.type=string\n", "uda.extra.label=Extra\n"; close $fh; ok (-r 'uda.rc', 'Created uda.rc'); } # Add a task with a defined UDA. qx{../src/task rc:uda.rc add one extra:foo 2>&1}; my $output = qx{../src/task rc:uda.rc 1 info 2>&1}; like ($output, qr/Extra\s+foo/, 'UDA created'); # Eliminate the UDA. if (open my $fh, '>', 'uda.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'uda.rc', 'Created uda.rc again'); } # Observe the UDA properly reported by the 'info' command. $output = qx{../src/task rc:uda.rc 1 info 2>&1}; like ($output, qr/extra\s+foo/, 'UDA orphan shown'); # Modify the task, ensure UDA preserved. qx{../src/task rc:uda.rc 1 modify /one/two/ 2>&1}; $output = qx{../src/task rc:uda.rc 1 info 2>&1}; like ($output, qr/extra\s+foo/, 'UDA orphan preserved by modification'); # Make sure an orphan UDA is exported. $output = qx{../src/task rc:uda.rc export 2>&1}; like ($output, qr/"extra":"foo"/, 'UDA orphan exported'); # Make sure an orphan UDA can be exported. if (open my $fh, '>', 'import.txt') { print $fh <&1 >/dev/null}; like ($output, qr/Imported 1 tasks\./, 'UDA orphan import'); $output = qx{../src/task rc:uda.rc 2 info 2>&1}; like ($output, qr/extra\s+bar/, 'UDA orphan imported and visible'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key uda.rc import.txt); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'uda.rc' && ! -r 'import.txt', 'Cleanup'); exit 0; task-2.2.0-test/uda_report.t000075500000000000000000000055071213035135600157720ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'uda.rc') { print $fh "data.location=.\n", "confirmation=off\n", "uda.extra.type=string\n", "uda.extra.label=Extra\n", "report.good.columns=id,extra\n", "report.good.description=Test report\n", "report.good.filter=\n", "report.good.labels=ID,Extra\n", "report.good.sort=ID\n", "report.bad.columns=id,extra2\n", "report.bad.description=Test report2\n", "report.bad.filter=\n", "report.bad.labels=ID,Extra2\n", "report.bad.sort=ID\n"; close $fh; ok (-r 'uda.rc', 'Created uda.rc'); } # Add a task with a defined UDA. qx{../src/task rc:uda.rc add one extra:foo 2>&1}; # Run a report that references the UDA. my $output = qx{../src/task rc:uda.rc good 2>&1}; like ($output, qr/foo/, 'UDA shown in report'); # Run a report that references an Orphan UDA. $output = qx{../src/task rc:uda.rc bad 2>&1}; like ($output, qr/Unrecognized column name/, 'UDA Orphan causes error'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key uda.rc import.txt); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'uda.rc' && ! -r 'import.txt', 'Cleanup'); exit 0; task-2.2.0-test/uda_string.t000075500000000000000000000047631213035135600157700ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'uda.rc') { print $fh "data.location=.\n", "confirmation=off\n", "uda.extra.type=string\n", "uda.extra.label=Extra\n", "report.uda.description=UDA Test\n", "report.uda.columns=id,extra,description\n", "report.uda.sort=extra,description\n", "report.uda.labels=ID,Extra,Description\n"; close $fh; ok (-r 'uda.rc', 'Created uda.rc'); } # Add tasks with and without the UDA. qx{../src/task rc:uda.rc add with extra:\\"one two\\" 2>&1}; qx{../src/task rc:uda.rc add without 2>&1}; my $output = qx{../src/task rc:uda.rc uda 2>&1}; like ($output, qr/1\s+one two\s+with/, 'UDA string stored'); like ($output, qr/2\s+without/, 'UDA string blank'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key uda.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'uda.rc', 'Cleanup'); exit 0; task-2.2.0-test/uda_value.t000075500000000000000000000047051213035135600155720ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'uda.rc') { print $fh "data.location=.\n", "confirmation=off\n", "uda.smell.type=string\n", "uda.smell.label=Smell\n", "uda.smell.values=weak,strong\n"; close $fh; ok (-r 'uda.rc', 'Created uda.rc'); } # Add tasks with valid and invalid UDA values. my $output = qx{../src/task rc:uda.rc add one smell:weak 2>&1}; like ($output, qr/Created task 1/, 'UDA smell:weak allowed'); $output = qx{../src/task rc:uda.rc add two smell:strong 2>&1}; like ($output, qr/Created task 2/, 'UDA smell:strong allowed'); $output = qx{../src/task rc:uda.rc add three smell:toxic 2>&1}; unlike ($output, qr/Created task 3/, 'UDA smell:toxic disallowed'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key uda.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'uda.rc', 'Cleanup'); exit 0; task-2.2.0-test/undo.t000075500000000000000000000057371213035135600146000ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 11; # Create the rc file. if (open my $fh, '>', 'undo.rc') { print $fh "data.location=.\n", "echo.command=no\n", "confirmation=no\n"; close $fh; ok (-r 'undo.rc', 'Created undo.rc'); } # Test the add/do/undo commands. my $output = qx{../src/task rc:undo.rc add one 2>&1; ../src/task rc:undo.rc info 1 2>&1}; ok (-r 'pending.data', 'pending.data created'); like ($output, qr/Status\s+Pending\n/, 'Pending'); $output = qx{../src/task rc:undo.rc 1 do 2>&1; ../src/task rc:undo.rc info 1 2>&1}; ok (-r 'completed.data', 'completed.data created'); like ($output, qr/Status\s+Completed\n/, 'Completed'); $output = qx{../src/task rc:undo.rc undo 2>&1; ../src/task rc:undo.rc info 1 2>&1}; ok (-r 'completed.data', 'completed.data created'); like ($output, qr/Status\s+Pending\n/, 'Pending'); $output = qx{../src/task rc:undo.rc 1 do 2>&1; ../src/task rc:undo.rc list 2>&1 >/dev/null}; like ($output, qr/No matches/, 'No matches'); # Bug 1060: Test that if undo is given an argument it catches and reports the correct error. $output = qx{../src/task rc:undo.rc undo 1 2>&1}; unlike ($output, qr/Unknown error/, 'No unknown error'); like ($output, qr/The undo command does not allow further task modification/, 'Correct error caught and reported'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key undo.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'undo.rc', 'Cleanup'); exit 0; task-2.2.0-test/upgrade.t000075500000000000000000000052311213035135600152470ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 7; # Create the rc file. if (open my $fh, '>', 'upgrade.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'upgrade.rc', 'Created upgrade.rc'); } # Add a plain task, then upgrade to recurring, test for correctness. qx{../src/task rc:upgrade.rc add one 2>&1}; my $output = qx{../src/task rc:upgrade.rc 1 info 2>&1}; like ($output, qr/Status\s+Pending/, 'Plain task entered'); qx{../src/task rc:upgrade.rc 1 modify due:tomorrow recur:weekly 2>&1}; qx{../src/task rc:upgrade.rc list 2>&1}; $output = qx{../src/task rc:upgrade.rc 1 info 2>&1}; like ($output, qr/Status\s+Recurring/, 'Upgraded parent: good status'); like ($output, qr/Recurrence\s+weekly/, 'Upgraded parent: good recurrence'); $output = qx{../src/task rc:upgrade.rc 2 info 2>&1}; like ($output, qr/Status\s+Pending/, 'Upgraded child: good status'); like ($output, qr/Recurrence\s+weekly/, 'Upgraded child: good recurrence'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key upgrade.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'upgrade.rc', 'Cleanup'); exit 0; task-2.2.0-test/urgency.t000075500000000000000000000317171213035135600153040ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 49; # Create the rc file. if (open my $fh, '>', 'urgency.rc') { print $fh "data.location=.\n", "urgency.priority.coefficient=10\n", "urgency.active.coefficient=10\n", "urgency.project.coefficient=10\n", "urgency.due.coefficient=10\n", "urgency.blocking.coefficient=10\n", "urgency.blocked.coefficient=10\n", "urgency.annotations.coefficient=10\n", "urgency.tags.coefficient=10\n", "urgency.waiting.coefficient=-10\n", "urgency.next.coefficient=10\n", "urgency.user.project.PROJECT.coefficient=10\n", "urgency.user.tag.TAG.coefficient=10\n", "confirmation=off\n"; close $fh; ok (-r 'urgency.rc', 'Created urgency.rc'); } # Add a task, and verify that the individual urgency terms are being correctly # calculated. # priority qx{../src/task rc:urgency.rc add control 2>&1}; # task 1 qx{../src/task rc:urgency.rc add 1a pri:H 2>&1}; # task 2 qx{../src/task rc:urgency.rc add 1b pri:M 2>&1}; # task 3 qx{../src/task rc:urgency.rc add 1c pri:L 2>&1}; # task 4 # priority: 0 (pending) my $output = qx{../src/task rc:urgency.rc 1 _urgency 2>&1}; like ($output, qr/urgency 0$/ms, 'Control = 0'); # priority: 10 (pri:H) $output = qx{../src/task rc:urgency.rc 2 _urgency 2>&1}; like ($output, qr/urgency 10$/ms, 'pri:H = 10'); # priority: 6.5 (pri:M) $output = qx{../src/task rc:urgency.rc 3 _urgency 2>&1}; like ($output, qr/urgency 6\.5$/ms, 'pri:M = 6.5'); # priority: 3 (pri:L) $output = qx{../src/task rc:urgency.rc 4 _urgency 2>&1}; like ($output, qr/urgency 3$/ms, 'pri:L = 3'); # project: 10 (project) qx{../src/task rc:urgency.rc add 2a project:P 2>&1}; # task 5 $output = qx{../src/task rc:urgency.rc 5 _urgency 2>&1}; like ($output, qr/urgency 10$/ms, 'pro:P = 10'); # active: 10 (active) qx{../src/task rc:urgency.rc add 3a 2>&1}; # task 6 qx{../src/task rc:urgency.rc 6 start 2>&1}; $output = qx{../src/task rc:urgency.rc 6 _urgency 2>&1}; like ($output, qr/urgency 10$/ms, 'active = 10'); # next: 10 (+next) + 8 (1 tag) qx{../src/task rc:urgency.rc add 4a +next 2>&1}; # task 7 $output = qx{../src/task rc:urgency.rc 7 _urgency 2>&1}; like ($output, qr/urgency 18$/ms, '+next = 18'); # tags qx{../src/task rc:urgency.rc add 5a +one 2>&1}; # task 8 qx{../src/task rc:urgency.rc add 5b +one +two 2>&1}; # task 9 qx{../src/task rc:urgency.rc add 5c +one +two +three 2>&1}; # task 10 qx{../src/task rc:urgency.rc add 5d +one +two +three +four 2>&1}; # task 11 # tags: 8 (1 tag) $output = qx{../src/task rc:urgency.rc 8 _urgency 2>&1}; like ($output, qr/urgency 8$/ms, '+one = 8'); # tags: 9 (2 tags) $output = qx{../src/task rc:urgency.rc 9 _urgency 2>&1}; like ($output, qr/urgency 9$/ms, '+one +two = 9'); # tags: 10 (3 tags) $output = qx{../src/task rc:urgency.rc 10 _urgency 2>&1}; like ($output, qr/urgency 10$/ms, '+one +two +three = 10'); # tags: 10 (4 tags) $output = qx{../src/task rc:urgency.rc 10 _urgency 2>&1}; like ($output, qr/urgency 10$/ms, '+one +two +three +four = 10'); # annotations qx{../src/task rc:urgency.rc add 6a 2>&1}; # task 12 qx{../src/task rc:urgency.rc 12 annotate A 2>&1}; qx{../src/task rc:urgency.rc add 6b 2>&1}; # task 13 qx{../src/task rc:urgency.rc 13 annotate A 2>&1}; qx{../src/task rc:urgency.rc 13 annotate B 2>&1}; qx{../src/task rc:urgency.rc add 6c 2>&1}; # task 14 qx{../src/task rc:urgency.rc 14 annotate A 2>&1}; qx{../src/task rc:urgency.rc 14 annotate B 2>&1}; qx{../src/task rc:urgency.rc 14 annotate C 2>&1}; qx{../src/task rc:urgency.rc add 6d 2>&1}; # task 15 qx{../src/task rc:urgency.rc 15 annotate A 2>&1}; qx{../src/task rc:urgency.rc 15 annotate B 2>&1}; qx{../src/task rc:urgency.rc 15 annotate C 2>&1}; qx{../src/task rc:urgency.rc 15 annotate D 2>&1}; # annotations: 8 (1 annotation) $output = qx{../src/task rc:urgency.rc 12 _urgency 2>&1}; like ($output, qr/urgency 8$/ms, '1 annotation = 8'); # annotations: 9 (2 annotations) $output = qx{../src/task rc:urgency.rc 13 _urgency 2>&1}; like ($output, qr/urgency 9$/ms, '2 annotations = 9'); # annotations: 10 (3 annotations) $output = qx{../src/task rc:urgency.rc 14 _urgency 2>&1}; like ($output, qr/urgency 10$/ms, '3 annotations = 10'); # annotations: 10 (4 annotations) $output = qx{../src/task rc:urgency.rc 15 _urgency 2>&1}; like ($output, qr/urgency 10$/ms, '4 annotations = 10'); # waiting: -10 qx{../src/task rc:urgency.rc add 7a wait:10s 2>&1}; # task 16 $output = qx{../src/task rc:urgency.rc 16 _urgency 2>&1}; like ($output, qr/urgency -10$/ms, 'waiting = -10'); # blocked: 10 (blocked) qx{../src/task rc:urgency.rc add 8a depends:1 2>&1}; # task 17 $output = qx{../src/task rc:urgency.rc 17 _urgency 2>&1}; like ($output, qr/urgency 10$/ms, 'blocked = 10'); # blocking: 10 (blocking) $output = qx{../src/task rc:urgency.rc 1 _urgency 2>&1}; like ($output, qr/urgency 10$/ms, 'blocking = 10'); # due # # days overdue, capped at 7 -> 0.8 - 1.0 # due today -> 0.7 # days until due, capped at 14 -> 0.4 - 0.6 # has due date -> 0.3 # no due date -> 0.0 qx{../src/task rc:urgency.rc add 9a due:-10d 2>&1}; # task 18 qx{../src/task rc:urgency.rc add 9b due:-7d 2>&1}; # task 19 qx{../src/task rc:urgency.rc add 9c due:-6d 2>&1}; # task 20 qx{../src/task rc:urgency.rc add 9d due:-5d 2>&1}; # task 21 qx{../src/task rc:urgency.rc add 9e due:-4d 2>&1}; # task 22 qx{../src/task rc:urgency.rc add 9f due:-3d 2>&1}; # task 23 qx{../src/task rc:urgency.rc add 9g due:-2d 2>&1}; # task 24 qx{../src/task rc:urgency.rc add 9h due:-1d 2>&1}; # task 25 qx{../src/task rc:urgency.rc add 9i due:now 2>&1}; # task 26 qx{../src/task rc:urgency.rc add 9j due:25h 2>&1}; # task 27 qx{../src/task rc:urgency.rc add 9k due:49h 2>&1}; # task 28 qx{../src/task rc:urgency.rc add 9l due:73h 2>&1}; # task 29 qx{../src/task rc:urgency.rc add 9m due:97h 2>&1}; # task 30 qx{../src/task rc:urgency.rc add 9n due:121h 2>&1}; # task 31 qx{../src/task rc:urgency.rc add 9o due:145h 2>&1}; # task 32 qx{../src/task rc:urgency.rc add 9p due:169h 2>&1}; # task 33 qx{../src/task rc:urgency.rc add 9q due:193h 2>&1}; # task 34 qx{../src/task rc:urgency.rc add 9r due:217h 2>&1}; # task 35 qx{../src/task rc:urgency.rc add 9s due:241h 2>&1}; # task 36 qx{../src/task rc:urgency.rc add 9t due:265h 2>&1}; # task 37 qx{../src/task rc:urgency.rc add 9u due:289h 2>&1}; # task 38 qx{../src/task rc:urgency.rc add 9v due:313h 2>&1}; # task 39 qx{../src/task rc:urgency.rc add 9w due:337h 2>&1}; # task 40 qx{../src/task rc:urgency.rc add 9x due:361h 2>&1}; # task 41 # due: 10 (due:-10d) $output = qx{../src/task rc:urgency.rc 18 _urgency 2>&1}; like ($output, qr/urgency 10$/ms, 'due:-10d = 10'); # due: 10 (due:-7d) $output = qx{../src/task rc:urgency.rc 19 _urgency 2>&1}; like ($output, qr/urgency 10$/ms, 'due:-7d = 10'); # due: 9.6 (due:-6d) $output = qx{../src/task rc:urgency.rc 20 _urgency 2>&1}; like ($output, qr/urgency 9.6/ms, 'due:-6d = 9.6'); # due: 9.2 (due:-5d) $output = qx{../src/task rc:urgency.rc 21 _urgency 2>&1}; like ($output, qr/urgency 9.2/ms, 'due:-5d = 9.2'); # due: 8.8 (due:-4d) $output = qx{../src/task rc:urgency.rc 22 _urgency 2>&1}; like ($output, qr/urgency 8.8/ms, 'due:-4d = 8.8'); # due: 8.4 (due:-3d) $output = qx{../src/task rc:urgency.rc 23 _urgency 2>&1}; like ($output, qr/urgency 8.4/ms, 'due:-3d = 8.4'); # due: 8 (due:-2d) $output = qx{../src/task rc:urgency.rc 24 _urgency 2>&1}; like ($output, qr/urgency 8/ms, 'due:-2d = 8'); # due: 7.6 (due:-1d) $output = qx{../src/task rc:urgency.rc 25 _urgency 2>&1}; like ($output, qr/urgency 7.6/ms, 'due:-1d = 7.6'); # due: 7.2 (due:now) $output = qx{../src/task rc:urgency.rc 26 _urgency 2>&1}; like ($output, qr/urgency 7.2$/ms, 'due:now = 7.2'); # due: 6.8 (due:1d) $output = qx{../src/task rc:urgency.rc 27 _urgency 2>&1}; like ($output, qr/urgency 6.8/ms, 'due:1d = 6.8'); # due: 6.4 (due:2d) $output = qx{../src/task rc:urgency.rc 28 _urgency 2>&1}; like ($output, qr/urgency 6.4/ms, 'due:2d = 6.4'); # due: 6 (due:3d) $output = qx{../src/task rc:urgency.rc 29 _urgency 2>&1}; like ($output, qr/urgency 6/ms, 'due:3d = 6'); # due: 5.6 (due:4d) $output = qx{../src/task rc:urgency.rc 30 _urgency 2>&1}; like ($output, qr/urgency 5.6/ms, 'due:4d = 5.6'); # due: 5.2 (due:5d) $output = qx{../src/task rc:urgency.rc 31 _urgency 2>&1}; like ($output, qr/urgency 5.2/ms, 'due:5d = 5.2'); # due: 4.8 (due:6d) $output = qx{../src/task rc:urgency.rc 32 _urgency 2>&1}; like ($output, qr/urgency 4.8/ms, 'due:6d = 4.8'); # due: 4.4 (due:7d) $output = qx{../src/task rc:urgency.rc 33 _urgency 2>&1}; like ($output, qr/urgency 4.4/ms, 'due:7d = 4.4'); # due: 4 (due:8d) $output = qx{../src/task rc:urgency.rc 34 _urgency 2>&1}; like ($output, qr/urgency 4/ms, 'due:8d = 4'); # due: 3.6 (due:9d) $output = qx{../src/task rc:urgency.rc 35 _urgency 2>&1}; like ($output, qr/urgency 3.6/ms, 'due:9d = 3.6'); # due: 3.2 (due:10d) $output = qx{../src/task rc:urgency.rc 36 _urgency 2>&1}; like ($output, qr/urgency 3.2/ms, 'due:10d = 3.2'); # due: 2.8 (due:11d) $output = qx{../src/task rc:urgency.rc 37 _urgency 2>&1}; like ($output, qr/urgency 2.8/ms, 'due:11d = 2.8'); # due: 2.4 (due:12d) $output = qx{../src/task rc:urgency.rc 38 _urgency 2>&1}; like ($output, qr/urgency 2.4/ms, 'due:12d = 2.4'); # due: 2 (due:13d) $output = qx{../src/task rc:urgency.rc 39 _urgency 2>&1}; like ($output, qr/urgency 2/ms, 'due:13d = 2'); # due: 1.6 (due:14d) $output = qx{../src/task rc:urgency.rc 40 _urgency 2>&1}; like ($output, qr/urgency 1.6/ms, 'due:14d = 1.6'); # due: 1.6 (due:20d) $output = qx{../src/task rc:urgency.rc 41 _urgency 2>&1}; like ($output, qr/urgency 1.6$/ms, 'due:20d = 1.6'); # user.project: 10 (pro:PROJECT) + 10 (project) qx{../src/task rc:urgency.rc add 10a project:PROJECT 2>&1}; # task 42 $output = qx{../src/task rc:urgency.rc 42 _urgency 2>&1}; like ($output, qr/urgency 20$/ms, 'pro:PROJECT = 20'); # user.tag: 10 (+TAG) + 8 (1 tag) qx{../src/task rc:urgency.rc add 11a +TAG 2>&1}; # task 43 $output = qx{../src/task rc:urgency.rc 43 _urgency 2>&1}; like ($output, qr/urgency 18$/ms, '+TAG = 18'); # scheduled 0 (scheduled future) qx {../src/task rc:urgency.rc add 12a scheduled:30d 2>&1}; $output = qx{../src/task rc:urgency.rc 44 _urgency 2>&1}; like ($output, qr/urgency 0$/ms, 'scheduled future = 0'); # scheduled 5 (scheduled past) qx {../src/task rc:urgency.rc add 12b scheduled:yesterday 2>&1}; $output = qx{../src/task rc:urgency.rc 45 _urgency 2>&1}; like ($output, qr/urgency 5$/ms, 'scheduled past = 5'); # urgency values between 0 and 1 qx {../src/task rc:urgency.rc add 13 pri:H 2>&1}; $output = qx{../src/task rc:urgency.rc rc.urgency.priority.coefficient:0.01234 46 info 2>&1}; like ($output, qr/Urgency 0.01$/ms, 'near-zero urgency is truncated'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key urgency.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'urgency.rc', 'Cleanup'); exit 0; task-2.2.0-test/uri.t.cpp000064400000000000000000000156161213035135600152050ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2010 - 2013, Johannes Schlatow. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { UnitTest t (54); Uri uri1 ("asfd://user@host/folder/"); uri1.parse (); t.is (uri1._user, "user", "Uri::parse() : asdf://user@host/folder/"); t.is (uri1._host, "host", "Uri::parse() : asdf://user@host/folder/"); t.is (uri1._port, "", "Uri::parse() : asdf://user@host/folder/"); t.is (uri1._path, "folder/", "Uri::parse() : asdf://user@host/folder/"); t.is (uri1._protocol, "asfd", "Uri::parse() : asdf://user@host/folder/"); t.ok (uri1.append ("file.test"), "Uri::append() to path"); t.is (uri1._path, "folder/file.test", "Uri::append() ok"); Uri uri2 ("user@host:folder/file.test"); uri2.parse (); t.is (uri2._user, "user", "Uri::parse() : user@host:folder/file.test"); t.is (uri2._host, "host", "Uri::parse() : user@host:folder/file.test"); t.is (uri2._port, "", "Uri::parse() : user@host/folder/file.test"); t.is (uri2._path, "folder/file.test", "Uri::parse() : user@host/folder/file.test"); t.is (uri2._protocol, "ssh", "Uri::parse() : user@host/folder/file.test"); t.notok (uri2.append ("test.dat"), "Uri::append() to file"); Uri uri3 ("rsync://hostname.abc.de:1234//abs/path"); uri3.parse (); t.is (uri3._user, "", "Uri::parse() : rsync://hostname.abc.de:1234//abs/path"); t.is (uri3._host, "hostname.abc.de", "Uri::parse() : rsync://hostname.abc.de:1234//abs/path"); t.is (uri3._port, "1234", "Uri::parse() : rsync://hostname.abc.de:1234//abs/path"); t.is (uri3._path, "/abs/path", "Uri::parse() : rsync://hostname.abc.de:1234//abs/path"); t.is (uri3._protocol, "rsync", "Uri::parse() : rsync://hostname.abc.de:1234//abs/path"); Uri uri4 ("hostname:"); uri4.parse (); t.is (uri4._user, "", "Uri::parse() : hostname:"); t.is (uri4._host, "hostname", "Uri::parse() : hostname:"); t.is (uri4._port, "", "Uri::parse() : hostname:"); t.is (uri4._path, "", "Uri::parse() : hostname:"); t.is (uri4._protocol, "ssh", "Uri::parse() : hostname:"); t.notok (uri4.is_local (), "Uri::is_local() : hostname:"); t.ok (uri4.append ("file.test"), "Uri::append() : hostname:"); t.is (uri4._path, "file.test","Uri::append() : ok"); context.config.set ("merge.default.uri", "../folder/"); context.config.set ("push.test.uri", "/home/user/.task/"); Uri uri5 ("", "merge"); t.ok (uri5.is_local (), "Uri::is_local() : ../server/"); uri5.parse (); t.is (uri5._path, "../folder/", "Uri::expand() default"); Uri uri6 ("test", "push"); t.ok (uri6.is_local(), "Uri::is_local() : /home/user/.task/"); uri6.parse (); t.is (uri6._path, "/home/user/.task/", "Uri::expand() test"); Uri uri7 ("ftp://'user@name'@host:321/path/to/x"); uri7.parse (); t.is (uri7._user, "user@name", "Uri::parse() : ftp://'user@name'@host:321/path/to/x"); t.is (uri7._host, "host", "Uri::parse() : ftp://'user@name'@host:321/path/to/x"); t.is (uri7._port, "321", "Uri::parse() : ftp://'user@name'@host:321/path/to/x"); t.is (uri7._path, "path/to/x", "Uri::parse() : ftp://'user@name'@host:321/path/to/x"); t.is (uri7._protocol, "ftp", "Uri::parse() : ftp://'user@name'@host:321/path/to/x"); Uri uri8 ("http://'us/er@n:ame'@host/path/to/x"); uri8.parse (); t.is (uri8._user, "us/er@n:ame", "Uri::parse() : http://'us/er@n:ame'@host/path/to/x"); t.is (uri8._host, "host", "Uri::parse() : http://'us/er@n:ame'@host/path/to/x"); t.is (uri8._port, "", "Uri::parse() : http://'us/er@n:ame'@host/path/to/x"); t.is (uri8._path, "path/to/x", "Uri::parse() : http://'us/er@n:ame'@host/path/to/x"); t.is (uri8._protocol, "http", "Uri::parse() : http://'us/er@n:ame'@host/path/to/x"); Uri uri9 ("'user@name'@host:path/to/x"); uri9.parse (); t.is (uri9._user, "user@name", "Uri::parse() : 'user@name'@host:path/to/x"); t.is (uri9._host, "host", "Uri::parse() : 'user@name'@host:path/to/x"); t.is (uri9._port, "", "Uri::parse() : 'user@name'@host:path/to/x"); t.is (uri9._path, "path/to/x", "Uri::parse() : 'user@name'@host:path/to/x"); // bug #668 Uri uri10 ("user.name@host.com:undo.data"); uri10.parse (); t.is (uri10._user, "user.name", "Uri::parse() : user.name@host.com:undo.data"); t.is (uri10._host, "host.com", "Uri::parse() : user.name@host.com:undo.data"); t.is (uri10._port, "", "Uri::parse() : user.name@host.com:undo.data"); t.is (uri10._path, "undo.data", "Uri::parse() : user.name@host.com:undo.data"); t.is (uri10._protocol, "ssh", "Uri::parse() : user.name@host.com:undo.data"); Uri uri11 ("ssh://user.name@host.com/undo.data"); uri11.parse (); t.is (uri11._user, "user.name", "Uri::parse() : ssh://user.name@host.com/undo.data"); t.is (uri11._host, "host.com", "Uri::parse() : ssh://user.name@host.com/undo.data"); t.is (uri11._port, "", "Uri::parse() : ssh://user.name@host.com/undo.data"); t.is (uri11._path, "/undo.data", "Uri::parse() : ssh://user.name@host.com/undo.data"); t.is (uri11._protocol, "ssh", "Uri::parse() : ssh://user.name@host.com/undo.data"); return 0; } //////////////////////////////////////////////////////////////////////////////// // vim: et ts=2 sw=2 task-2.2.0-test/utf8.t.cpp000064400000000000000000000075221213035135600152710ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { UnitTest t (17); std::string ascii_text = "This is a test"; std::string utf8_text = "más sábado miércoles"; std::string utf8_wide_text = "改变各种颜色"; std::string ascii_text_color = "This is a test"; std::string utf8_text_color = "más sábado miércoles"; std::string utf8_wide_text_color = "改变各种颜色"; // unsigned int utf8_codepoint (const std::string&); t.is ((int) utf8_codepoint ("\\u0020"), 32, "\\u0020 --> ' '"); t.is ((int) utf8_codepoint ("U+0020"), 32, "U+0020 --> ' '"); // TODO unsigned int utf8_next_char (const std::string&, std::string::size_type&); // TODO std::string utf8_character (unsigned int); // TODO int utf8_sequence (unsigned int); // unsigned int utf8_length (const std::string&); t.is ((int) utf8_length (ascii_text), 14, "ASCII utf8_length"); t.is ((int) utf8_length (utf8_text), 20, "UTF8 utf8_length"); t.is ((int) utf8_length (utf8_wide_text), 6, "UTF8 wide utf8_length"); // unsigned int utf8_width (const std::string&); t.is ((int) utf8_width (ascii_text), 14, "ASCII utf8_width"); t.is ((int) utf8_width (utf8_text), 20, "UTF8 utf8_width"); t.is ((int) utf8_width (utf8_wide_text), 12, "UTF8 wide utf8_width"); // unsigned int utf8_text_length (const std::string&); t.is ((int) utf8_text_length (ascii_text_color), 14, "ASCII utf8_text_length"); t.is ((int) utf8_text_length (utf8_text_color), 20, "UTF8 utf8_text_length"); t.is ((int) utf8_text_length (utf8_wide_text_color), 6, "UTF8 wide utf8_text_length"); // unsigned int utf8_text_width (const std::string&); t.is ((int) utf8_text_width (ascii_text_color), 14, "ASCII utf8_text_width"); t.is ((int) utf8_text_width (utf8_text_color), 20, "UTF8 utf8_text_width"); t.is ((int) utf8_text_width (utf8_wide_text_color), 12, "UTF8 wide utf8_text_width"); // const std::string utf8_substr (const std::string&, unsigned int, unsigned int length = 0); t.is (utf8_substr (ascii_text, 0, 2), "Th", "ASCII utf8_substr"); t.is (utf8_substr (utf8_text, 0, 2), "má", "UTF8 utf8_substr"); t.is (utf8_substr (utf8_wide_text, 0, 2), "改变", "UTF8 wide utf8_substr"); return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/utf8_tw.t000075500000000000000000000100171213035135600152160ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 5; # Create the rc file. if (open my $fh, '>', 'utf8.rc') { print $fh "data.location=.\n"; close $fh; ok (-r 'utf8.rc', 'Created utf8.rc'); } # Add a task with UTF8 in the description. qx{../src/task rc:utf8.rc add Çirçös 2>&1}; qx{../src/task rc:utf8.rc add Hello world ☺ 2>&1}; qx{../src/task rc:utf8.rc add ¥£€\$¢₡₢₣₤₥₦₧₨₩₪₫₭₮₯ 2>&1}; qx{../src/task rc:utf8.rc add Pchnąć w tę łódź jeża lub ośm skrzyń fig 2>&1}; qx{../src/task rc:utf8.rc add ๏ เป็นมนุษย์สุดประเสริฐเลิศคุณค่า 2>&1}; qx{../src/task rc:utf8.rc add イロハニホヘト チリヌルヲ ワカヨタレソ ツネナラムイ ロハニホヘト チリヌルヲ ワカヨタレソ ツネナラム 2>&1}; qx{../src/task rc:utf8.rc add いろはにほへとちりぬるを 2>&1}; qx{../src/task rc:utf8.rc add D\\'fhuascail Íosa, Úrmhac na hÓighe Beannaithe, pór Éava agus Ádhaimh 2>&1}; qx{../src/task rc:utf8.rc add Árvíztűrő tükörfúrógép 2>&1}; qx{../src/task rc:utf8.rc add Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa 2>&1}; qx{../src/task rc:utf8.rc add Sævör grét áðan því úlpan var ónýt 2>&1}; qx{../src/task rc:utf8.rc add Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen Wolther spillede på xylofon. 2>&1}; qx{../src/task rc:utf8.rc add Falsches Üben von Xylophonmusik quält jeden größeren Zwerg 2>&1}; qx{../src/task rc:utf8.rc add Zwölf Boxkämpfer jagten Eva quer über den Sylter Deich 2>&1}; qx{../src/task rc:utf8.rc add Heizölrückstoßabdämpfung 2>&1}; qx{../src/task rc:utf8.rc add Γαζέες καὶ μυρτιὲς δὲν θὰ βρῶ πιὰ στὸ χρυσαφὶ ξέφωτο 2>&1}; qx{../src/task rc:utf8.rc add Ξεσκεπάζω τὴν ψυχοφθόρα βδελυγμία 2>&1}; my $output = qx{../src/task rc:utf8.rc ls 2>&1}; diag ($output); like ($output, qr/17/, 'all 17 tasks shown'); qx{../src/task rc:utf8.rc add project:Çirçös utf8 in project 2>&1}; $output = qx{../src/task rc:utf8.rc ls project:Çirçös 2>&1}; like ($output, qr/Çirçös.+utf8 in project/, 'utf8 in project works'); qx{../src/task rc:utf8.rc add utf8 in tag +Zwölf 2>&1}; $output = qx{../src/task rc:utf8.rc ls +Zwölf 2>&1}; like ($output, qr/utf8 in tag/, 'utf8 in tag works'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key utf8.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'utf8.rc', 'Cleanup'); exit 0; task-2.2.0-test/util.t.cpp000064400000000000000000000145011213035135600153530ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { UnitTest t (40); // TODO bool confirm (const std::string&); // TODO int confirm3 (const std::string&); // TODO int confirm4 (const std::string&); // TODO void delay (float); // std::string formatBytes (size_t); t.is (formatBytes (0), "0 B", "0 -> 0 B"); t.is (formatBytes (994), "994 B", "994 -> 994 B"); t.is (formatBytes (995), "1.0 KiB", "995 -> 1.0 KiB"); t.is (formatBytes (999), "1.0 KiB", "999 -> 1.0 KiB"); t.is (formatBytes (1000), "1.0 KiB", "1000 -> 1.0 KiB"); t.is (formatBytes (1001), "1.0 KiB", "1001 -> 1.0 KiB"); t.is (formatBytes (999999), "1.0 MiB", "999999 -> 1.0 MiB"); t.is (formatBytes (1000000), "1.0 MiB", "1000000 -> 1.0 MiB"); t.is (formatBytes (1000001), "1.0 MiB", "1000001 -> 1.0 MiB"); t.is (formatBytes (999999999), "1.0 GiB", "999999999 -> 1.0 GiB"); t.is (formatBytes (1000000000), "1.0 GiB", "1000000000 -> 1.0 GiB"); t.is (formatBytes (1000000001), "1.0 GiB", "1000000001 -> 1.0 GiB"); // TODO const std::string uuid (); // TODO These are in feedback.cpp, not util.cpp. // std::string taskDiff (const Task&, const Task&); Task left; left.set ("zero", "0"); left.set ("one", 1); left.set ("two", 2); Task right; right.set ("zero", "00"); right.set ("two", 2); right.set ("three", 3); Task rightAgain (right); std::string output = taskDifferences (left, right); t.ok (taskDiff (left, right), "Detected changes"); t.ok (output.find ("Zero will be changed from '0' to '00'") != std::string::npos, "Detected change zero:0 -> zero:00"); t.ok (output.find ("One will be deleted") != std::string::npos, "Detected deletion one:1 ->"); t.ok (output.find ("Two") == std::string::npos, "Detected no change two:2 -> two:2"); t.ok (output.find ("Three will be set to '3'") != std::string::npos, "Detected addition -> three:3"); t.notok (taskDiff (right, rightAgain), "No changes detected"); output = taskDifferences (right, rightAgain); t.ok (output.find ("No changes will be made") != std::string::npos, "No changes detected"); // void combine (std::vector &, const std::vector &); std::vector vleft; vleft.push_back (1); vleft.push_back (2); vleft.push_back (3); std::vector vright; vright.push_back (4); combine (vleft, vright); t.is (vleft.size (), (size_t)4, "1,2,3 + 4 -> [4]"); t.is (vleft[0], 1, "1,2,3 + 4 -> 1,2,3,4"); t.is (vleft[1], 2, "1,2,3 + 4 -> 1,2,3,4"); t.is (vleft[2], 3, "1,2,3 + 4 -> 1,2,3,4"); t.is (vleft[3], 4, "1,2,3 + 4 -> 1,2,3,4"); vright.push_back (3); vright.push_back (5); combine (vleft, vright); t.is (vleft.size (), (size_t)5, "1,2,3,4 + 3,4,5 -> [5]"); t.is (vleft[0], 1, "1,2,3,4 + 3,4,5 -> 1,2,3,4,5"); t.is (vleft[1], 2, "1,2,3,4 + 3,4,5 -> 1,2,3,4,5"); t.is (vleft[2], 3, "1,2,3,4 + 3,4,5 -> 1,2,3,4,5"); t.is (vleft[3], 4, "1,2,3,4 + 3,4,5 -> 1,2,3,4,5"); t.is (vleft[4], 5, "1,2,3,4 + 3,4,5 -> 1,2,3,4,5"); // see also indirect tests of indentProject and extractParents in `project.t'. // std::vector indentTree (const std::vector&, const std::string whitespace=" ", char delimiter='.'); std::vector flat; flat.push_back ("one"); flat.push_back ("one.two"); flat.push_back ("one.two.three"); flat.push_back ("one.four"); flat.push_back ("two"); std::vector structured = indentTree (flat, " ", '.'); t.is (structured.size (), (size_t) 5, "indentTree yields 5 strings"); t.is (structured[0], "one", "indentTree 'one' -> 'one'"); t.is (structured[1], " two", "indentTree 'one.two' -> ' two'"); t.is (structured[2], " three", "indentTree 'one.two.three' -> ' three'"); t.is (structured[3], " four", "indentTree 'one.four' -> ' four'"); t.is (structured[4], "two", "indentTree 'two' -> 'two'"); // std::vector indentProject (const std::string&, const std::string whitespace=" ", char delimiter='.'); t.is (indentProject (""), "", "indentProject '' -> ''"); t.is (indentProject ("one"), "one", "indentProject 'one' -> 'one'"); t.is (indentProject ("one.two"), " two", "indentProject 'one.two' -> ' two'"); t.is (indentProject ("one.two.three"), " three", "indentProject 'one.two.three' -> ' three'"); // TODO const std::string encode (const std::string& value); // TODO const std::string decode (const std::string& value); return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/uuid.t000075500000000000000000000126051213035135600145710ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 26; # Create the rc file. if (open my $fh, '>', 'uuid.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'uuid.rc', 'Created uuid.rc'); } if (open my $fh, '>', 'pending.data') { print $fh <', 'completed.data') { print $fh <&1}; qx{../src/task rc:uuid.rc 2 modify TWO 2>&1}; my $output = qx{../src/task rc:uuid.rc list 2>&1}; like ($output, qr/ONE/, 'task list ONE'); like ($output, qr/TWO/, 'task list TWO'); like ($output, qr/three/, 'task list three'); like ($output, qr/ssttaarrtt/, 'task list ssttaarrtt'); unlike ($output, qr/four/, 'task does not list four'); unlike ($output, qr/five/, 'task does not list five'); unlike ($output, qr/eenndd/, 'task does not list eenndd'); unlike ($output, qr/UUNNDDOO/, 'task does not list UUNNDDOO'); qx{../src/task rc:uuid.rc ea3b4822-574c-464b-8025-7f7be9f3cc57 modify FOUR 2>&1}; $output = qx{../src/task rc:uuid.rc completed 2>&1}; unlike ($output, qr/ONE/, 'task does not list ONE'); unlike ($output, qr/TWO/, 'task does not list TWO'); unlike ($output, qr/three/, 'task does not list three'); unlike ($output, qr/ssttaarrtt/, 'task does not list ssttaarrtt'); like ($output, qr/FOUR/, 'modified completed task FOUR'); like ($output, qr/five/, 'did not modify task five'); like ($output, qr/eenndd/, 'did not modify task eenndd'); like ($output, qr/UUNNDDOO/, 'did not modify task UUNNDDOO'); qx{../src/task rc:uuid.rc c1361003-948e-43e8-85c8-15d28dc3c71c modify status:pending 2>&1}; $output = qx{../src/task rc:uuid.rc list 2>&1}; like ($output, qr/UUNNDDOO/, 'task UUNNDDOO modified status to pending'); $output = qx{../src/task rc:uuid.rc completed 2>&1}; unlike ($output, qr/UUNNDDOO/, 'task does not list UUNNDDOO after modification'); qx{../src/task rc:uuid.rc d71d3566-7a6b-4c32-8f0b-6de75bb9397b modify start:1293796800 2>&1}; $output = qx{../src/task rc:uuid.rc long 2>&1}; like ($output, qr/12\/31\/2010/, 'modified start date of task ssttaarrtt'); qx{../src/task rc:uuid.rc 727baa6c-65b8-485e-a810-e133e3cd83dc modify end:1293796800 2>&1}; $output = qx{../src/task rc:uuid.rc completed 2>&1}; like ($output, qr/12\/31\/2010/, 'modified end date of task eenndd'); qx{../src/task rc:uuid.rc aa4abef1-1dc5-4a43-b6a0-7872df3094bb modify entry:1293710400 2>&1}; qx{../src/task rc:uuid.rc aa4abef1-1dc5-4a43-b6a0-7872df3094bb modify start:1293883200 2>&1}; $output = qx{../src/task rc:uuid.rc long 2>&1}; like ($output, qr/12\/30\/2010/, 'modified entry date of task three'); like ($output, qr/1\/1\/2011/, 'added start date of task three with modify'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key uuid.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'uuid.rc', 'Cleanup'); exit 0; task-2.2.0-test/verbose.t000075500000000000000000000056701213035135600152740ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 8; # Create the rc file. if (open my $fh, '>', 'verbose.rc') { print $fh "data.location=.\n", "echo.command=off\n"; print $fh "print.empty.columns=yes\n"; close $fh; ok (-r 'verbose.rc', 'Created verbose.rc'); } # Verbosity: 'new-id' my $output = qx{../src/task rc:verbose.rc rc.verbose:new-id add Sample1 2>&1}; like ($output, qr/Created task \d/, '\'new-id\' verbosity good'); $output = qx{../src/task rc:verbose.rc rc.verbose:nothing add Sample2 2>&1}; unlike ($output, qr/Created task \d/, '\'new-id\' verbosity good'); # Verbosity: 'label' $output = qx{../src/task rc:verbose.rc ls rc.verbose:label 2>&1}; like ($output, qr/ID.+Proj.+Pri.+Description/, '\'label\' verbosity good'); # Verbosity: 'affected' $output = qx{../src/task rc:verbose.rc ls rc.verbose:affected 2>&1}; like ($output, qr/^\d+ tasks$/ms, '\'affected\' verbosity good'); # Off $output = qx{../src/task rc:verbose.rc ls rc.verbose:nothing 2>&1}; unlike ($output, qr/^\d+ tasks$/ms, '\'affected\' verbosity good'); unlike ($output, qr/ID.+Project.+Pri.+Description/, '\'label\' verbosity good'); # TODO Verbosity: 'blank' # TODO Verbosity: 'header' # TODO Verbosity: 'edit' # TODO Verbosity: 'special' # TODO Verbosity: 'project' # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key verbose.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'verbose.rc', 'Cleanup'); exit 0; task-2.2.0-test/view.t.cpp000064400000000000000000000151341213035135600153530ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { UnitTest t (2); try { // Set up configuration. context.config.setDefaults (); context.config.set ("fontunderline", true); context.config.set ("tag.indicator", "+"); context.config.set ("dependency.indicator", "D"); context.config.set ("recurrence.indicator", "R"); context.config.set ("dateformat", "Y-M-D"); context.config.set ("indent.annotation", "2"); // Two sample tasks. Task t1 ("[" "status:\"pending\" " "uuid:\"2a64f6e0-bf8e-430d-bf71-9ec3f0d9b661\" " "description:\"This is the description text\" " "project:\"Home\" " "priority:\"H\" " "annotation_1234567890:\"This is an annotation\" " "start:\"1234567890\" " "due:\"1234567890\" " "tags:\"one,two\"" "]"); t1.id = 1; Task t2 ("[" "status:\"pending\" " "uuid:\"f30cb9c3-3fc0-483f-bfb2-3bf134f00694\" " "description:\"This is the description text\" " "project:\"Garden Care\" " "recur:\"monthly\" " "depends:\"2a64f6e0-bf8e-430d-bf71-9ec3f0d9b661\"" "]"); t2.id = 11; Task t3 ("[" "status:\"pending\" " "uuid:\"c44cb9c3-3fc0-483f-bfb2-3bf134f05554\" " "description:\"Another description\" " "project:\"Garden\" " "]"); t3.id = 8; std::vector data; data.push_back (t1); data.push_back (t2); data.push_back (t3); // Sequence of tasks. std::vector sequence; sequence.push_back (0); sequence.push_back (1); sequence.push_back (2); sort_tasks (data, sequence, "description+,id-"); // Create colors. Color header_color (Color (Color::yellow, Color::nocolor, false, false, false)); Color odd_color ("on gray1"); Color even_color ("on gray0"); // Create a view. std::string report = "view.t"; ViewTask view; view.add (Column::factory ("id", report)); view.add (Column::factory ("uuid.short", report)); view.add (Column::factory ("project", report)); view.add (Column::factory ("priority.long", report)); view.add (Column::factory ("tags", report)); view.add (Column::factory ("tags.count", report)); view.add (Column::factory ("description", report)); view.add (Column::factory ("depends.indicator", report)); view.add (Column::factory ("recur.indicator", report)); view.add (Column::factory ("status.short", report)); view.add (Column::factory ("due.countdown", report)); view.add (Column::factory ("start.active", report)); view.add (Column::factory ("urgency", report)); view.width (context.getWidth ()); view.leftMargin (4); view.extraPadding (0); view.intraPadding (1); view.colorHeader (header_color); view.colorOdd (odd_color); view.colorEven (even_color); view.intraColorOdd (odd_color); view.intraColorEven (even_color); // Render the view. std::cout << view.render (data, sequence); int expected_lines = 5; if (!isatty (fileno (stdout))) expected_lines = 6; t.is (view.lines (), expected_lines, "View::lines == 5"); // Now render a string-only grid. context.config.set ("fontunderline", false); Color single_cell ("bold white on red"); ViewText string_view; string_view.width (context.getWidth ()); string_view.leftMargin (4); string_view.extraPadding (0); string_view.intraPadding (1); string_view.colorHeader (header_color); string_view.colorOdd (odd_color); string_view.colorEven (even_color); string_view.intraColorOdd (odd_color); string_view.intraColorEven (even_color); string_view.add (Column::factory ("string", "One")); string_view.add (Column::factory ("string", "Two")); string_view.add (Column::factory ("string", "Three")); int row = string_view.addRow (); string_view.set (row, 0, "top left"); string_view.set (row, 1, "top center"); string_view.set (row, 2, "top right"); row = string_view.addRow (); string_view.set (row, 0, "bottom left", single_cell); string_view.set (row, 1, "bottom center, containing sufficient text that " "wrapping will occur because it exceeds all " "reasonable values for default width. Even in a " "very wide terminal window. Just look at the " "lengths we must go to, to get passing unit tests " "and not flaky tests."); string_view.set (row, 2, "bottom right"); std::cout << string_view.render (); t.ok (string_view.lines () > 4, "View::lines > 4"); } catch (const std::string& e) { t.fail ("Exception thrown."); t.diag (e); } return 0; } //////////////////////////////////////////////////////////////////////////////// task-2.2.0-test/wait.t000075500000000000000000000065711213035135600145740ustar00rootroot00000000000000#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## ## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. ## ## http://www.opensource.org/licenses/mit-license.php ## ################################################################################ use strict; use warnings; use Test::More tests => 13; # Create the rc file. if (open my $fh, '>', 'wait.rc') { print $fh "data.location=.\n", "confirmation=off\n"; close $fh; ok (-r 'wait.rc', 'Created wait.rc'); } # Add a waiting task, check it is not there, wait, then check it is. qx{../src/task rc:wait.rc add yeswait wait:2s 2>&1}; qx{../src/task rc:wait.rc add nowait 2>&1}; my $output = qx{../src/task rc:wait.rc ls 2>&1}; like ($output, qr/nowait/ms, 'non-waiting task visible'); unlike ($output, qr/yeswait/ms, 'waiting task invisible'); diag ("3 second delay"); sleep 3; $output = qx{../src/task rc:wait.rc ls 2>&1}; like ($output, qr/nowait/ms, 'non-waiting task still visible'); like ($output, qr/yeswait/ms, 'waiting task now visible'); qx{../src/task rc:wait.rc 1 modify wait:2s 2>&1}; $output = qx{../src/task rc:wait.rc ls 2>&1}; like ($output, qr/nowait/ms, 'non-waiting task visible'); unlike ($output, qr/yeswait/ms, 'waiting task invisible'); diag ("3 second delay"); sleep 3; $output = qx{../src/task rc:wait.rc ls 2>&1}; like ($output, qr/nowait/ms, 'non-waiting task still visible'); like ($output, qr/yeswait/ms, 'waiting task now visible'); qx{../src/task rc:wait.rc add wait:tomorrow tomorrow 2>&1}; $output = qx{../src/task rc:wait.rc ls 2>&1}; unlike ($output, qr/tomorrow/ms, 'waiting task invisible'); $output = qx{../src/task rc:wait.rc all status:waiting wait:tomorrow 2>&1}; like ($output, qr/tomorrow/ms, 'waiting task visible when specifically queried'); $output = qx{../src/task rc:wait.rc add Complain due:today wait:tomorrow 2>&1 >/dev/null}; like ($output, qr/Warning: You have specified that the 'wait' date is after the 'due' date\./, 'warning on wait after due'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key wait.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && ! -r 'synch.key' && ! -r 'wait.rc', 'Cleanup'); exit 0; task-2.2.0-test/width.t.cpp000064400000000000000000000047011213035135600155160ustar00rootroot00000000000000//////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // // Copyright 2006-2013, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include #include #include //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { UnitTest t (16); t.is (mk_wcwidth ('a'), 1, "U+0061 --> 1"); t.is (mk_wcwidth (0x5149), 2, "U+5149 --> 2"); t.is (mk_wcwidth (0x9a8c), 2, "U+9a8c --> 2"); t.is (mk_wcwidth (0x4e70), 2, "U+4e70 --> 2"); t.is (mk_wcwidth (0x94b1), 2, "U+94b1 --> 2"); t.is (mk_wcwidth (0x5305), 2, "U+5305 --> 2"); t.is (mk_wcwidth (0x91cd), 2, "U+91cd --> 2"); t.is (mk_wcwidth (0x65b0), 2, "U+65b0 --> 2"); t.is (mk_wcwidth (0x8bbe), 2, "U+8bbe --> 2"); t.is (mk_wcwidth (0x8ba1), 2, "U+8ba1 --> 2"); t.is (mk_wcwidth (0x5411), 2, "U+5411 --> 2"); t.is (mk_wcwidth (0x4e0a), 2, "U+4e0a --> 2"); t.is (mk_wcwidth (0x4e0b), 2, "U+4e0b --> 2"); t.is (mk_wcwidth (0x7bad), 2, "U+7bad --> 2"); t.is (mk_wcwidth (0x5934), 2, "U+5934 --> 2"); t.is (mk_wcwidth (0xff0c), 2, "U+ff0c --> 2"); // comma return 0; } ////////////////////////////////////////////////////////////////////////////////