Improved test coverage, require racket/base for-syntax.
This commit is contained in:
parent
31f02fcd0b
commit
f2b9a03ee4
|
@ -45,9 +45,26 @@ And so does @racket[(require (submod ".." …))]:
|
||||||
(require (submod ".."))
|
(require (submod ".."))
|
||||||
(require (submod ".." ms2))]
|
(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[<*>
|
@chunk[<*>
|
||||||
|
(begin (require (for-syntax racket/base)))
|
||||||
(require typed/rackunit)
|
(require typed/rackunit)
|
||||||
<submod>
|
<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 x) 2)
|
||||||
(check-equal? (+ x y) 0)
|
(check-equal? (+ x y) 0)
|
||||||
;; Gives an error because typed/racket/base is used on the #lang line:
|
;; Gives an error because typed/racket/base is used on the #lang line:
|
||||||
|
|
21
test/test2.hl.rkt
Normal file
21
test/test2.hl.rkt
Normal 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)]
|
|
@ -137,7 +137,6 @@
|
||||||
;; to allow othe meta-languages to be chained.
|
;; to allow othe meta-languages to be chained.
|
||||||
(define lang-sym
|
(define lang-sym
|
||||||
(string->symbol (regexp-replace "^ " (syntax-e #'lang) "")))
|
(string->symbol (regexp-replace "^ " (syntax-e #'lang) "")))
|
||||||
(dynamic-require lang-sym #f)
|
|
||||||
(let ([expanded
|
(let ([expanded
|
||||||
(expand `(,#'module scribble-lp-tmp-name hyper-literate/typed/private/lp
|
(expand `(,#'module scribble-lp-tmp-name hyper-literate/typed/private/lp
|
||||||
(define-syntax-rule (if-preexpanding a b) a)
|
(define-syntax-rule (if-preexpanding a b) a)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user