diff options
| -rw-r--r-- | tests/common.scm | 14 | ||||
| -rw-r--r-- | tests/dist.scm | 12 |
2 files changed, 18 insertions, 8 deletions
diff --git a/tests/common.scm b/tests/common.scm index 30b0c68..9a476aa 100644 --- a/tests/common.scm +++ b/tests/common.scm @@ -41,6 +41,7 @@ ;; Procedures get-unused-port test-assert-with-log + test-error-with-log start-session-loop make-session-for-test make-server-for-test @@ -88,6 +89,19 @@ (set-log-userdata! name) body ...))))) +(define-syntax test-error-with-log + (syntax-rules () + ((_ name error body ...) + (test-assert-with-log name + (catch error + (lambda () body ... #f) + (const #t)))) + ((_ name body ...) + (test-assert-with-log name + (catch #t + (lambda () body ... #f) + (const #t)))))) + (define (start-session-loop session body) (let session-loop ((msg (server-message-get session))) (when (and msg (not (eof-object? msg))) diff --git a/tests/dist.scm b/tests/dist.scm index 7524a94..ed17d74 100644 --- a/tests/dist.scm +++ b/tests/dist.scm @@ -154,14 +154,10 @@ (rrepl-skip-to-prompt port))) #t)) -(test-assert "rrepl-skip-to-prompt, invalid input" - (catch 'node-error - (lambda () - (call-with-input-string "invalid input" - (lambda (port) - (rrepl-skip-to-prompt port))) - #f) - (const #t))) +(test-error-with-log "rrepl-skip-to-prompt, invalid input 2" 'node-error + (call-with-input-string "invalid input" + (lambda (port) + (rrepl-skip-to-prompt port)))) ;;; Distributed forms. |
