Modifiers: "is" and "isnt" are now exact/inexact operators

This commit is contained in:
Paul Beckingham
2015-08-17 08:09:40 -04:00
parent 733e4e5aff
commit 358e0cc62d
2 changed files with 8 additions and 8 deletions

View File

@@ -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", "~");

View File

@@ -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")