From b9ad044eefff0607102ecb3d36e3115ec0ab9b8d Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 7 Sep 2011 00:54:46 -0400 Subject: [PATCH] Expressions - hasnt (!~) - The operator_nomatch was not properly defaulting a "true" result. - Improved signal to noise ratio in bug.hasnt.t. - Removed obsolete entries in ANALYSIS file. --- src/E9.cpp | 3 +-- test/ANALYSIS | 8 -------- test/bug.hasnt.t | 32 +++++++++++--------------------- 3 files changed, 12 insertions(+), 31 deletions(-) diff --git a/src/E9.cpp b/src/E9.cpp index 6f45de0b1..0b845cded 100644 --- a/src/E9.cpp +++ b/src/E9.cpp @@ -547,6 +547,7 @@ void E9::operator_nomatch ( const Task& task) { result._type = Arg::type_bool; + result._value = "true"; if (eval_match (left, right, case_sensitive)) { @@ -571,8 +572,6 @@ void E9::operator_nomatch ( } } } - else - result._value = "true"; // std::cout << "# " << left << " " << right << " --> " << result << "\n"; } diff --git a/test/ANALYSIS b/test/ANALYSIS index ee99934be..b59ce1c37 100644 --- a/test/ANALYSIS +++ b/test/ANALYSIS @@ -1,14 +1,6 @@ * cal.t FH month and year are treated as IDs -* bug.hasnt.t -FH annotations are no longer considered when searching for strings in desciptions -PB one failure left. Haven't looked yet. - -* caseless.t -FH annotations are no longer considered when searching for strings in desciptions -PB one failure left. Haven't looked yet. - * project.t PB problem known, disabled output (???) diff --git a/test/bug.hasnt.t b/test/bug.hasnt.t index 351f39f5b..dc12d7d0a 100755 --- a/test/bug.hasnt.t +++ b/test/bug.hasnt.t @@ -28,7 +28,7 @@ use strict; use warnings; -use Test::More tests => 21; +use Test::More tests => 16; # Create the rc file. if (open my $fh, '>', 'hasnt.rc') @@ -72,38 +72,28 @@ my $output = qx{../src/task rc:hasnt.rc ls description.has:foo}; 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'); +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}; unlike ($output, qr/\n 1/, '1 hasnt foo -> no'); -unlike ($output, qr/\n 2/, '2 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'); +like ($output, qr/\n 7/, '7 hasnt foo -> yes'); # 15 # 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 'backlog.data'; -ok (!-r 'backlog.data', 'Removed backlog.data'); - -unlink 'synch.key'; -ok (!-r 'synch.key', 'Removed synch.key'); - -unlink 'hasnt.rc'; -ok (!-r 'hasnt.rc', 'Removed hasnt.rc'); +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;