Adds start term to test-->>E failure message

Closes PR 11867
This commit is contained in:
Casey Klein 2011-04-22 09:48:47 -05:00
parent 73c5d2a546
commit 50f14dea18
2 changed files with 8 additions and 6 deletions

View File

@ -2253,11 +2253,13 @@
(print-failed srcinfo)
(inc-failures)
(begin
(fprintf (current-error-port) "no reachable term ~a ~a"
(if (procedure? goal) "satisfying" "equal to")
goal)
(if (procedure? goal)
(fprintf (current-error-port)
"no term satisfying ~a reachable from ~a" goal start)
(fprintf (current-error-port)
"term ~a not reachable from ~a" goal start))
(when (search-failure-cutoff? result)
(fprintf (current-error-port) " (but some terms were not explored)"))
(fprintf (current-error-port) " (within ~a steps)" steps))
(newline (current-error-port))))))
(define-syntax (test-predicate stx)

View File

@ -2459,7 +2459,7 @@
(define (equal-to-7 x) (= x 7))
(test (capture-output (test-->>∃ #:steps 5 1+ 0 equal-to-7))
#rx"^FAILED .*\nno reachable term satisfying #<procedure:equal-to-7> \\(but some terms were not explored\\)\n$")
#rx"^FAILED .*\nno term satisfying #<procedure:equal-to-7> reachable from 0 \\(within 5 steps\\)\n$")
(test (capture-output (test-->>∃ 1+ 0 7)) "")
(test (capture-output (test-->>E 1+ 0 7)) "")
@ -2472,7 +2472,7 @@
(--> any any)))
(test (capture-output (test-->>∃ identity 0 1))
#rx"^FAILED .*\nno reachable term equal to 1\n$")
#rx"^FAILED .*\nterm 1 not reachable from 0\n$")
(test (capture-output (test-results)) "2 tests failed (out of 6 total).\n")