www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

typed-rackunit.scrbl (4240B)


      1 #lang scribble/manual
      2 @require["utils.rkt"
      3          @for-label[phc-toolkit/typed-rackunit
      4                     racket/base
      5                     racket/list
      6                     (only-in racket compose ...)
      7                     racket/match
      8                     syntax/parse]]
      9 
     10 @(def-orig orig [rackunit]
     11    check-equal?
     12    check-not-equal?
     13    check-true
     14    check-exn
     15    check-not-exn)
     16 
     17 @(def-orig tr [typed/rackunit]
     18    check-equal?
     19    check-not-equal?
     20    check-true
     21    check-exn
     22    check-not-exn)
     23 
     24 @title{Utilities and patches for @racketmodname[typed/rackunit]}
     25 @author{@author+email["Suzanne Soy" "racket@suzanne.soy"]}
     26 
     27 @defmodule[phc-toolkit/typed-rackunit]
     28 
     29 @; TODO: add the message parameter when it is implemented
     30 @defform[#:literals (:)
     31          (check-equal?: actual maybe-type expected)
     32          #:grammar [(actual (ExpressionOf Any))
     33                     (expected (ExpressionOf Any))
     34                     (maybe-type (code:line)
     35                                 (code:line : type))
     36                     (type Type)]]{
     37  Typed macro which behaves like the @orig:check-equal? function. The official
     38  typed version @tr:check-equal? from @racketmodname[typed/rackunit] has some
     39  issues with source location for failed tests, and with higher-order values
     40  (e.g. syntax) passed as @racket[Any]. This alternate implementation fixes these
     41  issues.
     42 
     43  This implementation is compatible with the use of other
     44  functions from @racketmodname[typed/rackunit].
     45 }
     46 
     47 @defform[#:literals (:)
     48          (check-not-equal?: actual maybe-type expected)
     49          #:grammar [(actual (ExpressionOf Any))
     50                     (expected (ExpressionOf Any))
     51                     (maybe-type (code:line)
     52                                 (code:line : type))
     53                     (type Type)]]{
     54  Typed macro which behaves like the @orig:check-not-equal? function. The
     55  official typed version @tr:check-not-equal? from
     56  @racketmodname[typed/rackunit] has some issues with source location for failed
     57  tests, and with higher-order values (e.g. syntax) passed as @racket[Any]. This
     58  alternate implementation fixes these issues.
     59 
     60  This implementation is compatible with the use of other
     61  functions from @racketmodname[typed/rackunit].
     62 }
     63 
     64 @defform[#:literals (:)
     65          (check-true: actual)
     66          #:grammar [(actual (ExpressionOf Any))]]{
     67  Typed macro which behaves like the @orig:check-true function. The official
     68  typed version @tr:check-true from @racketmodname[typed/rackunit] has some
     69  issues with source location for failed tests, and possibly with higher-order
     70  values (e.g. syntax) passed as @racket[Any]. This alternate implementation
     71  fixes these issues.
     72 
     73  This implementation is compatible with the use of other
     74  functions from @racketmodname[typed/rackunit].}
     75 
     76 @defform[#:literals (:)
     77          (check-exn: exn-predicate-or-regexp thunk maybe-message)
     78          #:grammar [(exn-predicate-or-regexp
     79                      (ExpressionOf (U Regexp (→ Any Any))))
     80                     (thunk (→ Any))
     81                     (maybe-message (code:line)
     82                                    (code:line (ExpressionOf String)))]]{
     83  Typed macro which behaves like the @orig:check-exn function. The official
     84  typed version @tr:check-exn from @racketmodname[typed/rackunit] has some
     85  issues with source location for failed tests, and possibly with higher-order
     86  values (e.g. syntax) passed as @racket[Any]. This alternate implementation
     87  fixes these issues.
     88 
     89  This implementation is compatible with the use of other
     90  functions from @racketmodname[typed/rackunit].}
     91 
     92 @defform[#:literals (:)
     93          (check-not-exn: thunk maybe-message)
     94          #:grammar [(thunk (→ Any))
     95                     (maybe-message (code:line)
     96                                    (code:line (ExpressionOf String)))]]{
     97  Typed macro which behaves like the @orig:check-not-exn function. The official
     98  typed version @tr:check-not-exn from @racketmodname[typed/rackunit] has some
     99  issues with source location for failed tests, and possibly with higher-order
    100  values (e.g. syntax) passed as @racket[Any]. This alternate implementation
    101  fixes these issues.
    102 
    103  This implementation is compatible with the use of other
    104  functions from @racketmodname[typed/rackunit].}
    105 
    106 @include-section{typed-rackunit-untyped.scrbl}