adjust for nested throws.

This commit is contained in:
Mark Thom
2017-08-14 22:49:41 -06:00
parent aa3bee5db9
commit 1d2c02e9af
9 changed files with 362 additions and 174 deletions

View File

@@ -698,10 +698,10 @@ mod tests {
assert_eq!(submit(&mut wam, "?- catch(f(z), x, handle(y))."), true);
assert_eq!(submit(&mut wam, "?- catch(f(z), x, handle(z))."), false);
submit(&mut wam, "f(X) :- throw(stuff). f(X) :- throw(other_stuff).");
submit(&mut wam, "f(X) :- throw(stuff).");
submit(&mut wam, "handle(stuff). handle(other_stuff).");
// this should deterministically succeed with Exception = stuff.
// the first 3 cases should deterministically succeed.
assert_eq!(submit(&mut wam, "?- catch(f(X), Exception, handle(Exception))."), true);
assert_eq!(submit(&mut wam, "?- catch(f(X), Exception, handle(stuff))."), true);
assert_eq!(submit(&mut wam, "?- catch(f(X), Exception, handle(other_stuff))."), true);