mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
TW-1947: "urgency.over" filter seems to not work correct
- Thanks to Marc Richter.
This commit is contained in:
parent
d5a0b616e1
commit
2c89688b46
4 changed files with 35 additions and 7 deletions
1
AUTHORS
1
AUTHORS
|
@ -318,3 +318,4 @@ suggestions:
|
|||
Dan Callahan
|
||||
Martin Strunz
|
||||
Kai HTML
|
||||
Marc Richter
|
||||
|
|
|
@ -73,6 +73,8 @@
|
|||
(thanks to Paul J. Fenwick)
|
||||
- TW-1938 Adjust behaviour of new-uuid and new-id verbosity levels
|
||||
(thanks to Paul J. Fenwick)
|
||||
- TW-1947 "urgency.over" filter seems to not work correct
|
||||
(thanks to Marc Richter).
|
||||
- Added 'juhannus' as a synonym for 'midsommarafton'
|
||||
(thanks to Lynoure Braakman).
|
||||
- Deprecated the 'DUETODAY' virtual tag, which is a synonym for the 'TODAY'
|
||||
|
|
19
src/CLI2.cpp
19
src/CLI2.cpp
|
@ -1279,7 +1279,7 @@ void CLI2::desugarFilterAttributes ()
|
|||
A2 op ("", Lexer::Type::op);
|
||||
op.tag ("FILTER");
|
||||
|
||||
A2 rhs ("", Lexer::Type::string);
|
||||
A2 rhs ("", values[0]._lextype);
|
||||
rhs.tag ("FILTER");
|
||||
|
||||
// Special case for '<name>:<value>'.
|
||||
|
@ -1372,16 +1372,21 @@ void CLI2::desugarFilterAttributes ()
|
|||
reconstructed.push_back (op);
|
||||
|
||||
// Do not modify this construct without full understanding.
|
||||
if (values.size () == 1 || ! evalSupported)
|
||||
// Getting this wrong breaks a whole lot of filtering tests.
|
||||
if (values.size () > 1 || evalSupported)
|
||||
{
|
||||
if (Lexer::isDOM (rhs.attribute ("raw")))
|
||||
rhs._lextype = Lexer::Type::dom;
|
||||
|
||||
for (auto& v : values)
|
||||
reconstructed.push_back (v);
|
||||
}
|
||||
else if (Lexer::isDOM (rhs.attribute ("raw")))
|
||||
{
|
||||
rhs._lextype = Lexer::Type::dom;
|
||||
reconstructed.push_back (rhs);
|
||||
}
|
||||
else
|
||||
for (auto& v : values)
|
||||
reconstructed.push_back (v);
|
||||
{
|
||||
reconstructed.push_back (rhs);
|
||||
}
|
||||
|
||||
found = true;
|
||||
}
|
||||
|
|
|
@ -269,6 +269,16 @@ class TestOperatorsQuantity(TestCase):
|
|||
self.assertNotIn("four", out)
|
||||
self.assertNotIn("five", out)
|
||||
|
||||
def test_urgency_over(self):
|
||||
"""operator urgency.over:10.0"""
|
||||
code, out, err = self.t("ls urgency.over:10.0")
|
||||
|
||||
self.assertIn("one", out)
|
||||
self.assertIn("two", out)
|
||||
self.assertNotIn("three", out)
|
||||
self.assertNotIn("four", out)
|
||||
self.assertNotIn("five", out)
|
||||
|
||||
# < operator #
|
||||
|
||||
def test_due_before(self):
|
||||
|
@ -331,6 +341,16 @@ class TestOperatorsQuantity(TestCase):
|
|||
self.assertIn("four", out)
|
||||
self.assertIn("five", out)
|
||||
|
||||
def test_urgency_under(self):
|
||||
"""operator urgency.under:10.0"""
|
||||
code, out, err = self.t("ls urgency.under:10.0")
|
||||
|
||||
self.assertNotIn("one", out)
|
||||
self.assertNotIn("two", out)
|
||||
self.assertIn("three", out)
|
||||
self.assertIn("four", out)
|
||||
self.assertIn("five", out)
|
||||
|
||||
# >= operator #
|
||||
|
||||
def test_due_greater_equal(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue