Improved test example.

This commit is contained in:
Georges Dupéron 2016-06-17 19:58:46 +02:00
parent 456d2557c8
commit 3121eaec9d

View File

@ -5,6 +5,8 @@
@title{Title} @title{Title}
@section{if-preexpanding}
Hello world. Hello world.
@(if-preexpanding @(if-preexpanding
@ -14,6 +16,8 @@ Hello world.
@(unless-preexpanding @(unless-preexpanding
(symbol->string ee)) (symbol->string ee))
@section{Submodules}
Submodules work: Submodules work:
@chunk[<submod> @chunk[<submod>
@ -54,6 +58,8 @@ Test with multiple subforms inside require, and coverage for
racket/syntax) racket/syntax)
racket/bool)] racket/bool)]
@section{Avoiding for-label}
Wrap the @racket[(require (for-syntax racket/base))] in a Wrap the @racket[(require (for-syntax racket/base))] in a
@racket[(begin )] so that it gets ignored, otherwise @racket[(begin )] so that it gets ignored, otherwise
scribble complains some identifiers are loaded twice scribble complains some identifiers are loaded twice
@ -64,6 +70,13 @@ at meta-level 0 by @racketmodname[typed/racket].
(begin (require (for-syntax racket/base)) (begin (require (for-syntax racket/base))
(require typed/rackunit))] (require typed/rackunit))]
@CHUNK[<with-unsyntax>
(let* ([b 1234]
[e (syntax-e #`#,b)])
(check-equal? e 1234))]
@section{Main chunk}
@chunk[<*> @chunk[<*>
<require-not-label> <require-not-label>
<submod> <submod>
@ -77,6 +90,7 @@ at meta-level 0 by @racketmodname[typed/racket].
#'(a . b)))) #'(a . b))))
(check-equal? (+ x x) 2) (check-equal? (+ x x) 2)
(check-equal? (+ x y) 0) (check-equal? (+ x y) 0)
<with-unsyntax>
;; 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:
;curry ;curry
(check-equal? ((make-predicate One) 1) #t) (check-equal? ((make-predicate One) 1) #t)