"Racunit" -> "Rackunit"
original commit: 7b14a1f585d368bca8967072fbf3530d568e1391
This commit is contained in:
parent
a25df897ed
commit
dbf0a806a2
|
@ -6,7 +6,7 @@
|
||||||
(define (test/gui . tests)
|
(define (test/gui . tests)
|
||||||
(apply (make-gui-runner) tests))
|
(apply (make-gui-runner) tests))
|
||||||
|
|
||||||
(define test/c (or/c racunit-test-case? racunit-test-suite?))
|
(define test/c (or/c rackunit-test-case? rackunit-test-suite?))
|
||||||
|
|
||||||
(provide/contract
|
(provide/contract
|
||||||
[test/gui
|
[test/gui
|
|
@ -4,10 +4,10 @@
|
||||||
|
|
||||||
;; struct test :
|
;; struct test :
|
||||||
(define-struct test ())
|
(define-struct test ())
|
||||||
;; struct (racunit-test-case test) : (U string #f) thunk
|
;; struct (rackunit-test-case test) : (U string #f) thunk
|
||||||
(define-struct (racunit-test-case test) (name action) #:transparent)
|
(define-struct (rackunit-test-case test) (name action) #:transparent)
|
||||||
;; struct (racunit-test-suite test) : string (fdown fup fhere seed -> (listof test-result)) thunk thunk
|
;; struct (rackunit-test-suite test) : string (fdown fup fhere seed -> (listof test-result)) thunk thunk
|
||||||
(define-struct (racunit-test-suite test) (name tests before after) #:transparent)
|
(define-struct (rackunit-test-suite test) (name tests before after) #:transparent)
|
||||||
|
|
||||||
;; struct exn:test exn : ()
|
;; struct exn:test exn : ()
|
||||||
;;
|
;;
|
||||||
|
@ -33,10 +33,10 @@
|
||||||
(define-struct (test-success test-result) (result))
|
(define-struct (test-success test-result) (result))
|
||||||
|
|
||||||
(provide/contract
|
(provide/contract
|
||||||
(struct (racunit-test-case test)
|
(struct (rackunit-test-case test)
|
||||||
((name (or/c string? false/c))
|
((name (or/c string? false/c))
|
||||||
(action (-> any))))
|
(action (-> any))))
|
||||||
(struct (racunit-test-suite test)
|
(struct (rackunit-test-suite test)
|
||||||
((name string?)
|
((name string?)
|
||||||
(tests procedure?)
|
(tests procedure?)
|
||||||
(before (-> any))
|
(before (-> any))
|
|
@ -11,7 +11,7 @@
|
||||||
;; Infrastructure ----------------------------------------------
|
;; Infrastructure ----------------------------------------------
|
||||||
|
|
||||||
;; The continuation mark under which all check-info is keyed
|
;; The continuation mark under which all check-info is keyed
|
||||||
(define check-info-mark (gensym 'racunit))
|
(define check-info-mark (gensym 'rackunit))
|
||||||
|
|
||||||
;; (continuation-mark-set -> (listof check-info))
|
;; (continuation-mark-set -> (listof check-info))
|
||||||
(define (check-info-stack marks)
|
(define (check-info-stack marks)
|
|
@ -5,10 +5,10 @@
|
||||||
|
|
||||||
;; Frame size preferences
|
;; Frame size preferences
|
||||||
|
|
||||||
(preferences:set-default 'racunit:frame:width 400 exact-positive-integer?)
|
(preferences:set-default 'rackunit:frame:width 400 exact-positive-integer?)
|
||||||
(preferences:set-default 'racunit:frame:height 400 exact-positive-integer?)
|
(preferences:set-default 'rackunit:frame:height 400 exact-positive-integer?)
|
||||||
(define pref:width (pref:get/set 'racunit:frame:width))
|
(define pref:width (pref:get/set 'rackunit:frame:width))
|
||||||
(define pref:height (pref:get/set 'racunit:frame:height))
|
(define pref:height (pref:get/set 'rackunit:frame:height))
|
||||||
|
|
||||||
;; CONSTANTS
|
;; CONSTANTS
|
||||||
;; Some of these are obsolete, given the preferences above.
|
;; Some of these are obsolete, given the preferences above.
|
|
@ -25,18 +25,18 @@
|
||||||
;; create-model : test suite<%>/#f -> result<%>
|
;; create-model : test suite<%>/#f -> result<%>
|
||||||
(define/public (create-model test parent)
|
(define/public (create-model test parent)
|
||||||
(define result
|
(define result
|
||||||
(cond [(racunit-test-case? test)
|
(cond [(rackunit-test-case? test)
|
||||||
(new case-result%
|
(new case-result%
|
||||||
(controller this)
|
(controller this)
|
||||||
(test test)
|
(test test)
|
||||||
(name (or (racunit-test-case-name test)
|
(name (or (rackunit-test-case-name test)
|
||||||
"<unnamed test-case>"))
|
"<unnamed test-case>"))
|
||||||
(parent parent))]
|
(parent parent))]
|
||||||
[(racunit-test-suite? test)
|
[(rackunit-test-suite? test)
|
||||||
(new suite-result%
|
(new suite-result%
|
||||||
(controller this)
|
(controller this)
|
||||||
(test test)
|
(test test)
|
||||||
(name (or (racunit-test-suite-name test)
|
(name (or (rackunit-test-suite-name test)
|
||||||
"<unnamed test-suite>"))
|
"<unnamed test-suite>"))
|
||||||
(parent parent))]))
|
(parent parent))]))
|
||||||
(send/i view view<%> create-view-link result parent)
|
(send/i view view<%> create-view-link result parent)
|
|
@ -48,8 +48,8 @@
|
||||||
#|
|
#|
|
||||||
(define/public (run)
|
(define/public (run)
|
||||||
(let ([custodian (make-custodian)]
|
(let ([custodian (make-custodian)]
|
||||||
[before (racunit-test-suite-before test)]
|
[before (rackunit-test-suite-before test)]
|
||||||
[after (racunit-test-suite-after test)])
|
[after (rackunit-test-suite-after test)])
|
||||||
(parameterize [(current-custodian custodian)]
|
(parameterize [(current-custodian custodian)]
|
||||||
(dynamic-wind
|
(dynamic-wind
|
||||||
before
|
before
|
||||||
|
@ -112,8 +112,8 @@
|
||||||
(call-with-continuation-prompt
|
(call-with-continuation-prompt
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(time-apply run-test-case
|
(time-apply run-test-case
|
||||||
(list (racunit-test-case-name test)
|
(list (rackunit-test-case-name test)
|
||||||
(racunit-test-case-action test)))))])
|
(rackunit-test-case-action test)))))])
|
||||||
(values (car results) (list cputime realtime gctime))))
|
(values (car results) (list cputime realtime gctime))))
|
||||||
|
|
||||||
(define (make-output-ports)
|
(define (make-output-ports)
|
Before Width: | Height: | Size: 513 B After Width: | Height: | Size: 513 B |
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
(provide insert-text
|
(provide insert-text
|
||||||
ext:text%
|
ext:text%
|
||||||
racunit-style-map)
|
rackunit-style-map)
|
||||||
|
|
||||||
;; insert-text : text% string style-delta% -> void
|
;; insert-text : text% string style-delta% -> void
|
||||||
(define (insert-text e text style)
|
(define (insert-text e text style)
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
(define ext:text-mixin
|
(define ext:text-mixin
|
||||||
(mixin (text<%>) ()
|
(mixin (text<%>) ()
|
||||||
(init-field (style-map racunit-style-map))
|
(init-field (style-map rackunit-style-map))
|
||||||
(inherit last-position
|
(inherit last-position
|
||||||
change-style
|
change-style
|
||||||
set-clickback
|
set-clickback
|
||||||
|
@ -139,7 +139,7 @@
|
||||||
[error . ,style:red]
|
[error . ,style:red]
|
||||||
[value . ,style:darkblue]))
|
[value . ,style:darkblue]))
|
||||||
|
|
||||||
(define racunit-styles
|
(define rackunit-styles
|
||||||
`([test-unexecuted . ,style:gray]
|
`([test-unexecuted . ,style:gray]
|
||||||
[test-success . ,style:green]
|
[test-success . ,style:green]
|
||||||
[test-failure . ,style:red]
|
[test-failure . ,style:red]
|
||||||
|
@ -181,7 +181,7 @@
|
||||||
(extend-style-map empty-style-map
|
(extend-style-map empty-style-map
|
||||||
basic-styles))
|
basic-styles))
|
||||||
|
|
||||||
;; racunit-style-map : style-map<%>
|
;; rackunit-style-map : style-map<%>
|
||||||
(define racunit-style-map
|
(define rackunit-style-map
|
||||||
(extend-style-map basic-style-map
|
(extend-style-map basic-style-map
|
||||||
racunit-styles))
|
rackunit-styles))
|
|
@ -13,7 +13,7 @@
|
||||||
(provide make-view-frame
|
(provide make-view-frame
|
||||||
view%)
|
view%)
|
||||||
|
|
||||||
(define style-map racunit-style-map)
|
(define style-map rackunit-style-map)
|
||||||
|
|
||||||
#|
|
#|
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ still be there, just not visible?
|
||||||
controller)
|
controller)
|
||||||
(super-new)
|
(super-new)
|
||||||
|
|
||||||
(define editor (new ext:text% (style-map racunit-style-map)))
|
(define editor (new ext:text% (style-map rackunit-style-map)))
|
||||||
(define renderer
|
(define renderer
|
||||||
(new model-renderer%
|
(new model-renderer%
|
||||||
(controller controller)
|
(controller controller)
|
||||||
|
@ -146,7 +146,7 @@ still be there, just not visible?
|
||||||
;; If the view-link has not been created,
|
;; If the view-link has not been created,
|
||||||
;; yield until it is.
|
;; yield until it is.
|
||||||
(unless (yield)
|
(unless (yield)
|
||||||
(error 'racunit-gui
|
(error 'rackunit-gui
|
||||||
"internal error: no progress waiting for view-link"))
|
"internal error: no progress waiting for view-link"))
|
||||||
(do-model-update model)])))
|
(do-model-update model)])))
|
||||||
|
|
|
@ -51,12 +51,12 @@
|
||||||
;; data so FP is a bit ugly].
|
;; data so FP is a bit ugly].
|
||||||
(define (foldts fdown fup fhere seed test)
|
(define (foldts fdown fup fhere seed test)
|
||||||
(cond
|
(cond
|
||||||
((racunit-test-case? test)
|
((rackunit-test-case? test)
|
||||||
(fhere test
|
(fhere test
|
||||||
(racunit-test-case-name test)
|
(rackunit-test-case-name test)
|
||||||
(racunit-test-case-action test)
|
(rackunit-test-case-action test)
|
||||||
seed))
|
seed))
|
||||||
((racunit-test-suite? test)
|
((rackunit-test-suite? test)
|
||||||
(apply-test-suite test fdown fup fhere seed))
|
(apply-test-suite test fdown fup fhere seed))
|
||||||
(else
|
(else
|
||||||
(raise
|
(raise
|
|
@ -27,14 +27,14 @@
|
||||||
(define (test-suite-test-case-around fhere)
|
(define (test-suite-test-case-around fhere)
|
||||||
(lambda (thunk)
|
(lambda (thunk)
|
||||||
(let* ([name (current-test-name)]
|
(let* ([name (current-test-name)]
|
||||||
[test (make-racunit-test-case name thunk)]
|
[test (make-rackunit-test-case name thunk)]
|
||||||
[seed (current-seed)])
|
[seed (current-seed)])
|
||||||
(current-seed (fhere test name thunk seed)))))
|
(current-seed (fhere test name thunk seed)))))
|
||||||
|
|
||||||
(define (test-suite-check-around fhere)
|
(define (test-suite-check-around fhere)
|
||||||
(lambda (thunk)
|
(lambda (thunk)
|
||||||
(let* ([name #f]
|
(let* ([name #f]
|
||||||
[test (make-racunit-test-case name thunk)]
|
[test (make-rackunit-test-case name thunk)]
|
||||||
[seed (current-seed)])
|
[seed (current-seed)])
|
||||||
(current-seed (fhere test name thunk seed)))))
|
(current-seed (fhere test name thunk seed)))))
|
||||||
|
|
||||||
|
@ -42,12 +42,12 @@
|
||||||
(define delayed-test-case-around
|
(define delayed-test-case-around
|
||||||
(lambda (thunk)
|
(lambda (thunk)
|
||||||
(let ([name (current-test-name)])
|
(let ([name (current-test-name)])
|
||||||
(make-racunit-test-case name thunk))))
|
(make-rackunit-test-case name thunk))))
|
||||||
|
|
||||||
(define delayed-check-around
|
(define delayed-check-around
|
||||||
(lambda (thunk)
|
(lambda (thunk)
|
||||||
(let ([name #f])
|
(let ([name #f])
|
||||||
(make-racunit-test-case name thunk))))
|
(make-rackunit-test-case name thunk))))
|
||||||
|
|
||||||
(define-syntax delay-test
|
(define-syntax delay-test
|
||||||
(syntax-rules ()
|
(syntax-rules ()
|
||||||
|
@ -58,12 +58,12 @@
|
||||||
test test1 ...)]))
|
test test1 ...)]))
|
||||||
|
|
||||||
(define (apply-test-suite suite fdown fup fhere seed)
|
(define (apply-test-suite suite fdown fup fhere seed)
|
||||||
(let* ([name (racunit-test-suite-name suite)]
|
(let* ([name (rackunit-test-suite-name suite)]
|
||||||
[tests (racunit-test-suite-tests suite)]
|
[tests (rackunit-test-suite-tests suite)]
|
||||||
[before (racunit-test-suite-before suite)]
|
[before (rackunit-test-suite-before suite)]
|
||||||
[after (racunit-test-suite-after suite)]
|
[after (rackunit-test-suite-after suite)]
|
||||||
[kid-seed (fdown suite name before after seed)]
|
[kid-seed (fdown suite name before after seed)]
|
||||||
[kid-seed ((racunit-test-suite-tests suite) fdown fup fhere kid-seed)])
|
[kid-seed ((rackunit-test-suite-tests suite) fdown fup fhere kid-seed)])
|
||||||
(fup suite name before after seed kid-seed)))
|
(fup suite name before after seed kid-seed)))
|
||||||
|
|
||||||
;; test-suite : name [#:before thunk] [#:after thunk] test ...
|
;; test-suite : name [#:before thunk] [#:after thunk] test ...
|
||||||
|
@ -84,7 +84,7 @@
|
||||||
[the-tests
|
[the-tests
|
||||||
(lambda (fdown fup fhere seed)
|
(lambda (fdown fup fhere seed)
|
||||||
(define (run/inner x)
|
(define (run/inner x)
|
||||||
(cond [(racunit-test-suite? x)
|
(cond [(rackunit-test-suite? x)
|
||||||
(current-seed
|
(current-seed
|
||||||
(apply-test-suite x fdown fup fhere (current-seed)))]
|
(apply-test-suite x fdown fup fhere (current-seed)))]
|
||||||
[(list? x)
|
[(list? x)
|
||||||
|
@ -103,7 +103,7 @@
|
||||||
[(not (string? the-name))
|
[(not (string? the-name))
|
||||||
(raise-type-error 'test-suite "test-suite name as string" the-name)]
|
(raise-type-error 'test-suite "test-suite name as string" the-name)]
|
||||||
[else
|
[else
|
||||||
(make-racunit-test-suite
|
(make-rackunit-test-suite
|
||||||
the-name
|
the-name
|
||||||
the-tests
|
the-tests
|
||||||
before-thunk
|
before-thunk
|
||||||
|
@ -138,13 +138,13 @@
|
||||||
(for-each
|
(for-each
|
||||||
(lambda (t)
|
(lambda (t)
|
||||||
(cond
|
(cond
|
||||||
[(racunit-test-suite? t)
|
[(rackunit-test-suite? t)
|
||||||
(current-seed (apply-test-suite t fdown fup fhere (current-seed)))]
|
(current-seed (apply-test-suite t fdown fup fhere (current-seed)))]
|
||||||
[(racunit-test-case? t)
|
[(rackunit-test-case? t)
|
||||||
(current-seed
|
(current-seed
|
||||||
(fhere t
|
(fhere t
|
||||||
(racunit-test-case-name t)
|
(rackunit-test-case-name t)
|
||||||
(racunit-test-case-action t)
|
(rackunit-test-case-action t)
|
||||||
(current-seed)))]
|
(current-seed)))]
|
||||||
[else
|
[else
|
||||||
(raise
|
(raise
|
||||||
|
@ -158,10 +158,10 @@
|
||||||
;;
|
;;
|
||||||
;; Construct a test suite from a list of tests
|
;; Construct a test suite from a list of tests
|
||||||
(define (make-test-suite name #:before [before void-thunk] #:after [after void-thunk] tests)
|
(define (make-test-suite name #:before [before void-thunk] #:after [after void-thunk] tests)
|
||||||
(make-racunit-test-suite name
|
(make-rackunit-test-suite name
|
||||||
(tests->test-suite-action tests)
|
(tests->test-suite-action tests)
|
||||||
before
|
before
|
||||||
after))
|
after))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Shortcut helpers
|
;; Shortcut helpers
|
|
@ -16,8 +16,8 @@
|
||||||
(struct-out test-failure)
|
(struct-out test-failure)
|
||||||
(struct-out test-error)
|
(struct-out test-error)
|
||||||
(struct-out test-success)
|
(struct-out test-success)
|
||||||
(struct-out racunit-test-case)
|
(struct-out rackunit-test-case)
|
||||||
(struct-out racunit-test-suite)
|
(struct-out rackunit-test-suite)
|
||||||
|
|
||||||
with-check-info
|
with-check-info
|
||||||
with-check-info*
|
with-check-info*
|
||||||
|
@ -43,9 +43,9 @@
|
||||||
test-suite
|
test-suite
|
||||||
make-test-suite
|
make-test-suite
|
||||||
delay-test
|
delay-test
|
||||||
(rename-out [make-racunit-test-case make-test-case]
|
(rename-out [make-rackunit-test-case make-test-case]
|
||||||
[racunit-test-case? test-case?]
|
[rackunit-test-case? test-case?]
|
||||||
[racunit-test-suite? test-suite?])
|
[rackunit-test-suite? test-suite?])
|
||||||
current-test-name
|
current-test-name
|
||||||
current-test-case-around
|
current-test-case-around
|
||||||
test-suite-test-case-around
|
test-suite-test-case-around
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
@title[#:tag "api"]{RacUnit API}
|
@title[#:tag "api"]{RacUnit API}
|
||||||
|
|
||||||
@defmodule[racunit
|
@defmodule[rackunit
|
||||||
#:use-sources (racunit)]
|
#:use-sources (rackunit)]
|
||||||
|
|
||||||
@include-section["overview.scrbl"]
|
@include-section["overview.scrbl"]
|
||||||
@include-section["check.scrbl"]
|
@include-section["check.scrbl"]
|
|
@ -6,15 +6,15 @@
|
||||||
|
|
||||||
(for-label scheme/base
|
(for-label scheme/base
|
||||||
scheme/contract
|
scheme/contract
|
||||||
racunit
|
rackunit
|
||||||
racunit/text-ui
|
rackunit/text-ui
|
||||||
racunit/gui))
|
rackunit/gui))
|
||||||
|
|
||||||
(provide
|
(provide
|
||||||
(all-from-out scribble/eval
|
(all-from-out scribble/eval
|
||||||
scribble/manual)
|
scribble/manual)
|
||||||
(for-label (all-from-out scheme/base
|
(for-label (all-from-out scheme/base
|
||||||
scheme/contract
|
scheme/contract
|
||||||
racunit
|
rackunit
|
||||||
racunit/text-ui
|
rackunit/text-ui
|
||||||
racunit/gui)))
|
rackunit/gui)))
|
|
@ -1,6 +1,6 @@
|
||||||
#lang scheme/base
|
#lang scheme/base
|
||||||
|
|
||||||
(require racunit
|
(require rackunit
|
||||||
"file.rkt")
|
"file.rkt")
|
||||||
|
|
||||||
(check-equal? (my-+ 1 1) 2)
|
(check-equal? (my-+ 1 1) 2)
|
|
@ -17,5 +17,5 @@ especially when mixed with compiled code. Use at your own risk!
|
||||||
This example gets @racket[make-failure-test], which is defined in a RacUnit test:
|
This example gets @racket[make-failure-test], which is defined in a RacUnit test:
|
||||||
|
|
||||||
@racketblock[
|
@racketblock[
|
||||||
(require/expose racunit/private/check-test (make-failure-test))
|
(require/expose rackunit/private/check-test (make-failure-test))
|
||||||
]
|
]
|
|
@ -32,7 +32,7 @@ RacUnit and @tt{file.rkt}:
|
||||||
@racketmod[
|
@racketmod[
|
||||||
racket/base
|
racket/base
|
||||||
|
|
||||||
(require racunit
|
(require rackunit
|
||||||
"file.rkt")
|
"file.rkt")
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ Evalute this and you should see an error message like:
|
||||||
A test
|
A test
|
||||||
... has a FAILURE
|
... has a FAILURE
|
||||||
name: check-pred
|
name: check-pred
|
||||||
location: (#<path:/Users/noel/programming/schematics/racunit/branches/v3/doc/file-test.rkt> 14 6 252 22)
|
location: (#<path:/Users/noel/programming/schematics/rackunit/branches/v3/doc/file-test.rkt> 14 6 252 22)
|
||||||
expression: (check-pred even? elt)
|
expression: (check-pred even? elt)
|
||||||
params: (#<procedure:even?> 9)
|
params: (#<procedure:even?> 9)
|
||||||
--------------------
|
--------------------
|
||||||
|
@ -153,7 +153,7 @@ will do for our example). In @tt{file-test.rkt} add the
|
||||||
following lines:
|
following lines:
|
||||||
|
|
||||||
@racketblock[
|
@racketblock[
|
||||||
(require racunit/text-ui)
|
(require rackunit/text-ui)
|
||||||
|
|
||||||
(run-tests file-tests)
|
(run-tests file-tests)
|
||||||
]
|
]
|
|
@ -7,9 +7,9 @@ RacUnit provides a textual and a graphical user interface
|
||||||
|
|
||||||
@section{Textual User Interface}
|
@section{Textual User Interface}
|
||||||
|
|
||||||
@defmodule[racunit/text-ui]
|
@defmodule[rackunit/text-ui]
|
||||||
|
|
||||||
The textual UI is in the @racketmodname[racunit/text-ui] module.
|
The textual UI is in the @racketmodname[rackunit/text-ui] module.
|
||||||
It is run via the @racket[run-tests] function.
|
It is run via the @racket[run-tests] function.
|
||||||
|
|
||||||
@defproc[(run-tests (test (or/c test-case? test-suite?))
|
@defproc[(run-tests (test (or/c test-case? test-suite?))
|
||||||
|
@ -33,10 +33,10 @@ information.
|
||||||
|
|
||||||
@section{Graphical User Interface}
|
@section{Graphical User Interface}
|
||||||
|
|
||||||
@defmodule[racunit/gui]
|
@defmodule[rackunit/gui]
|
||||||
|
|
||||||
RacUnit also provides a GUI test runner, available from the
|
RacUnit also provides a GUI test runner, available from the
|
||||||
@racketmodname[racunit/gui] module.
|
@racketmodname[rackunit/gui] module.
|
||||||
|
|
||||||
@defproc[(test/gui [test (or/c test-case? test-suite?)] ...)
|
@defproc[(test/gui [test (or/c test-case? test-suite?)] ...)
|
||||||
any]{
|
any]{
|
|
@ -11,7 +11,7 @@
|
||||||
;; CONSTANTS
|
;; CONSTANTS
|
||||||
|
|
||||||
(define BACKTRACE-NO-MESSAGE "No message.")
|
(define BACKTRACE-NO-MESSAGE "No message.")
|
||||||
(define LINK-MODULE-SPEC 'racunit/private/gui/drracket-link)
|
(define LINK-MODULE-SPEC 'rackunit/private/gui/drracket-link)
|
||||||
|
|
||||||
(define-namespace-anchor drracket-ns-anchor)
|
(define-namespace-anchor drracket-ns-anchor)
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#lang racket
|
#lang racket
|
||||||
(require racunit/gui)
|
(require rackunit/gui)
|
||||||
(provide (all-from-out racunit/gui))
|
(provide (all-from-out rackunit/gui))
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#lang racket
|
#lang racket
|
||||||
(require racunit/text-ui)
|
(require rackunit/text-ui)
|
||||||
(provide (all-from-out racunit/text-ui))
|
(provide (all-from-out rackunit/text-ui))
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require racunit
|
(require rackunit
|
||||||
"check-test.rkt"
|
"check-test.rkt"
|
||||||
"check-info-test.rkt"
|
"check-info-test.rkt"
|
||||||
"format-test.rkt"
|
"format-test.rkt"
|
||||||
|
@ -17,10 +17,10 @@
|
||||||
"counter-test.rkt"
|
"counter-test.rkt"
|
||||||
"text-ui-util-test.rkt")
|
"text-ui-util-test.rkt")
|
||||||
|
|
||||||
(provide all-racunit-tests
|
(provide all-rackunit-tests
|
||||||
failure-tests)
|
failure-tests)
|
||||||
|
|
||||||
(define all-racunit-tests
|
(define all-rackunit-tests
|
||||||
(test-suite
|
(test-suite
|
||||||
"All RacUnit Tests"
|
"All RacUnit Tests"
|
||||||
check-tests
|
check-tests
|
|
@ -28,8 +28,8 @@
|
||||||
|
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require racunit
|
(require rackunit
|
||||||
racunit/private/base)
|
rackunit/private/base)
|
||||||
|
|
||||||
(provide base-tests)
|
(provide base-tests)
|
||||||
|
|
||||||
|
@ -37,45 +37,45 @@
|
||||||
(test-suite
|
(test-suite
|
||||||
"All tests for base"
|
"All tests for base"
|
||||||
(test-case
|
(test-case
|
||||||
"racunit-test-case structure has a contract on name"
|
"rackunit-test-case structure has a contract on name"
|
||||||
(check-exn exn:fail?
|
(check-exn exn:fail?
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(make-racunit-test-case
|
(make-rackunit-test-case
|
||||||
'foo
|
'foo
|
||||||
(lambda () #t)))))
|
(lambda () #t)))))
|
||||||
(test-case
|
(test-case
|
||||||
"racunit-test-case structure has a contract on action"
|
"rackunit-test-case structure has a contract on action"
|
||||||
(check-exn exn:fail?
|
(check-exn exn:fail?
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(make-racunit-test-case
|
(make-rackunit-test-case
|
||||||
"Name"
|
"Name"
|
||||||
#f))))
|
#f))))
|
||||||
(test-case
|
(test-case
|
||||||
"racunit-test-suite has a contract on its fields"
|
"rackunit-test-suite has a contract on its fields"
|
||||||
(check-exn exn:fail?
|
(check-exn exn:fail?
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(make-racunit-test-suite
|
(make-rackunit-test-suite
|
||||||
#f
|
#f
|
||||||
(list)
|
(list)
|
||||||
(lambda () 3)
|
(lambda () 3)
|
||||||
(lambda () 2))))
|
(lambda () 2))))
|
||||||
(check-exn exn:fail?
|
(check-exn exn:fail?
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(make-racunit-test-suite
|
(make-rackunit-test-suite
|
||||||
"Name"
|
"Name"
|
||||||
#f
|
#f
|
||||||
(lambda () 3)
|
(lambda () 3)
|
||||||
(lambda () 2))))
|
(lambda () 2))))
|
||||||
(check-exn exn:fail?
|
(check-exn exn:fail?
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(make-racunit-test-suite
|
(make-rackunit-test-suite
|
||||||
"Name"
|
"Name"
|
||||||
(list)
|
(list)
|
||||||
#f
|
#f
|
||||||
(lambda () 2))))
|
(lambda () 2))))
|
||||||
(check-exn exn:fail?
|
(check-exn exn:fail?
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(make-racunit-test-suite
|
(make-rackunit-test-suite
|
||||||
"Name"
|
"Name"
|
||||||
(list)
|
(list)
|
||||||
(lambda () 3)
|
(lambda () 3)
|
|
@ -27,8 +27,8 @@
|
||||||
|
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require racunit
|
(require rackunit
|
||||||
racunit/private/check-info)
|
rackunit/private/check-info)
|
||||||
|
|
||||||
(provide check-info-tests)
|
(provide check-info-tests)
|
||||||
|
|
|
@ -30,10 +30,10 @@
|
||||||
|
|
||||||
(require racket/runtime-path
|
(require racket/runtime-path
|
||||||
srfi/1
|
srfi/1
|
||||||
racunit
|
rackunit
|
||||||
racunit/private/check
|
rackunit/private/check
|
||||||
racunit/private/result
|
rackunit/private/result
|
||||||
racunit/private/test-suite)
|
rackunit/private/test-suite)
|
||||||
|
|
||||||
(provide check-tests)
|
(provide check-tests)
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@
|
||||||
(cns (current-namespace)))
|
(cns (current-namespace)))
|
||||||
(parameterize ((current-namespace destns))
|
(parameterize ((current-namespace destns))
|
||||||
(namespace-require '(for-syntax racket/base))
|
(namespace-require '(for-syntax racket/base))
|
||||||
(namespace-require 'racunit/private/check)
|
(namespace-require 'rackunit/private/check)
|
||||||
;; First check that the right check macro got
|
;; First check that the right check macro got
|
||||||
;; used: ie that it didn't just compile the thing
|
;; used: ie that it didn't just compile the thing
|
||||||
;; as an application.
|
;; as an application.
|
|
@ -28,10 +28,10 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require racket/match
|
(require racket/match
|
||||||
racunit
|
rackunit
|
||||||
racunit/private/counter
|
rackunit/private/counter
|
||||||
racunit/private/monad
|
rackunit/private/monad
|
||||||
racunit/private/hash-monad)
|
rackunit/private/hash-monad)
|
||||||
|
|
||||||
(provide counter-tests)
|
(provide counter-tests)
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require racunit
|
(require rackunit
|
||||||
racunit/private/check-info
|
rackunit/private/check-info
|
||||||
racunit/private/format)
|
rackunit/private/format)
|
||||||
|
|
||||||
(provide format-tests)
|
(provide format-tests)
|
||||||
|
|
|
@ -28,9 +28,9 @@
|
||||||
|
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require racunit
|
(require rackunit
|
||||||
racunit/private/monad
|
rackunit/private/monad
|
||||||
racunit/private/hash-monad)
|
rackunit/private/hash-monad)
|
||||||
|
|
||||||
(provide hash-monad-tests)
|
(provide hash-monad-tests)
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
;; Commentary:
|
;; Commentary:
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require racunit
|
(require rackunit
|
||||||
racunit/private/location)
|
rackunit/private/location)
|
||||||
|
|
||||||
(provide location-tests)
|
(provide location-tests)
|
||||||
|
|
|
@ -29,8 +29,8 @@
|
||||||
|
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require racunit
|
(require rackunit
|
||||||
racunit/private/monad)
|
rackunit/private/monad)
|
||||||
|
|
||||||
(provide monad-tests)
|
(provide monad-tests)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require racunit
|
(require rackunit
|
||||||
racunit/private/result)
|
rackunit/private/result)
|
||||||
|
|
||||||
(provide result-tests)
|
(provide result-tests)
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require racunit
|
(require rackunit
|
||||||
racunit/text-ui
|
rackunit/text-ui
|
||||||
"all-racunit-tests.rkt")
|
"all-rackunit-tests.rkt")
|
||||||
|
|
||||||
(run-tests all-racunit-tests)
|
(run-tests all-rackunit-tests)
|
||||||
|
|
||||||
;; These tests should all error, so we switch the meaning of correct and incorrect. If the error display changes significantly, DrDr will catch it
|
;; These tests should all error, so we switch the meaning of correct and incorrect. If the error display changes significantly, DrDr will catch it
|
||||||
(parameterize ([current-error-port (current-output-port)]
|
(parameterize ([current-error-port (current-output-port)]
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require racunit/private/check)
|
(require rackunit/private/check)
|
||||||
|
|
||||||
;; This check should succeed
|
;; This check should succeed
|
||||||
(check = 1 1 0.0)
|
(check = 1 1 0.0)
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require racunit/private/check
|
(require rackunit/private/check
|
||||||
racunit/private/test-case)
|
rackunit/private/test-case)
|
||||||
|
|
||||||
;; These tests should succeeds
|
;; These tests should succeeds
|
||||||
(test-begin (check-eq? 1 1))
|
(test-begin (check-eq? 1 1))
|
|
@ -1,10 +1,10 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require racunit/private/base
|
(require rackunit/private/base
|
||||||
racunit/private/check
|
rackunit/private/check
|
||||||
racunit/private/test-case
|
rackunit/private/test-case
|
||||||
racunit/private/test-suite
|
rackunit/private/test-suite
|
||||||
racunit/private/result)
|
rackunit/private/result)
|
||||||
|
|
||||||
(provide test-case-tests)
|
(provide test-case-tests)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require racunit
|
(require rackunit
|
||||||
racunit/private/check)
|
rackunit/private/check)
|
||||||
|
|
||||||
(define run? #f)
|
(define run? #f)
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
racket/runtime-path
|
racket/runtime-path
|
||||||
srfi/1
|
srfi/1
|
||||||
srfi/13
|
srfi/13
|
||||||
racunit
|
rackunit
|
||||||
racunit/private/util
|
rackunit/private/util
|
||||||
racunit/private/location)
|
rackunit/private/location)
|
||||||
|
|
||||||
(provide test-tests)
|
(provide test-tests)
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
(let ((destns (make-base-namespace))
|
(let ((destns (make-base-namespace))
|
||||||
(cns (current-namespace)))
|
(cns (current-namespace)))
|
||||||
(parameterize ((current-namespace destns))
|
(parameterize ((current-namespace destns))
|
||||||
(namespace-require 'racunit)
|
(namespace-require 'rackunit)
|
||||||
(check-exn (lambda (e)
|
(check-exn (lambda (e)
|
||||||
(check-pred exn:fail:syntax? e)
|
(check-pred exn:fail:syntax? e)
|
||||||
(check string-contains (exn-message e) msg))
|
(check string-contains (exn-message e) msg))
|
|
@ -33,8 +33,8 @@
|
||||||
racket/port
|
racket/port
|
||||||
srfi/1
|
srfi/1
|
||||||
srfi/13
|
srfi/13
|
||||||
racunit
|
rackunit
|
||||||
racunit/text-ui)
|
rackunit/text-ui)
|
||||||
|
|
||||||
(provide text-ui-tests)
|
(provide text-ui-tests)
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
;; Commentary:
|
;; Commentary:
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require racunit
|
(require rackunit
|
||||||
racunit/private/text-ui-util)
|
rackunit/private/text-ui-util)
|
||||||
|
|
||||||
(provide text-ui-util-tests)
|
(provide text-ui-util-tests)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require racunit
|
(require rackunit
|
||||||
racunit/private/util)
|
rackunit/private/util)
|
||||||
|
|
||||||
(provide util-tests)
|
(provide util-tests)
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
(check-true (procedure? make-failure-test))
|
(check-true (procedure? make-failure-test))
|
||||||
(check-equal? (make-arity-at-least 2)
|
(check-equal? (make-arity-at-least 2)
|
||||||
(procedure-arity make-failure-test))
|
(procedure-arity make-failure-test))
|
||||||
(check-pred racunit-test-case?
|
(check-pred rackunit-test-case?
|
||||||
(delay-test (make-failure-test "foo" string?)))))
|
(delay-test (make-failure-test "foo" string?)))))
|
||||||
|
|
||||||
(test-case
|
(test-case
|
Loading…
Reference in New Issue
Block a user