+ fun verifyRedirect(target: String, assertions: () -> Unit) {
+ try {
+ page.handleRequest(freenetRequest, templateContext)
+ fail()
+ } catch (re: RedirectException) {
+ if (re.target != target) {
+ throw re
+ }
+ assertions()
+ } catch (e: Exception) {
+ throw e
+ }
+ }
+