Use `convert-syntax-error` from the `syntax/macro-testing` module:
http://docs.racket-lang.org/syntax/macro-testing.html#(form._((lib._syntax%2Fmacro-testing..rkt)._convert-syntax-error))
Ryan
On 06/30/2017 04:47 PM, Sam Waxman wrote:
Hello,
I'm trying to test whether or not certain
If testing with parenthetical syntax is sufficient, you might want
something like this:
#lang racket
(with-handlers ([exn:fail:syntax? values])
(eval `(module bad racket (define foo (define bar 1)))
(make-base-namespace)))
which returns:
(exn:fail:syntax
"define: not allowed in an
Hello,
I'm trying to test whether or not certain programs result in syntax errors. For
example the program
#lang racket
a
will result in an unbound identifier error, even before runtime (you'll see the
little error message at the bottom because it errored in phase 1).
I know how to catch
3 matches
Mail list logo