Commits

cacol89 committed 0b355d1

splitted payment tests

  • Participants
  • Parent commits 5d0d66a

Comments (0)

Files changed (4)

File test/expected/integration/payment.out

 | 2002-10-15 00:00:00 | 1    | 2    |
 -------------------------------------
 
-yadi$ YADI execution error: Aggregate function 'PROD' is not supported, allowed functions are: MAX, MIN, SUM, AVG, COUNT
-
-yadi$ YADI execution error: Goal Person/2 contains an aggregate function as a variable, which is only allowed in rule heads
-
 yadi$ 

File test/expected/integration/payment2.out

+
+yadi$ YADI execution error: Aggregate function 'PROD' is not supported, allowed functions are: MAX, MIN, SUM, AVG, COUNT
+
+yadi$ YADI execution error: Goal Person/2 contains an aggregate function as a variable, which is only allowed in rule heads
+
+yadi$ YADI parse error
+
+yadi$ YADI parse error
+
+yadi$ YADI parse error
+
+yadi$ YADI parse error
+
+yadi$ YADI parse error
+
+yadi$ YADI execution error: Incomplete program, predicate Q/1 not defined
+
+yadi$ YADI execution error: Predicate Q/2 is unsafe, variable x is not in a positive goal or strict equality relation.
+
+yadi$ 

File test/integration/payment.datalog

 ?-Q(x,y,z).
 /
 
-%%%%%%%%%%%%%%%%%
-% Non-supported aggregates
-%%%%%%%%%%%%%%%%%
-
-Prod(prod(p)) :- Payment(_,_,p,_).
-?- Prod(pp).
-/
-
-%%%%%%%%%%%%%%%%%
-% Aggregates in goals (not allowed)
-%%%%%%%%%%%%%%%%%
-
-Q(x,y) :- Person(x,avg(y)).
-?- Q(x,y).
-/
-
-
-
-%Total(p,sum(x)) :- Person(pid,p), Payment(a,_,x,_).
-%?- Total(x,y).
-%/
-%
 %Total(p,sum(x)) :- Person(pid,p), Payment(a,_,x,_), sum(x) < 100.
 %?- Total(x,y).
 %/

File test/integration/payment2.datalog

+%............................................
+%............................................
+%............................................
+% All the test cases in this file contain
+% sintactic/semantic errors: they test if
+% yadi discovers and reports the errors.
+%............................................
+%............................................
+%............................................
+
+%%%%%%%%%%%%%%%%%
+% Non-supported aggregates
+%%%%%%%%%%%%%%%%%
+
+Prod(prod(p)) :- Payment(_,_,p,_).
+?- Prod(pp).
+/
+
+%%%%%%%%%%%%%%%%%
+% Aggregates in goals (not allowed)
+%%%%%%%%%%%%%%%%%
+
+Q(x,y) :- Person(x,avg(y)).
+?- Q(x,y).
+/
+
+%%%%%%%%%%%%%%%%%
+% Aggregates of constants (parse error, not allowed)
+%%%%%%%%%%%%%%%%%
+
+Q(sum(1)) :- .
+?- Q(x).
+/
+
+%%%%%%%%%%%%%%%%%
+% Safety analysis
+%%%%%%%%%%%%%%%%%
+
+Q(sum(x),y) :- Payment(y,_,_,_).
+?- Q(x,y).
+/