florence / cover

a code coverage tool for racket
MIT License
38 stars 7 forks source link

require and use for-syntax function crashes raco cover #89

Closed SuzanneSoy closed 9 years ago

SuzanneSoy commented 9 years ago

When require and use a function for-syntax, its body is not marked as covered in DrRacket, and it crashes the raco cover tool.

#lang racket

(module m racket
  (provide bar)
  (define (bar)
    (+ 1 1))) ;; (+ 1 1) is not marked as covered in DrRacket and crashes raco cover

(module main racket
  (require (for-syntax (submod ".." m)))
  (define-syntax (foo stx) #`#,(bar))
  (foo)) ;; Although this prints 2.

Running raco cover file.rkt produces this error message

generating test coverage for ("/tmp/file.rkt")
hash-ref: no value found for key
  key: '("/tmp/file.rkt" #f #f 34 13)
  context...:
   (submod file m): [running body]
   /home/georges/.racket/snapshot/pkgs/cover/cover.rkt:171:4: cover-compile
florence commented 9 years ago

Ahah, The version of cover that fixes this has not been pushed to the PKG server get (its still a tad unstable).

If you install cover directly from the github master branch then this error should disappear---or you can wait a week or two for this to make it to covers release branch.