Prolog cookbook: fix several examples.
* The Example 13: 1+1=2 Code-Review was broken, the fix was missing in I131e2008ba previous fix. Fix the following error: test output invalid result: submit(label(Code-Review,ok(_535EC2E6))). Reason: A label with the status Code-Review: OK must contain a user. * Example 6: Make change submittable if commit author is "John Doe" was probably missing the user(ID) Change-Id: I4126f01d979b4511faa83d4f779f83599c51c29a
This commit is contained in:

committed by
David Pursehouse

parent
d2b8ed4b87
commit
6ca0726997
@@ -544,6 +544,7 @@ submit_rule(submit(Author)) :-
|
|||||||
Author = label('Author-is-John-Doe', need(_)).
|
Author = label('Author-is-John-Doe', need(_)).
|
||||||
|
|
||||||
submit_rule(submit(Author)) :-
|
submit_rule(submit(Author)) :-
|
||||||
|
A = user(1000000),
|
||||||
gerrit:commit_author(A, 'John Doe', 'john.doe@example.com'),
|
gerrit:commit_author(A, 'John Doe', 'john.doe@example.com'),
|
||||||
Author = label('Author-is-John-Doe', ok(A)).
|
Author = label('Author-is-John-Doe', ok(A)).
|
||||||
----
|
----
|
||||||
@@ -899,7 +900,10 @@ add_category_min_score(In, Category, Min, P) :-
|
|||||||
findall(X, gerrit:commit_label(label(Category,X),R),Z),
|
findall(X, gerrit:commit_label(label(Category,X),R),Z),
|
||||||
sum_list(Z, Sum),
|
sum_list(Z, Sum),
|
||||||
Sum >= Min, !,
|
Sum >= Min, !,
|
||||||
P = [label(Category,ok(R)) | In].
|
gerrit:commit_label(label(Category, V), U),
|
||||||
|
V >= 1,
|
||||||
|
!,
|
||||||
|
P = [label(Category,ok(U)) | In].
|
||||||
|
|
||||||
add_category_min_score(In, Category,Min,P) :-
|
add_category_min_score(In, Category,Min,P) :-
|
||||||
P = [label(Category,need(Min)) | In].
|
P = [label(Category,need(Min)) | In].
|
||||||
|
Reference in New Issue
Block a user