bug fixes.

This commit is contained in:
Mark Thom
2017-08-15 11:06:19 -06:00
parent 1d2c02e9af
commit cc82447c64
7 changed files with 74 additions and 30 deletions

View File

@@ -721,9 +721,16 @@ mod tests {
submit(&mut wam, "g(g_success). g(g_success_2). g(X) :- throw(X).");
submit(&mut wam, "handle(x). handle(y). handle(z). handle(v) :- throw(X).");
//TODO: fix this test. record the ball properly. currently it
// is unwound when the heap is truncated.
assert_eq!(submit(&mut wam, "?- catch(f(X), E, E)."), true);
submit(&mut wam, "handle(x). handle(y). handle(z). handle(v) :- throw(handle_top(X)).");
submit(&mut wam, "handle_top(an_error_1). handle_top(an_error_2).");
assert_eq!(submit(&mut wam, "?- catch(f(X), E, E)."), true);
submit(&mut wam, "handle(x). handle(y). handle(z). handle(v) :- throw(X).");
assert_eq!(submit(&mut wam, "?- catch(f(X), E, handle_top(E))."), true);
}
}