fixed multibyte coverage in submodules
This commit is contained in:
parent
b2ef4dda62
commit
c9be7019fb
|
@ -102,6 +102,7 @@
|
||||||
;; String (Maybe (Listof Symbol)) (-> Natural Natural) Interval-Map -> Void
|
;; String (Maybe (Listof Symbol)) (-> Natural Natural) Interval-Map -> Void
|
||||||
;; make listed submodules irrelevant
|
;; make listed submodules irrelevant
|
||||||
(define (submod-irrelevant! str submods offset cmap)
|
(define (submod-irrelevant! str submods offset cmap)
|
||||||
|
;; stx positions are in terms of bytes
|
||||||
(define stx
|
(define stx
|
||||||
(with-input-from-string str
|
(with-input-from-string str
|
||||||
(thunk (with-module-reading-parameterization read-syntax))))
|
(thunk (with-module-reading-parameterization read-syntax))))
|
||||||
|
@ -118,7 +119,8 @@
|
||||||
(define ?start (syntax-position stx))
|
(define ?start (syntax-position stx))
|
||||||
(when ?start
|
(when ?start
|
||||||
(define start (- ?start (* 2 (offset ?start))))
|
(define start (- ?start (* 2 (offset ?start))))
|
||||||
(define end (+ start (syntax-span stx)))
|
(define end* (+ ?start (syntax-span stx)))
|
||||||
|
(define end (- end* (* 2 (offset end*))))
|
||||||
(interval-map-set! cmap start end 'irrelevant))]
|
(interval-map-set! cmap start end 'irrelevant))]
|
||||||
[(e ...) (for-each loop* (syntax->list #'(e ...)))]
|
[(e ...) (for-each loop* (syntax->list #'(e ...)))]
|
||||||
[_else (void)])))
|
[_else (void)])))
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
(cons a (ranges->numbers (cons (list (add1 a) b) r))))]))
|
(cons a (ranges->numbers (cons (list (add1 a) b) r))))]))
|
||||||
|
|
||||||
(module+ test
|
(module+ test
|
||||||
(define-runtime-path-list test-dirs '("basic" "simple-multi" "syntax" "at-exp"))
|
(define-runtime-path-list test-dirs '("basic" "simple-multi" "syntax" "at-exp" "multibyte-coverage"))
|
||||||
(for-each (compose test-dir path->string) test-dirs)
|
(for-each (compose test-dir path->string) test-dirs)
|
||||||
(define-runtime-path submods "submods")
|
(define-runtime-path submods "submods")
|
||||||
(parameterize ([irrelevant-submodules null])
|
(parameterize ([irrelevant-submodules null])
|
||||||
|
|
27
cover/tests/multibyte-coverage/arrow.rkt
Normal file
27
cover/tests/multibyte-coverage/arrow.rkt
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
#lang racket
|
||||||
|
|
||||||
|
;; Don't forget to require this at the template level! Otherwise, Racket will
|
||||||
|
;; complain that two instances of racket/gui are started.
|
||||||
|
|
||||||
|
(module m-browse-syntax typed/racket
|
||||||
|
(require/typed macro-debugger/syntax-browser
|
||||||
|
[browse-syntax (→ Syntax Any)]
|
||||||
|
[browse-syntaxes (→ (Listof Syntax) Any)])
|
||||||
|
|
||||||
|
(provide browse-syntax
|
||||||
|
browse-syntaxes))
|
||||||
|
|
||||||
|
(define (debug-syntax stx)
|
||||||
|
(syntax-local-lift-expression #`(browse-syntax #'#,stx)))
|
||||||
|
|
||||||
|
(require 'm-browse-syntax)
|
||||||
|
(provide browse-syntax
|
||||||
|
browse-syntaxes
|
||||||
|
debug-syntax)
|
||||||
|
|
||||||
|
;; Avoid problems with raco test on headless machines (GTK tries to open
|
||||||
|
;; display :0 otherwise)
|
||||||
|
(module main racket)
|
||||||
|
(module test racket)
|
||||||
|
|
||||||
|
;; FROM GH ISSUE 116
|
2
cover/tests/multibyte-coverage/arrow.rktl
Normal file
2
cover/tests/multibyte-coverage/arrow.rktl
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
()
|
||||||
|
((400 485))
|
9
cover/tests/multibyte-coverage/submod.rkt
Normal file
9
cover/tests/multibyte-coverage/submod.rkt
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#lang racket
|
||||||
|
;; this is a comment
|
||||||
|
(+ 1 2)
|
||||||
|
(module+ test (λ (x) 3))
|
||||||
|
(λ (x) 3)
|
||||||
|
(module+ test (λ (x) 3))
|
||||||
|
(λ (x) 3)
|
||||||
|
(module+ test (λ (x) 3))
|
||||||
|
(λ (x) 3)
|
2
cover/tests/multibyte-coverage/submod.rktl
Normal file
2
cover/tests/multibyte-coverage/submod.rktl
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
((14 41) (68 74) (76 76) (103 109) (111 111) (138 144) (146 146))
|
||||||
|
()
|
3
info.rkt
3
info.rkt
|
@ -10,4 +10,5 @@
|
||||||
|
|
||||||
(define build-deps
|
(define build-deps
|
||||||
'("racket-doc" "scribble-lib" "typed-racket-doc" "htdp-lib"
|
'("racket-doc" "scribble-lib" "typed-racket-doc" "htdp-lib"
|
||||||
"net-doc" "scribble-doc" "at-exp-lib" "scheme-lib"))
|
"net-doc" "scribble-doc" "at-exp-lib" "scheme-lib" "typed-racket-lib"
|
||||||
|
"macro-debugger"))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user