florence / cover

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

Code incorrectly marked as not covered with scribble/lp2 chunks #91

Closed SuzanneSoy closed 9 years ago

SuzanneSoy commented 9 years ago
#lang scribble/lp2

@chunk[<bar>
       (displayln "THIS IS RED")]

@chunk[<*>
       (module main racket
         (displayln "THIS IS BLACK")
         <bar>)]

Here's a more complete example, with for-syntax, that shows on the terminal THIS IS RED, so we're sure it was run.

#lang scribble/lp2

@chunk[<bar>
       (define (bar)
         (displayln "THIS IS RED"))]

@chunk[<*>
       (begin
         (module mbar racket
           (provide bar)
           <bar>)

         (module main racket
           (require (for-syntax racket))
           (require (for-syntax (submod ".." mbar)))

           (define-syntax (foo stx)
             (bar)
             #'(values))

           (foo)))]
florence commented 9 years ago

This is occurring in DrRacket as well. I suspect this is due to scribble/lp2 not properly propagating srclocs. I will investigate.

florence commented 9 years ago

This is a bug in scribble/lp and scribble/lp2.

The lifting operation in https://github.com/racket/scribble/blob/master/scribble-lib/scribble/private/lp.rkt#L30 would cause the srclocs there to be unavailable to Cover, as its annotator does not dive into quote-syntaxes. I don't know of a good fix, as I don't completely understand whats going on in that file.

florence commented 9 years ago

I'm going to close this. I've opened an issue for this at https://github.com/racket/scribble/issues/16