Merge "Misleading error message"

This commit is contained in:
Zuul 2018-07-25 03:08:20 +00:00 committed by Gerrit Code Review
commit 5149a4c802
2 changed files with 3 additions and 3 deletions

View File

@ -1761,7 +1761,7 @@ def literal_schema_consistency(literal, theories, theory=None):
arity = schema.arity(literal.table.table)
if arity is not None and len(literal.arguments) != arity:
return [exception.PolicyException(
"Literal {} contained {} arguments but only "
"Literal {} contained {} arguments but exactly "
"{} arguments are permitted".format(
str(literal), len(literal.arguments), arity))]

View File

@ -682,7 +682,7 @@ class TestCompiler(base.TestCase):
# wrong number of arguments
check_err('p(x) :- q(x), mod1:p(x,y,z,w), r(x)',
'mod3',
'only 3 arguments are permitted',
'exactly 3 arguments are permitted',
'Wrong number of arguments for rule')
# same tests for an atom
@ -702,7 +702,7 @@ class TestCompiler(base.TestCase):
# wrong number of arguments
check_err('p(1, 2, 3, 4)',
'mod1',
'only 3 arguments are permitted',
'exactly 3 arguments are permitted',
'Wrong number of arguments for atom',
f=compile.fact_errors)