Improved test coverage, require racket/base for-syntax.

This commit is contained in:
Georges Dupéron 2016-06-17 18:21:58 +02:00
parent 31f02fcd0b
commit f2b9a03ee4
3 changed files with 38 additions and 1 deletions

View File

@ -45,9 +45,26 @@ And so does @racket[(require (submod ".." …))]:
(require (submod ".."))
(require (submod ".." ms2))]
Test with multiple subforms inside require, and coverage for
@racket[for-syntax]:
@chunk[<req-multi>
(require (for-syntax syntax/stx
racket/syntax)
racket/bool)]
@chunk[<*>
(begin (require (for-syntax racket/base)))
(require typed/rackunit)
<submod>
<req-multi>
<submod*>
(check-true (false? #f));; Should be hyperlinked to the main docs
(begin-for-syntax
(define/with-syntax ;; Should be hyperlinked to the main docs
x
(stx-car ;; Should be hyperlinked to the main docs
#'(a . b))))
(check-equal? (+ x x) 2)
(check-equal? (+ x y) 0)
;; Gives an error because typed/racket/base is used on the #lang line:

21
test/test2.hl.rkt Normal file
View File

@ -0,0 +1,21 @@
#lang hyper-literate/typed typed/racket/base
@(require (for-label typed/racket/base
typed/rackunit))
@title{Title}
Hello world.
@chunk[<*>
(require typed/rackunit)
;; Would give an error as typed/racket/base is used on the #lang line:
;curry
(check-equal? ((make-predicate One) 1) #t)
(define (f [x : 'e123]) x)
(define ee (ann (f 'e123) 'e123))
(provide ee)]

View File

@ -137,7 +137,6 @@
;; to allow othe meta-languages to be chained.
(define lang-sym
(string->symbol (regexp-replace "^ " (syntax-e #'lang) "")))
(dynamic-require lang-sym #f)
(let ([expanded
(expand `(,#'module scribble-lp-tmp-name hyper-literate/typed/private/lp
(define-syntax-rule (if-preexpanding a b) a)