From 78c2937e225d19f1ff62740ddda985791d3f1c85 Mon Sep 17 00:00:00 2001 From: akhiljain23 Date: Thu, 5 Jul 2018 15:13:12 +0530 Subject: [PATCH] Misleading error message Minor fix in error message to make it more understandable. Depends-On: I34d1a392d4539ede01666002cfa301c21f9cd4bd Change-Id: I3b92259fc80b8654050b5141f38fe764f7912319 Closes-Bug: #1756792 --- congress/datalog/compile.py | 2 +- congress/tests/datalog/test_compiler.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/congress/datalog/compile.py b/congress/datalog/compile.py index 639bb2cf8..05ffd6fe8 100644 --- a/congress/datalog/compile.py +++ b/congress/datalog/compile.py @@ -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))] diff --git a/congress/tests/datalog/test_compiler.py b/congress/tests/datalog/test_compiler.py index 49603cfbd..ca486596f 100644 --- a/congress/tests/datalog/test_compiler.py +++ b/congress/tests/datalog/test_compiler.py @@ -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)