(use test) (use error-utils) (test-group "errorf & errorf/no-raise" (test "\nError: msg\n" (call-with-output-string (lambda (port) (errorf/no-raise "msg" port)))) (test-error (errorf "msg")) (test "\nError: loc\n" (call-with-output-string (lambda (port) (errorf/no-raise 'loc port)))) (test-error (errorf 'loc)) (test "\nError: (loc) msg\n" (call-with-output-string (lambda (port) (errorf/no-raise 'loc "msg" port)))) (test-error (errorf 'loc "msg")) (test "\nError: msg hello \"hello\"\n" (call-with-output-string (lambda (port) (errorf/no-raise "msg ~A ~S" "hello" "hello" port)))) (test-error (errorf "msg ~A ~S" "hello" "hello")) (test "\nError: (loc) msg hello \"hello\"\n" (call-with-output-string (lambda (port) (errorf/no-raise 'loc "msg ~A ~S" "hello" "hello" port)))) (test-error (errorf 'loc "msg ~A ~S" "hello" "hello")) ) (test-group "error/no-raise" (test "\nError: (loc) msg\narg\n1\n" (call-with-output-string (lambda (port) (error/no-raise 'loc "msg" 'arg 1 port)))) (test-error (error 'loc "msg" 'arg 1)) ) (test-exit)