guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Need help with catching reader error


From: Mike Gran
Subject: Need help with catching reader error
Date: Wed, 22 Apr 2009 07:32:47 -0700

Hi-

Here's a puzzle for you.

I want to write a test for the test suite to catch a lexical syntax
error, like the following non-existent named character.  But I need to
somehow introduce another layer of evaluation.  In the following, Guile
would tell me that my test script has an error and then quit, instead of
catching the error and moving on.

(use-modules (test-suite lib))

(define exception:read-error
  (cons 'read-error "^.*"))

(with-test-prefix "basic char handling"
 (pass-if-exception "non-existent named character" 
                    exception:read-error
                    #\foobar))

Thanks,

Mike Gran





reply via email to

[Prev in Thread] Current Thread [Next in Thread]