[plt-scheme] Unit testing with typed-scheme (test-engine/scheme-tests)

From: Scott McLoughlin (scott at adrenaline.com)
Date: Sun Oct 25 16:18:14 EDT 2009

Kind Schemely PLT Folk,

So I'm finally trying to get all "instrumented" for getting my
typed-scheme project really organized and off the ground and am
having trouble with testing.

;;; Here is the short module that just defines my little typed
;;;   vector enumerate function/constructor.

(module typscm typed-scheme
  (require test-engine/scheme-tests)
  (provide enumerate)

  ;;; enumerate Vectorof constructor, sml style
  (define: (x) (enumerate [size : Integer] [init : (Integer -> x)]) : 
(Vectorof x)
    (build-vector size init))

  ;(print (enumerate 3 (lambda: ([y : Integer]) (make-string y #\c))))

  (check-expect
   (enumerate 3 (lambda: ([y : Integer]) (make-string y #\c)))
   #("" "c" "cc"))
 
    (test)
  )

And here is the error output - *VERY* sorry for the long error message, 
but it
might help someone in the know here on the list help me figure things out.

||typecheck: Error in macro expansion -- Untyped definition : (test5117) 
in: (define-values (test5117) (let-values (((test-info) (#%app 
namespace-variable-value (quote test~object) (quote #f) builder (#%app 
current-namespace)))) (if test-info (begin (#%app insert-test test-info 
(lambda () (#%app check-values-expected (#%app car (#%app list (lambda 
() (#%app enumerate (quote 3) (lambda (y) (#%app make-string y (quote 
#\c))))) (#%app void))) (quote #("" "c" "cc")) (#%app list (quote 
#<path:C:\Documents and Settings\scottmcl\My 
Documents\scottmcl\src\ss\ssutil\typscm.ss>) (quote 15) (quote 2) (quote 
377) (quote 97)) test-info)))) (#%app void))))
 >


Any and all help *most kindly* appreciated regarded automating the 
testing of typed-scheme code.

Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20091025/7fcf596e/attachment.html>

Posted on the users mailing list.