Modifiers: "is" and "isnt" are now exact/inexact operators
This commit is contained in:
14
src/CLI2.cpp
14
src/CLI2.cpp
@@ -1168,21 +1168,21 @@ void CLI2::desugarFilterAttributes ()
|
|||||||
op.attribute ("raw", "!==");
|
op.attribute ("raw", "!==");
|
||||||
rhs.attribute ("raw", "''");
|
rhs.attribute ("raw", "''");
|
||||||
}
|
}
|
||||||
else if (mod == "is")
|
else if (mod == "is" || mod == "equals")
|
||||||
{
|
|
||||||
op.attribute ("raw", "=");
|
|
||||||
rhs.attribute ("raw", value);
|
|
||||||
}
|
|
||||||
else if (mod == "equals")
|
|
||||||
{
|
{
|
||||||
op.attribute ("raw", "==");
|
op.attribute ("raw", "==");
|
||||||
rhs.attribute ("raw", value);
|
rhs.attribute ("raw", value);
|
||||||
}
|
}
|
||||||
else if (mod == "isnt" || mod == "not")
|
else if (mod == "not")
|
||||||
{
|
{
|
||||||
op.attribute ("raw", "!=");
|
op.attribute ("raw", "!=");
|
||||||
rhs.attribute ("raw", value);
|
rhs.attribute ("raw", value);
|
||||||
}
|
}
|
||||||
|
else if (mod == "isnt")
|
||||||
|
{
|
||||||
|
op.attribute ("raw", "!==");
|
||||||
|
rhs.attribute ("raw", value);
|
||||||
|
}
|
||||||
else if (mod == "has" || mod == "contains")
|
else if (mod == "has" || mod == "contains")
|
||||||
{
|
{
|
||||||
op.attribute ("raw", "~");
|
op.attribute ("raw", "~");
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ class TestBug299(TestCase):
|
|||||||
code, out, err = self.t("list project.isnt:one pro.isnt:two")
|
code, out, err = self.t("list project.isnt:one pro.isnt:two")
|
||||||
|
|
||||||
self.assertNotRegexpMatches(out, "one.*foo")
|
self.assertNotRegexpMatches(out, "one.*foo")
|
||||||
self.assertNotRegexpMatches(out, "ones.*faz")
|
self.assertRegexpMatches(out, "ones.*faz")
|
||||||
self.assertRegexpMatches(out, "phone.*boo")
|
self.assertRegexpMatches(out, "phone.*boo")
|
||||||
self.assertRegexpMatches(out, "bones.*too")
|
self.assertRegexpMatches(out, "bones.*too")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user