[racket] rackunit errors when trying to test string-math-eval

From: Andrews, Kyle (KC) (KCAndrews at dow.com)
Date: Tue Aug 20 17:15:40 EDT 2013


I'm trying to create unit tests for some code that parses simple infix mathematical expressions in strings.  Despite my informal testing in the REPL showing my function 'string-math-eval' works for what I'm trying to use it for, when I try making tests using check-true or check-equal? from rackunit in a sub-module I get the error:

  +: unbound identifier;
   also, no #%app syntax transformer is bound in: +

; an example of a test which gives the error
(module+ test
  (check-true (= (string-eval-math "1+1") 2)))

I've attached my code to this message.  What is causing this to work in the main module but not in the sub-module, and in general how would I go about fixing problems like this in the future?


Kyle Andrews
-------------- next part --------------
A non-text attachment was scrubbed...
Name: string.rkt
Type: application/octet-stream
Size: 4295 bytes
Desc: string.rkt
URL: <http://lists.racket-lang.org/users/archive/attachments/20130820/b113e326/attachment.obj>

Posted on the users mailing list.