From 5da435e70d0b89b062e4a4ccd80a256897679bc1 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 8 May 2011 18:10:03 -0400 Subject: [PATCH] Unit Tests - Corrected several tests with respect to the new custom report columns and sort fields. --- test/recur.limit.t | 3 +- test/roundtrip.t | 3 +- test/sorting.t | 72 +++++++++++++++++++++++----------------------- 3 files changed, 40 insertions(+), 38 deletions(-) diff --git a/test/recur.limit.t b/test/recur.limit.t index f1c083d04..e92fa6276 100755 --- a/test/recur.limit.t +++ b/test/recur.limit.t @@ -33,7 +33,8 @@ use Test::More tests => 7; # Create the rc file. if (open my $fh, '>', 'recur.rc') { - print $fh "data.location=.\n"; + print $fh "data.location=.\n", + "defaultwidth=100\n"; close $fh; ok (-r 'recur.rc', 'Created recur.rc'); } diff --git a/test/roundtrip.t b/test/roundtrip.t index 333012015..6e58e1686 100755 --- a/test/roundtrip.t +++ b/test/roundtrip.t @@ -34,7 +34,8 @@ use Test::More tests => 8; if (open my $fh, '>', 'roundtrip.rc') { print $fh "data.location=.\n", - "confirmation=no\n"; + "confirmation=no\n", + "defaultwidth=100\n"; close $fh; ok (-r 'roundtrip.rc', 'Created roundtrip.rc'); } diff --git a/test/sorting.t b/test/sorting.t index 2c4838bbe..0b13b69f8 100755 --- a/test/sorting.t +++ b/test/sorting.t @@ -62,8 +62,8 @@ my %tests = 'priority+' => 'zero.+three.+two.+(?:one.+four|four.+one)', 'project-' => '(?:three.+four|four.+three).+two.+one.+zero', 'project+' => 'zero.+one.+two.+(?:three.+four|four.+three)', - 'active-' => '(?:one.+three|three.+one).+(?:zero.+two.+four|zero.+four.+two|two.+zero.+four|two.+four.+zero|four.+zero.+two|four.+two.+zero)', - 'active+' => '(?:zero.+two.+four|zero.+four.+two|two.+zero.+four|two.+four.+zero|four.+zero.+two|four.+two.+zero).+(?:one.+three|three.+one)', + 'start-' => '(?:one.+three|three.+one).+(?:zero.+two.+four|zero.+four.+two|two.+zero.+four|two.+four.+zero|four.+zero.+two|four.+two.+zero)', + 'start+' => '(?:zero.+two.+four|zero.+four.+two|two.+zero.+four|two.+four.+zero|four.+zero.+two|four.+two.+zero).+(?:one.+three|three.+one)', 'due-' => 'three.+(?:two.+four|four.+two).+one.+zero', 'due+' => 'one.+(?:two.+four|four.+two).+three.+zero', 'description-' => 'zero.+two.+three.+one.+four', @@ -75,10 +75,10 @@ my %tests = 'priority+,project-' => 'zero.+three.+two.+four.+one', 'priority+,project+' => 'zero.+three.+two.+one.+four', - 'priority-,active-' => 'one.+four.+two.+three.+zero', - 'priority-,active+' => 'four.+one.+two.+three.+zero', - 'priority+,active-' => 'zero.+three.+two.+one.+four', - 'priority+,active+' => 'zero.+three.+two.+four.+one', + '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', @@ -95,10 +95,10 @@ my %tests = 'project+,priority-' => 'zero.+one.+two.+four.+three', 'project+,priority+' => 'zero.+one.+two.+three.+four', - 'project-,active-' => 'three.+four.+two.+one.+zero', - 'project-,active+' => 'four.+three.+two.+one.+zero', - 'project+,active-' => 'zero.+one.+two.+three.+four', - 'project+,active+' => 'zero.+one.+two.+four.+three', + 'project-,start-' => 'three.+four.+two.+one.+zero', + 'project-,start+' => 'four.+three.+two.+one.+zero', + 'project+,start-' => 'zero.+one.+two.+three.+four', + 'project+,start+' => 'zero.+one.+two.+four.+three', 'project-,due-' => 'three.+four.+two.+one.+zero', 'project-,due+' => 'four.+three.+two.+one.+zero', @@ -110,25 +110,25 @@ my %tests = 'project+,description-' => 'zero.+one.+two.+three.+four', 'project+,description+' => 'zero.+one.+two.+four.+three', - 'active-,priority-' => 'one.+three.+four.+two.+zero', - 'active-,priority+' => 'three.+one.+zero.+two.+four', - 'active+,priority-' => 'four.+two.+zero.+one.+three', - 'active+,priority+' => 'zero.+two.+four.+three.+one', + 'start-,priority-' => 'one.+three.+four.+two.+zero', + 'start-,priority+' => 'three.+one.+zero.+two.+four', + 'start+,priority-' => 'four.+two.+zero.+one.+three', + 'start+,priority+' => 'zero.+two.+four.+three.+one', - 'active-,project-' => 'three.+one.+four.+two.+zero', - 'active-,project+' => 'one.+three.+zero.+two.+four', - 'active+,project-' => 'four.+two.+zero.+three.+one', - 'active+,project+' => 'zero.+two.+four.+one.+three', + 'start-,project-' => 'three.+one.+four.+two.+zero', + 'start-,project+' => 'one.+three.+zero.+two.+four', + 'start+,project-' => 'four.+two.+zero.+three.+one', + 'start+,project+' => 'zero.+two.+four.+one.+three', - 'active-,due-' => 'three.+one.+(?:four.+two|two.+four).+zero', - 'active-,due+' => 'one.+three.+(?:four.+two|two.+four).+zero', - 'active+,due-' => '(?:four.+two|two.+four).+zero.+three.+one', - 'active+,due+' => '(?:four.+two|two.+four).+zero.+one.+three', + 'start-,due-' => 'three.+one.+(?:four.+two|two.+four).+zero', + 'start-,due+' => 'one.+three.+(?:four.+two|two.+four).+zero', + 'start+,due-' => '(?:four.+two|two.+four).+zero.+three.+one', + 'start+,due+' => '(?:four.+two|two.+four).+zero.+one.+three', - 'active-,description-' => 'three.+one.+zero.+two.+four', - 'active-,description+' => 'one.+three.+four.+two.+zero', - 'active+,description-' => 'zero.+two.+four.+three.+one', - 'active+,description+' => 'four.+two.+zero.+one.+three', + 'start-,description-' => 'three.+one.+zero.+two.+four', + 'start-,description+' => 'one.+three.+four.+two.+zero', + 'start+,description-' => 'zero.+two.+four.+three.+one', + 'start+,description+' => 'four.+two.+zero.+one.+three', 'due-,priority-' => 'three.+four.+two.+one.+zero', 'due-,priority+' => 'three.+two.+four.+one.+zero', @@ -140,10 +140,10 @@ my %tests = 'due+,project-' => 'one.+four.+two.+three.+zero', 'due+,project+' => 'one.+two.+four.+three.+zero', - 'due-,active-' => 'three.+(?:four.+two|two.+four).+one.+zero', - 'due-,active+' => 'three.+(?:four.+two|two.+four).+one.+zero', - 'due+,active-' => 'one.+(?:four.+two|two.+four).+three.+zero', - 'due+,active+' => 'one.+(?:four.+two|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', @@ -160,10 +160,10 @@ my %tests = 'description+,project-' => 'four.+one.+three.+two.+zero', 'description+,project+' => 'four.+one.+three.+two.+zero', - 'description-,active-' => 'zero.+two.+three.+one.+four', - 'description-,active+' => 'zero.+two.+three.+one.+four', - 'description+,active-' => 'four.+one.+three.+two.+zero', - 'description+,active+' => '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', @@ -171,8 +171,8 @@ my %tests = 'description+,due+' => 'four.+one.+three.+two.+zero', # Four sort columns. - 'active+,project+,due+,priority+' => 'zero.+two.+four.+one.+three', - 'project+,due+,priority+,active+' => 'zero.+one.+two.+four.+three', + 'start+,project+,due+,priority+' => 'zero.+two.+four.+one.+three', + 'project+,due+,priority+,start+' => 'zero.+one.+two.+four.+three', ); for my $sort (sort keys %tests)