mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-04 12:28:35 +02:00
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.
This commit is contained in:
parent
5a07dce93a
commit
b9ad044eef
3 changed files with 12 additions and 31 deletions
|
@ -547,6 +547,7 @@ void E9::operator_nomatch (
|
||||||
const Task& task)
|
const Task& task)
|
||||||
{
|
{
|
||||||
result._type = Arg::type_bool;
|
result._type = Arg::type_bool;
|
||||||
|
result._value = "true";
|
||||||
|
|
||||||
if (eval_match (left, right, case_sensitive))
|
if (eval_match (left, right, case_sensitive))
|
||||||
{
|
{
|
||||||
|
@ -571,8 +572,6 @@ void E9::operator_nomatch (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
result._value = "true";
|
|
||||||
|
|
||||||
// std::cout << "# " << left << " <operator_nomatch> " << right << " --> " << result << "\n";
|
// std::cout << "# " << left << " <operator_nomatch> " << right << " --> " << result << "\n";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,6 @@
|
||||||
* cal.t
|
* cal.t
|
||||||
FH month and year are treated as IDs
|
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
|
* project.t
|
||||||
PB problem known, disabled output (???)
|
PB problem known, disabled output (???)
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 21;
|
use Test::More tests => 16;
|
||||||
|
|
||||||
# Create the rc file.
|
# Create the rc file.
|
||||||
if (open my $fh, '>', 'hasnt.rc')
|
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 1/, '1 has foo -> yes');
|
||||||
like ($output, qr/\n 2/, '2 has foo -> yes');
|
like ($output, qr/\n 2/, '2 has foo -> yes');
|
||||||
like ($output, qr/\n 3/, '3 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 5/, '5 has foo -> yes');
|
||||||
like ($output, qr/\n 6/, '6 has foo -> yes');
|
like ($output, qr/\n 6/, '6 has foo -> yes');
|
||||||
unlike ($output, qr/\n 7/, '7 has foo -> no');
|
unlike ($output, qr/\n 7/, '7 has foo -> no');
|
||||||
|
|
||||||
$output = qx{../src/task rc:hasnt.rc ls description.hasnt:foo};
|
$output = qx{../src/task rc:hasnt.rc ls description.hasnt:foo};
|
||||||
unlike ($output, qr/\n 1/, '1 hasnt foo -> no');
|
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');
|
unlike ($output, qr/\n 3/, '3 hasnt foo -> no');
|
||||||
like ($output, qr/\n 4/, '4 hasnt foo -> yes');
|
like ($output, qr/\n 4/, '4 hasnt foo -> yes');
|
||||||
unlike ($output, qr/\n 5/, '5 hasnt foo -> no');
|
unlike ($output, qr/\n 5/, '5 hasnt foo -> no');
|
||||||
unlike ($output, qr/\n 6/, '6 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.
|
# Cleanup.
|
||||||
unlink 'pending.data';
|
unlink qw(pending.data completed.data undo.data backlog.data synch.key hasnt.rc);
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
ok (! -r 'pending.data' &&
|
||||||
|
! -r 'completed.data' &&
|
||||||
unlink 'completed.data';
|
! -r 'undo.data' &&
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
! -r 'backlog.data' &&
|
||||||
|
! -r 'synch.key' &&
|
||||||
unlink 'undo.data';
|
! -r 'hasnt.rc', 'Cleanup');
|
||||||
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');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue