Add support for a callback on recursion for memoized functions

This commit is contained in:
Ilya Chernikov
2020-12-16 19:37:00 +01:00
parent eef06cded3
commit 02c617468f
4 changed files with 70 additions and 13 deletions
@@ -163,7 +163,8 @@ public class StorageManagerTest extends TestCase {
fail();
}
catch (AssertionError e) {
assertTrue(e.getMessage().startsWith("Recursion detected on input: !!!"));
String message = e.getMessage();
assertTrue("Expected message starting with \"Recursion detected\", got: " + message, message.startsWith("Recursion detected on input: !!!"));
}
}
@@ -213,7 +214,7 @@ public class StorageManagerTest extends TestCase {
new C().rec.invoke();
fail();
}
catch (IllegalStateException e) {
catch (AssertionError e) {
// OK
}
}
@@ -232,7 +233,7 @@ public class StorageManagerTest extends TestCase {
new C().rec.invoke();
fail();
}
catch (IllegalStateException e) {
catch (AssertionError e) {
// OK
}
}
@@ -284,7 +285,7 @@ public class StorageManagerTest extends TestCase {
new C().rec.invoke();
fail();
}
catch (IllegalStateException e) {
catch (AssertionError e) {
// OK
}
}