diff --git a/collects/schemeunit/gui.ss b/collects/rktunit/gui.rkt similarity index 54% rename from collects/schemeunit/gui.ss rename to collects/rktunit/gui.rkt index 325b3d8..0b57fd6 100644 --- a/collects/schemeunit/gui.ss +++ b/collects/rktunit/gui.rkt @@ -1,12 +1,12 @@ -#lang scheme/base -(require scheme/contract - (rename-in "private/base.ss") - "private/gui/gui.ss") +#lang racket/base +(require racket/contract + (rename-in "private/base.rkt") + "private/gui/gui.rkt") (define (test/gui . tests) (apply (make-gui-runner) tests)) -(define test/c (or/c schemeunit-test-case? schemeunit-test-suite?)) +(define test/c (or/c rktunit-test-case? rktunit-test-suite?)) (provide/contract [test/gui diff --git a/collects/rktunit/main.rkt b/collects/rktunit/main.rkt new file mode 100644 index 0000000..5eaa42c --- /dev/null +++ b/collects/rktunit/main.rkt @@ -0,0 +1,31 @@ +;;; +;;; Time-stamp: <2008-07-30 10:46:00 nhw> +;;; +;;; Copyright (C) by Noel Welsh. +;;; + +;;; This library is free software; you can redistribute it +;;; and/or modify it under the terms of the GNU Lesser +;;; General Public License as published by the Free Software +;;; Foundation; either version 2.1 of the License, or (at +;;; your option) any later version. + +;;; This library is distributed in the hope that it will be +;;; useful, but WITHOUT ANY WARRANTY; without even the +;;; implied warranty of MERCHANTABILITY or FITNESS FOR A +;;; PARTICULAR PURPOSE. See the GNU Lesser General Public +;;; License for more details. + +;;; You should have received a copy of the GNU Lesser +;;; General Public License along with this library; if not, +;;; write to the Free Software Foundation, Inc., 59 Temple +;;; Place, Suite 330, Boston, MA 02111-1307 USA + +;;; Author: Noel Welsh +;; +;; +;; Commentary: + +#lang racket/base +(require "private/test.rkt") +(provide (all-from-out "private/test.rkt")) diff --git a/collects/schemeunit/private/base.ss b/collects/rktunit/private/base.rkt similarity index 76% rename from collects/schemeunit/private/base.ss rename to collects/rktunit/private/base.rkt index 0d52744..bb87c10 100644 --- a/collects/schemeunit/private/base.ss +++ b/collects/rktunit/private/base.rkt @@ -1,13 +1,13 @@ -#lang scheme/base +#lang racket/base -(require scheme/contract) +(require racket/contract) ;; struct test : (define-struct test ()) -;; struct (schemeunit-test-case test) : (U string #f) thunk -(define-struct (schemeunit-test-case test) (name action) #:transparent) -;; struct (schemeunit-test-suite test) : string (fdown fup fhere seed -> (listof test-result)) thunk thunk -(define-struct (schemeunit-test-suite test) (name tests before after) #:transparent) +;; struct (rktunit-test-case test) : (U string #f) thunk +(define-struct (rktunit-test-case test) (name action) #:transparent) +;; struct (rktunit-test-suite test) : string (fdown fup fhere seed -> (listof test-result)) thunk thunk +(define-struct (rktunit-test-suite test) (name tests before after) #:transparent) ;; struct exn:test exn : () ;; @@ -33,10 +33,10 @@ (define-struct (test-success test-result) (result)) (provide/contract - (struct (schemeunit-test-case test) + (struct (rktunit-test-case test) ((name (or/c string? false/c)) (action (-> any)))) - (struct (schemeunit-test-suite test) + (struct (rktunit-test-suite test) ((name string?) (tests procedure?) (before (-> any)) diff --git a/collects/schemeunit/private/check-info.ss b/collects/rktunit/private/check-info.rkt similarity index 96% rename from collects/schemeunit/private/check-info.ss rename to collects/rktunit/private/check-info.rkt index efea4e9..3b3ec4e 100644 --- a/collects/schemeunit/private/check-info.ss +++ b/collects/rktunit/private/check-info.rkt @@ -1,4 +1,4 @@ -#lang scheme/base +#lang racket/base (provide (all-defined-out)) @@ -11,7 +11,7 @@ ;; Infrastructure ---------------------------------------------- ;; The continuation mark under which all check-info is keyed -(define check-info-mark (gensym 'schemeunit)) +(define check-info-mark (gensym 'rktunit)) ;; (continuation-mark-set -> (listof check-info)) (define (check-info-stack marks) diff --git a/collects/schemeunit/private/check.ss b/collects/rktunit/private/check.rkt similarity index 97% rename from collects/schemeunit/private/check.ss rename to collects/rktunit/private/check.rkt index a9fddae..f478a33 100644 --- a/collects/schemeunit/private/check.ss +++ b/collects/rktunit/private/check.rkt @@ -1,12 +1,12 @@ -#lang scheme/base +#lang racket/base -(require (for-syntax scheme/base - "location.ss") +(require (for-syntax racket/base + "location.rkt") srfi/1 - "base.ss" - "check-info.ss" - "format.ss" - "location.ss") + "base.rkt" + "check-info.rkt" + "format.rkt" + "location.rkt") (provide current-check-handler check-around diff --git a/collects/schemeunit/private/counter.ss b/collects/rktunit/private/counter.rkt similarity index 96% rename from collects/schemeunit/private/counter.ss rename to collects/rktunit/private/counter.rkt index 208d599..265fb58 100644 --- a/collects/schemeunit/private/counter.ss +++ b/collects/rktunit/private/counter.rkt @@ -26,11 +26,11 @@ ;; ;; Commentary: -#lang scheme/base +#lang racket/base -(require "base.ss" - "monad.ss" - "hash-monad.ss") +(require "base.rkt" + "monad.rkt" + "hash-monad.rkt") (provide display-counter update-counter! diff --git a/collects/schemeunit/private/format.ss b/collects/rktunit/private/format.rkt similarity index 96% rename from collects/schemeunit/private/format.ss rename to collects/rktunit/private/format.rkt index 0e4fd5d..6645914 100644 --- a/collects/schemeunit/private/format.ss +++ b/collects/rktunit/private/format.rkt @@ -1,8 +1,8 @@ -#lang scheme/base +#lang racket/base -(require scheme/match +(require racket/match srfi/13 - "check-info.ss") + "check-info.rkt") (provide display-check-info-name-value display-check-info diff --git a/collects/schemeunit/private/gui/cache-box.ss b/collects/rktunit/private/gui/cache-box.rkt similarity index 96% rename from collects/schemeunit/private/gui/cache-box.ss rename to collects/rktunit/private/gui/cache-box.rkt index 6d5230a..f3fce40 100644 --- a/collects/schemeunit/private/gui/cache-box.ss +++ b/collects/rktunit/private/gui/cache-box.rkt @@ -1,5 +1,5 @@ -#lang scheme/base -(require scheme/contract) +#lang racket/base +(require racket/contract) ;; Add a new kind of promise instead? diff --git a/collects/schemeunit/private/gui/config.ss b/collects/rktunit/private/gui/config.rkt similarity index 70% rename from collects/schemeunit/private/gui/config.ss rename to collects/rktunit/private/gui/config.rkt index 3c2c899..c0123ee 100644 --- a/collects/schemeunit/private/gui/config.ss +++ b/collects/rktunit/private/gui/config.rkt @@ -1,24 +1,24 @@ -#lang scheme/base +#lang racket/base (require framework unstable/gui/prefs) (provide (all-defined-out)) ;; Frame size preferences -(preferences:set-default 'schemeunit:frame:width 400 exact-positive-integer?) -(preferences:set-default 'schemeunit:frame:height 400 exact-positive-integer?) -(define pref:width (pref:get/set 'schemeunit:frame:width)) -(define pref:height (pref:get/set 'schemeunit:frame:height)) +(preferences:set-default 'rktunit:frame:width 400 exact-positive-integer?) +(preferences:set-default 'rktunit:frame:height 400 exact-positive-integer?) +(define pref:width (pref:get/set 'rktunit:frame:width)) +(define pref:height (pref:get/set 'rktunit:frame:height)) ;; CONSTANTS ;; Some of these are obsolete, given the preferences above. (define DETAILS-CANVAS-INIT-WIDTH 400) -(define FRAME-LABEL "SchemeUnit") +(define FRAME-LABEL "RktUnit") (define FRAME-INIT-HEIGHT 400) (define TREE-INIT-WIDTH 240) (define TREE-COLORIZE-CASES #t) -(define DIALOG-ERROR-TITLE "SchemeUnit: Error") +(define DIALOG-ERROR-TITLE "RktUnit: Error") (define STATUS-SUCCESS 'success) (define STATUS-FAILURE 'failure) (define STATUS-ERROR 'error) @@ -28,7 +28,7 @@ (list (/ TREE-INIT-WIDTH total) (/ DETAILS-CANVAS-INIT-WIDTH total)))) ;; Conventional assertion-info keys. -;; These must be kept in sync with assert-base.ss. +;; These must be kept in sync with assert-base.rkt. (define prop:failure-assertion 'name) (define prop:failure-parameters 'params) (define prop:failure-location 'location) diff --git a/collects/schemeunit/private/gui/controller.ss b/collects/rktunit/private/gui/controller.rkt similarity index 79% rename from collects/schemeunit/private/gui/controller.ss rename to collects/rktunit/private/gui/controller.rkt index c89d3d9..edcd4be 100644 --- a/collects/schemeunit/private/gui/controller.ss +++ b/collects/rktunit/private/gui/controller.rkt @@ -1,11 +1,11 @@ -#lang scheme/base -(require scheme/class +#lang racket/base +(require racket/class unstable/class-iop unstable/gui/notify - "../base.ss" - "interfaces.ss" - "model.ss" - "view.ss") + "../base.rkt" + "interfaces.rkt" + "model.rkt" + "view.rkt") (provide controller%) (define controller% @@ -25,18 +25,18 @@ ;; create-model : test suite<%>/#f -> result<%> (define/public (create-model test parent) (define result - (cond [(schemeunit-test-case? test) + (cond [(rktunit-test-case? test) (new case-result% (controller this) (test test) - (name (or (schemeunit-test-case-name test) + (name (or (rktunit-test-case-name test) "")) (parent parent))] - [(schemeunit-test-suite? test) + [(rktunit-test-suite? test) (new suite-result% (controller this) (test test) - (name (or (schemeunit-test-suite-name test) + (name (or (rktunit-test-suite-name test) "")) (parent parent))])) (send/i view view<%> create-view-link result parent) diff --git a/collects/schemeunit/private/gui/drscheme-link.ss b/collects/rktunit/private/gui/drracket-link.rkt similarity index 76% rename from collects/schemeunit/private/gui/drscheme-link.ss rename to collects/rktunit/private/gui/drracket-link.rkt index ecdc545..e247e9a 100644 --- a/collects/schemeunit/private/gui/drscheme-link.ss +++ b/collects/rktunit/private/gui/drracket-link.rkt @@ -1,7 +1,7 @@ ;; Written in #%kernel to avoid adding any module-attachment -;; dependencies. Initialized by the DrScheme integration tool. +;; dependencies. Initialized by the DrRacket integration tool. -(module drscheme-link '#%kernel +(module drracket-link '#%kernel (#%provide link) #| diff --git a/collects/schemeunit/private/gui/drscheme-ui.ss b/collects/rktunit/private/gui/drracket-ui.rkt similarity index 94% rename from collects/schemeunit/private/gui/drscheme-ui.ss rename to collects/rktunit/private/gui/drracket-ui.rkt index 92ab073..d6dd57b 100644 --- a/collects/schemeunit/private/gui/drscheme-ui.ss +++ b/collects/rktunit/private/gui/drracket-ui.rkt @@ -1,10 +1,10 @@ -#lang scheme/base -(require scheme/list - scheme/string +#lang racket/base +(require racket/list + racket/string mzlib/etc - "drscheme-link.ss") + "drracket-link.rkt") -;; Procedures which *may* be overridden by DrScheme to do useful things. +;; Procedures which *may* be overridden by DrRacket to do useful things. ;; Or they may not be. (provide has-backtrace? diff --git a/collects/schemeunit/private/gui/gui.ss b/collects/rktunit/private/gui/gui.rkt similarity index 90% rename from collects/schemeunit/private/gui/gui.ss rename to collects/rktunit/private/gui/gui.rkt index efb4289..782875f 100644 --- a/collects/schemeunit/private/gui/gui.ss +++ b/collects/rktunit/private/gui/gui.rkt @@ -1,13 +1,13 @@ -#lang scheme/base -(require scheme/class +#lang racket/base +(require racket/class unstable/class-iop - scheme/gui - "../base.ss" - "../result.ss" - "../check-info.ss" - "interfaces.ss" - "controller.ss" - "view.ss") + racket/gui + "../base.rkt" + "../result.rkt" + "../check-info.rkt" + "interfaces.rkt" + "controller.rkt" + "view.rkt") (provide make-gui-runner) (define (make-gui-runner) @@ -48,8 +48,8 @@ #| (define/public (run) (let ([custodian (make-custodian)] - [before (schemeunit-test-suite-before test)] - [after (schemeunit-test-suite-after test)]) + [before (rktunit-test-suite-before test)] + [after (rktunit-test-suite-after test)]) (parameterize [(current-custodian custodian)] (dynamic-wind before @@ -112,8 +112,8 @@ (call-with-continuation-prompt (lambda () (time-apply run-test-case - (list (schemeunit-test-case-name test) - (schemeunit-test-case-action test)))))]) + (list (rktunit-test-case-name test) + (rktunit-test-case-action test)))))]) (values (car results) (list cputime realtime gctime)))) (define (make-output-ports) diff --git a/collects/schemeunit/private/gui/interfaces.ss b/collects/rktunit/private/gui/interfaces.rkt similarity index 96% rename from collects/schemeunit/private/gui/interfaces.ss rename to collects/rktunit/private/gui/interfaces.rkt index b48007a..5aa0850 100644 --- a/collects/schemeunit/private/gui/interfaces.ss +++ b/collects/rktunit/private/gui/interfaces.rkt @@ -1,5 +1,5 @@ -#lang scheme/base -(require scheme/class +#lang racket/base +(require racket/class unstable/class-iop) (provide (all-defined-out)) diff --git a/collects/schemeunit/private/gui/model.ss b/collects/rktunit/private/gui/model.rkt similarity index 96% rename from collects/schemeunit/private/gui/model.ss rename to collects/rktunit/private/gui/model.rkt index aaee04c..110efad 100644 --- a/collects/schemeunit/private/gui/model.ss +++ b/collects/rktunit/private/gui/model.rkt @@ -1,11 +1,11 @@ -#lang scheme/base -(require scheme/class +#lang racket/base +(require racket/class unstable/class-iop - scheme/list - "gvector.ss" - "../base.ss" - "interfaces.ss" - "cache-box.ss") + racket/list + "gvector.rkt" + "../base.rkt" + "interfaces.rkt" + "cache-box.rkt") (provide case-result% suite-result%) diff --git a/collects/schemeunit/private/gui/model2rml.ss b/collects/rktunit/private/gui/model2rml.rkt similarity index 98% rename from collects/schemeunit/private/gui/model2rml.ss rename to collects/rktunit/private/gui/model2rml.rkt index c9f48fe..fb10840 100644 --- a/collects/schemeunit/private/gui/model2rml.ss +++ b/collects/rktunit/private/gui/model2rml.rkt @@ -1,14 +1,14 @@ -#lang scheme/base -(require scheme/class +#lang racket/base +(require racket/class unstable/class-iop - scheme/list - scheme/gui - scheme/match - scheme/file + racket/list + racket/gui + racket/match + racket/file mrlib/include-bitmap - (prefix-in drlink: "drscheme-ui.ss") - "interfaces.ss" - "config.ss") + (prefix-in drlink: "drracket-ui.rkt") + "interfaces.rkt" + "config.rkt") (provide model-renderer% output-icon) @@ -404,12 +404,12 @@ (put '() " ") (put+click '(clickback) (lambda _ (drlink:show-errortrace-backtrace exn)) - "[from DrScheme]")) + "[from DrRacket]")) (when (drlink:has-primitive-backtrace? exn) (put '() " ") (put+click '(clickback) (lambda _ (drlink:show-primitive-backtrace exn)) - "[from mzscheme]"))) + "[from racket]"))) (define/private (render-output model) (let [(output (send/i model case<%> get-output))] diff --git a/collects/schemeunit/private/gui/output-icon.png b/collects/rktunit/private/gui/output-icon.png similarity index 100% rename from collects/schemeunit/private/gui/output-icon.png rename to collects/rktunit/private/gui/output-icon.png diff --git a/collects/schemeunit/private/gui/rml.ss b/collects/rktunit/private/gui/rml.rkt similarity index 95% rename from collects/schemeunit/private/gui/rml.ss rename to collects/rktunit/private/gui/rml.rkt index 1e44c7f..885958b 100644 --- a/collects/schemeunit/private/gui/rml.ss +++ b/collects/rktunit/private/gui/rml.rkt @@ -1,13 +1,13 @@ -#lang scheme/base -(require scheme/class +#lang racket/base +(require racket/class unstable/class-iop - scheme/gui + racket/gui framework - "interfaces.ss") + "interfaces.rkt") (provide insert-text ext:text% - schemeunit-style-map) + rktunit-style-map) ;; insert-text : text% string style-delta% -> void (define (insert-text e text style) @@ -20,7 +20,7 @@ (define ext:text-mixin (mixin (text<%>) () - (init-field (style-map schemeunit-style-map)) + (init-field (style-map rktunit-style-map)) (inherit last-position change-style set-clickback @@ -139,7 +139,7 @@ [error . ,style:red] [value . ,style:darkblue])) -(define schemeunit-styles +(define rktunit-styles `([test-unexecuted . ,style:gray] [test-success . ,style:green] [test-failure . ,style:red] @@ -181,7 +181,7 @@ (extend-style-map empty-style-map basic-styles)) -;; schemeunit-style-map : style-map<%> -(define schemeunit-style-map +;; rktunit-style-map : style-map<%> +(define rktunit-style-map (extend-style-map basic-style-map - schemeunit-styles)) + rktunit-styles)) diff --git a/collects/schemeunit/private/gui/view.ss b/collects/rktunit/private/gui/view.rkt similarity index 96% rename from collects/schemeunit/private/gui/view.ss rename to collects/rktunit/private/gui/view.rkt index fdb7175..0b840db 100644 --- a/collects/schemeunit/private/gui/view.ss +++ b/collects/rktunit/private/gui/view.rkt @@ -1,19 +1,19 @@ -#lang scheme/base -(require scheme/class +#lang racket/base +(require racket/class unstable/class-iop - scheme/list - scheme/gui + racket/list + racket/gui framework mrlib/hierlist - "interfaces.ss" - "config.ss" - "model2rml.ss" - "rml.ss") + "interfaces.rkt" + "config.rkt" + "model2rml.rkt" + "rml.rkt") (provide make-view-frame view%) -(define style-map schemeunit-style-map) +(define style-map rktunit-style-map) #| @@ -50,7 +50,7 @@ still be there, just not visible? controller) (super-new) - (define editor (new ext:text% (style-map schemeunit-style-map))) + (define editor (new ext:text% (style-map rktunit-style-map))) (define renderer (new model-renderer% (controller controller) @@ -146,7 +146,7 @@ still be there, just not visible? ;; If the view-link has not been created, ;; yield until it is. (unless (yield) - (error 'schemeunit-gui + (error 'rktunit-gui "internal error: no progress waiting for view-link")) (do-model-update model)]))) diff --git a/collects/schemeunit/private/hash-monad.ss b/collects/rktunit/private/hash-monad.rkt similarity index 97% rename from collects/schemeunit/private/hash-monad.ss rename to collects/rktunit/private/hash-monad.rkt index cada8c6..1cfa803 100644 --- a/collects/schemeunit/private/hash-monad.ss +++ b/collects/rktunit/private/hash-monad.rkt @@ -26,9 +26,9 @@ ;; ;; Commentary: -#lang scheme/base +#lang racket/base -(require "monad.ss") +(require "monad.rkt") (provide (all-defined-out)) diff --git a/collects/schemeunit/private/location.ss b/collects/rktunit/private/location.rkt similarity index 96% rename from collects/schemeunit/private/location.ss rename to collects/rktunit/private/location.rkt index 28b4414..2a9fa1b 100644 --- a/collects/schemeunit/private/location.ss +++ b/collects/rktunit/private/location.rkt @@ -1,6 +1,6 @@ -#lang scheme/base +#lang racket/base -(require scheme/list) +(require racket/list) (provide location-source location-line diff --git a/collects/schemeunit/private/monad.ss b/collects/rktunit/private/monad.rkt similarity index 99% rename from collects/schemeunit/private/monad.ss rename to collects/rktunit/private/monad.rkt index 6bde98c..aa847ad 100644 --- a/collects/schemeunit/private/monad.ss +++ b/collects/rktunit/private/monad.rkt @@ -26,7 +26,7 @@ ;; ;; Commentary: -#lang scheme/base +#lang racket/base (provide (all-defined-out)) diff --git a/collects/schemeunit/private/name-collector.ss b/collects/rktunit/private/name-collector.rkt similarity index 95% rename from collects/schemeunit/private/name-collector.ss rename to collects/rktunit/private/name-collector.rkt index cc14dbd..bcd8973 100644 --- a/collects/schemeunit/private/name-collector.ss +++ b/collects/rktunit/private/name-collector.rkt @@ -26,11 +26,11 @@ ;; ;; Commentary: -#lang scheme/base +#lang racket/base -(require "base.ss" - "monad.ss" - "hash-monad.ss" +(require "base.rkt" + "monad.rkt" + "hash-monad.rkt" srfi/1) (provide display-test-case-name diff --git a/collects/schemeunit/private/result.ss b/collects/rktunit/private/result.rkt similarity index 94% rename from collects/schemeunit/private/result.ss rename to collects/rktunit/private/result.rkt index 915b1f0..61a553f 100644 --- a/collects/schemeunit/private/result.ss +++ b/collects/rktunit/private/result.rkt @@ -26,10 +26,10 @@ ;; ;; Commentary: -#lang scheme/base +#lang racket/base -(require "base.ss" - "test-suite.ss") +(require "base.rkt" + "test-suite.rkt") (provide (all-defined-out)) @@ -51,12 +51,12 @@ ;; data so FP is a bit ugly]. (define (foldts fdown fup fhere seed test) (cond - ((schemeunit-test-case? test) + ((rktunit-test-case? test) (fhere test - (schemeunit-test-case-name test) - (schemeunit-test-case-action test) + (rktunit-test-case-name test) + (rktunit-test-case-action test) seed)) - ((schemeunit-test-suite? test) + ((rktunit-test-suite? test) (apply-test-suite test fdown fup fhere seed)) (else (raise diff --git a/collects/schemeunit/private/test-case.ss b/collects/rktunit/private/test-case.rkt similarity index 95% rename from collects/schemeunit/private/test-case.ss rename to collects/rktunit/private/test-case.rkt index 0892166..3d46188 100644 --- a/collects/schemeunit/private/test-case.ss +++ b/collects/rktunit/private/test-case.rkt @@ -1,10 +1,10 @@ -#lang scheme/base +#lang racket/base -(require (for-syntax scheme/base) - "base.ss" - "format.ss" - "check-info.ss" - "check.ss") +(require (for-syntax racket/base) + "base.rkt" + "format.rkt" + "check-info.rkt" + "check.rkt") (provide current-test-name current-test-case-around diff --git a/collects/schemeunit/private/test-suite.ss b/collects/rktunit/private/test-suite.rkt similarity index 83% rename from collects/schemeunit/private/test-suite.ss rename to collects/rktunit/private/test-suite.rkt index aa586d7..d59ef78 100644 --- a/collects/schemeunit/private/test-suite.ss +++ b/collects/rktunit/private/test-suite.rkt @@ -1,9 +1,9 @@ -#lang scheme/base +#lang racket/base -(require (for-syntax scheme/base) - "base.ss" - "test-case.ss" - "check.ss") +(require (for-syntax racket/base) + "base.rkt" + "test-case.rkt" + "check.rkt") (provide test-suite test-suite-test-case-around @@ -27,14 +27,14 @@ (define (test-suite-test-case-around fhere) (lambda (thunk) (let* ([name (current-test-name)] - [test (make-schemeunit-test-case name thunk)] + [test (make-rktunit-test-case name thunk)] [seed (current-seed)]) (current-seed (fhere test name thunk seed))))) (define (test-suite-check-around fhere) (lambda (thunk) (let* ([name #f] - [test (make-schemeunit-test-case name thunk)] + [test (make-rktunit-test-case name thunk)] [seed (current-seed)]) (current-seed (fhere test name thunk seed))))) @@ -42,12 +42,12 @@ (define delayed-test-case-around (lambda (thunk) (let ([name (current-test-name)]) - (make-schemeunit-test-case name thunk)))) + (make-rktunit-test-case name thunk)))) (define delayed-check-around (lambda (thunk) (let ([name #f]) - (make-schemeunit-test-case name thunk)))) + (make-rktunit-test-case name thunk)))) (define-syntax delay-test (syntax-rules () @@ -58,12 +58,12 @@ test test1 ...)])) (define (apply-test-suite suite fdown fup fhere seed) - (let* ([name (schemeunit-test-suite-name suite)] - [tests (schemeunit-test-suite-tests suite)] - [before (schemeunit-test-suite-before suite)] - [after (schemeunit-test-suite-after suite)] + (let* ([name (rktunit-test-suite-name suite)] + [tests (rktunit-test-suite-tests suite)] + [before (rktunit-test-suite-before suite)] + [after (rktunit-test-suite-after suite)] [kid-seed (fdown suite name before after seed)] - [kid-seed ((schemeunit-test-suite-tests suite) fdown fup fhere kid-seed)]) + [kid-seed ((rktunit-test-suite-tests suite) fdown fup fhere kid-seed)]) (fup suite name before after seed kid-seed))) ;; test-suite : name [#:before thunk] [#:after thunk] test ... @@ -84,7 +84,7 @@ [the-tests (lambda (fdown fup fhere seed) (define (run/inner x) - (cond [(schemeunit-test-suite? x) + (cond [(rktunit-test-suite? x) (current-seed (apply-test-suite x fdown fup fhere (current-seed)))] [(list? x) @@ -103,7 +103,7 @@ [(not (string? the-name)) (raise-type-error 'test-suite "test-suite name as string" the-name)] [else - (make-schemeunit-test-suite + (make-rktunit-test-suite the-name the-tests before-thunk @@ -138,13 +138,13 @@ (for-each (lambda (t) (cond - [(schemeunit-test-suite? t) + [(rktunit-test-suite? t) (current-seed (apply-test-suite t fdown fup fhere (current-seed)))] - [(schemeunit-test-case? t) + [(rktunit-test-case? t) (current-seed (fhere t - (schemeunit-test-case-name t) - (schemeunit-test-case-action t) + (rktunit-test-case-name t) + (rktunit-test-case-action t) (current-seed)))] [else (raise @@ -158,7 +158,7 @@ ;; ;; Construct a test suite from a list of tests (define (make-test-suite name #:before [before void-thunk] #:after [after void-thunk] tests) - (make-schemeunit-test-suite name + (make-rktunit-test-suite name (tests->test-suite-action tests) before after)) diff --git a/collects/schemeunit/private/test.ss b/collects/rktunit/private/test.rkt similarity index 87% rename from collects/schemeunit/private/test.ss rename to collects/rktunit/private/test.rkt index 47001dc..f6ad6fe 100644 --- a/collects/schemeunit/private/test.ss +++ b/collects/rktunit/private/test.rkt @@ -1,13 +1,13 @@ -#lang scheme/base +#lang racket/base -(require (for-syntax scheme/base) - "base.ss" - "check.ss" - "check-info.ss" - "result.ss" - "test-case.ss" - "test-suite.ss" - "util.ss") +(require (for-syntax racket/base) + "base.rkt" + "check.rkt" + "check-info.rkt" + "result.rkt" + "test-case.rkt" + "test-suite.rkt" + "util.rkt") (provide (struct-out exn:test:check) (struct-out check-info) @@ -15,8 +15,8 @@ (struct-out test-failure) (struct-out test-error) (struct-out test-success) - (struct-out schemeunit-test-case) - (struct-out schemeunit-test-suite) + (struct-out rktunit-test-case) + (struct-out rktunit-test-suite) with-check-info with-check-info* @@ -42,9 +42,9 @@ test-suite make-test-suite delay-test - (rename-out [make-schemeunit-test-case make-test-case] - [schemeunit-test-case? test-case?] - [schemeunit-test-suite? test-suite?]) + (rename-out [make-rktunit-test-case make-test-case] + [rktunit-test-case? test-case?] + [rktunit-test-suite? test-suite?]) define-test-suite define/provide-test-suite diff --git a/collects/schemeunit/private/text-ui-util.ss b/collects/rktunit/private/text-ui-util.rkt similarity index 98% rename from collects/schemeunit/private/text-ui-util.ss rename to collects/rktunit/private/text-ui-util.rkt index b84f900..affc9ca 100644 --- a/collects/schemeunit/private/text-ui-util.ss +++ b/collects/rktunit/private/text-ui-util.rkt @@ -26,7 +26,7 @@ ;; ;; Commentary: -#lang scheme/base +#lang racket/base (require (only-in srfi/13 string-contains string-drop)) diff --git a/collects/schemeunit/private/util.ss b/collects/rktunit/private/util.rkt similarity index 92% rename from collects/schemeunit/private/util.ss rename to collects/rktunit/private/util.rkt index e37ea67..6a471d5 100644 --- a/collects/schemeunit/private/util.ss +++ b/collects/rktunit/private/util.rkt @@ -26,13 +26,13 @@ ;; ;; Commentary: -#lang scheme/base +#lang racket/base -(require (for-syntax scheme/base) +(require (for-syntax racket/base) mzlib/etc - "check.ss" - "test-suite.ss" - "test-case.ss") + "check.rkt" + "test-suite.rkt" + "test-case.rkt") (provide require/expose test-suite* @@ -41,7 +41,7 @@ ;; Requires a module and exposes some of its unprovided ;; (non-syntax!) identifiers. ;; USAGE: (require/expose MODULE-NAME (IDS ...)) -;; where MODULE-NAME is as in the MzScheme manual (i.e., +;; where MODULE-NAME is as in the MzRacket manual (i.e., ;; a standard module spec) and IDS are the un-provided ;; identifiers that you wish to expose in the current ;; module. diff --git a/collects/schemeunit/scribblings/acknowledgements.scrbl b/collects/rktunit/scribblings/acknowledgements.scrbl similarity index 73% rename from collects/schemeunit/scribblings/acknowledgements.scrbl rename to collects/rktunit/scribblings/acknowledgements.scrbl index 44c1cdb..147afc0 100644 --- a/collects/schemeunit/scribblings/acknowledgements.scrbl +++ b/collects/rktunit/scribblings/acknowledgements.scrbl @@ -1,18 +1,18 @@ #lang scribble/doc -@(require "base.ss") +@(require "base.rkt") @title{Acknowlegements} -The following people have contributed to SchemeUnit: +The following people have contributed to RktUnit: @itemize[ @item{Robby Findler pushed me to release version 3} @item{Matt Jadud and his students at Olin College - suggested renaming @scheme[test/text-ui]} + suggested renaming @racket[test/text-ui]} @item{Dave Gurnell reported a bug in check-not-exn and - suggested improvements to SchemeUnit} + suggested improvements to RktUnit} @item{Danny Yoo reported a bug in and provided a fix for trim-current-directory} @@ -30,15 +30,15 @@ The following people have contributed to SchemeUnit: @item{Jose A. Ortega Ruiz alerted me a problem in the packaging system and helped fix it.} - @item{Sebastian H. Seidel provided help packaging SchemeUnit + @item{Sebastian H. Seidel provided help packaging RktUnit into a .plt} @item{Don Blaheta provided the method for grabbing line number and file name in checks} - @item{Patrick Logan ported example.ss to version 1.3} + @item{Patrick Logan ported example.rkt to version 1.3} - @item{The PLT team made PLT Scheme} + @item{The PLT team made Racket} @item{The Extreme Programming community started the whole testing framework thing} diff --git a/collects/schemeunit/scribblings/api.scrbl b/collects/rktunit/scribblings/api.scrbl similarity index 71% rename from collects/schemeunit/scribblings/api.scrbl rename to collects/rktunit/scribblings/api.scrbl index fda010b..33ef491 100644 --- a/collects/schemeunit/scribblings/api.scrbl +++ b/collects/rktunit/scribblings/api.scrbl @@ -1,10 +1,10 @@ #lang scribble/doc -@(require "base.ss") +@(require "base.rkt") -@title[#:tag "api"]{SchemeUnit API} +@title[#:tag "api"]{RktUnit API} -@defmodule[schemeunit - #:use-sources (schemeunit)] +@defmodule[rktunit + #:use-sources (rktunit)] @include-section["overview.scrbl"] @include-section["check.scrbl"] diff --git a/collects/schemeunit/scribblings/base.ss b/collects/rktunit/scribblings/base.rkt similarity index 55% rename from collects/schemeunit/scribblings/base.ss rename to collects/rktunit/scribblings/base.rkt index d784028..8189c12 100644 --- a/collects/schemeunit/scribblings/base.ss +++ b/collects/rktunit/scribblings/base.rkt @@ -6,15 +6,15 @@ (for-label scheme/base scheme/contract - schemeunit - schemeunit/text-ui - schemeunit/gui)) + rktunit + rktunit/text-ui + rktunit/gui)) (provide (all-from-out scribble/eval scribble/manual) (for-label (all-from-out scheme/base scheme/contract - schemeunit - schemeunit/text-ui - schemeunit/gui))) + rktunit + rktunit/text-ui + rktunit/gui))) diff --git a/collects/schemeunit/scribblings/check.scrbl b/collects/rktunit/scribblings/check.scrbl similarity index 68% rename from collects/schemeunit/scribblings/check.scrbl rename to collects/rktunit/scribblings/check.scrbl index 165f123..80de0ae 100644 --- a/collects/schemeunit/scribblings/check.scrbl +++ b/collects/rktunit/scribblings/check.scrbl @@ -1,12 +1,12 @@ #lang scribble/doc -@(require "base.ss") +@(require "base.rkt") @title{Checks} -Checks are the basic building block of SchemeUnit. A check +Checks are the basic building block of RktUnit. A check checks some condition. If the condition holds the check -evaluates to @scheme[#t]. If the condition doesn't hold the -check raises an instance of @scheme[exn:test:check] with +evaluates to @racket[#t]. If the condition doesn't hold the +check raises an instance of @racket[exn:test:check] with information detailing the failure. Although checks are implemented as macros, which is @@ -16,8 +16,8 @@ their arguments. You can use check as first class functions, though you will lose precision in the reported source locations if you do so. -The following are the basic checks SchemeUnit provides. You -can create your own checks using @scheme[define-check]. +The following are the basic checks RktUnit provides. You +can create your own checks using @racket[define-check]. @defproc[(check (op (-> any any any)) (v1 any) @@ -25,11 +25,11 @@ can create your own checks using @scheme[define-check]. (message string? "")) any]{ -The simplest check. Succeeds if @scheme[op] applied to @scheme[v1] and @scheme[v2] is not @scheme[#f], otherwise raises an exception of type @scheme[exn:test:check]. The optional @scheme[message] is included in the output if the check fails. If the check succeeds, the value returned by @scheme[op] is the value returned by the check.} +The simplest check. Succeeds if @racket[op] applied to @racket[v1] and @racket[v2] is not @racket[#f], otherwise raises an exception of type @racket[exn:test:check]. The optional @racket[message] is included in the output if the check fails. If the check succeeds, the value returned by @racket[op] is the value returned by the check.} For example, the following check succeeds: -@schemeblock[ +@racketblock[ (check < 2 3) ] @@ -39,14 +39,14 @@ For example, the following check succeeds: [(check-equal? (v1 any) (v2 any) (message string? "")) #t] [(check-not-equal? (v1 any) (v2 any) (message string? "")) #t])]{ -Checks that @scheme[v1] is (not) @scheme[eq?], -@scheme[eqv?], or @scheme[equal?] to @scheme[v2]. The -optional @scheme[message] is included in the output if the +Checks that @racket[v1] is (not) @racket[eq?], +@racket[eqv?], or @racket[equal?] to @racket[v2]. The +optional @racket[message] is included in the output if the check fails.} For example, the following checks all fail: -@schemeblock[ +@racketblock[ (check-eq? (list 1) (list 1) "allocated data not eq?") (check-not-eq? 1 1 "integers are eq?") (check-eqv? 1 1.0 "not eqv?") @@ -55,11 +55,11 @@ For example, the following checks all fail: ] @defproc[(check-pred (pred (-> any any)) (v any) (message string? "")) - #t]{Checks that @scheme[pred] returns a value that is not @scheme[#f] when applied to @scheme[v]. The optional @scheme[message] is included in the output if the check fails. The value returned by a successful check is the value returned by @scheme[pred].} + #t]{Checks that @racket[pred] returns a value that is not @racket[#f] when applied to @racket[v]. The optional @racket[message] is included in the output if the check fails. The value returned by a successful check is the value returned by @racket[pred].} Here's an example that passes and an example that fails: -@schemeblock[ +@racketblock[ (check-pred string? "I work") (check-pred number? "I fail") ] @@ -67,14 +67,14 @@ Here's an example that passes and an example that fails: @defproc[(check-= (v1 any) (v2 any) (epsilon number?) (message string? "")) #t]{ -Checks that @scheme[v1] and @scheme[v2] are within -@scheme[epsilon] of one another. The optional -@scheme[message] is included in the output if the check +Checks that @racket[v1] and @racket[v2] are within +@racket[epsilon] of one another. The optional +@racket[message] is included in the output if the check fails.} Here's an example that passes and an example that fails: -@schemeblock[ +@racketblock[ (check-= 1.0 1.01 0.01 "I work") (check-= 1.0 1.01 0.005 "I fail") ] @@ -83,13 +83,13 @@ Here's an example that passes and an example that fails: [(check-false (v any) (message string? "")) #t] [(check-not-false (v any) (message string? "")) #t])]{ -Checks that @scheme[v] is @scheme[#t], @scheme[#f], or not -@scheme[#f] as appropriate. The optional @scheme[message] +Checks that @racket[v] is @racket[#t], @racket[#f], or not +@racket[#f] as appropriate. The optional @racket[message] is included in the output if the check fails.} For example, the following checks all fail: -@schemeblock[ +@racketblock[ (check-true 1) (check-false 1) (check-not-false #f) @@ -99,16 +99,16 @@ For example, the following checks all fail: @defproc[(check-exn (exn-predicate (-> any (or/c #t #f))) (thunk (-> any)) (message string? "")) #t]{ -Checks that @scheme[thunk] raises an exception for which -@scheme[exn-predicate] returns @scheme[#t]. The optional -@scheme[message] is included in the output if the check +Checks that @racket[thunk] raises an exception for which +@racket[exn-predicate] returns @racket[#t]. The optional +@racket[message] is included in the output if the check fails. A common error is to use an expression instead of a -function of no arguments for @scheme[thunk]. Remember that +function of no arguments for @racket[thunk]. Remember that checks are conceptually functions.} Here are two example, one showing a test that succeeds, and one showing a common error: -@schemeblock[ +@racketblock[ (check-exn exn? (lambda () (raise (make-exn "Hi there" @@ -121,22 +121,22 @@ Here are two example, one showing a test that succeeds, and one showing a common @defproc[(check-not-exn (thunk (-> any)) (message string? "")) #t]{ -Checks that @scheme[thunk] does not raise any exceptions. -The optional @scheme[message] is included in the output if +Checks that @racket[thunk] does not raise any exceptions. +The optional @racket[message] is included in the output if the check fails.} -@defproc[(fail (message string? "")) #t]{This checks fails unconditionally. Good for creating test stubs that youintend to fill out later. The optional @scheme[message] is included in the output if the check fails.} +@defproc[(fail (message string? "")) #t]{This checks fails unconditionally. Good for creating test stubs that youintend to fill out later. The optional @racket[message] is included in the output if the check fails.} -@defproc[(check-regexp-match (regexp regexp?) (string string?)) #t]{Checks that @scheme[regexp] matches the @scheme[string].} +@defproc[(check-regexp-match (regexp regexp?) (string string?)) #t]{Checks that @racket[regexp] matches the @racket[string].} The following check will succeed: -@schemeblock[(check-regexp-match "a+bba" "aaaaaabba")] +@racketblock[(check-regexp-match "a+bba" "aaaaaabba")] This check will fail: -@schemeblock[(check-regexp-match "a+bba" "aaaabbba")] +@racketblock[(check-regexp-match "a+bba" "aaaabbba")] @@ -146,8 +146,8 @@ When an check fails it stores information including the name of the check, the location and message (if available), the expression the check is called with, and the parameters to the check. Additional information can be stored by using -the @scheme[with-check-info*] function, and the -@scheme[with-check-info] macro. +the @racket[with-check-info*] function, and the +@racket[with-check-info] macro. @defstruct[check-info ([name symbol?] [value any])]{ @@ -170,13 +170,13 @@ misspelling errors: @defproc[(with-check-info* (info (listof check-info?)) (thunk (-> any))) any]{ -Stores the given @scheme[info] on the check-info stack for +Stores the given @racket[info] on the check-info stack for the duration (the dynamic extent) of the execution of -@scheme[thunk]} +@racket[thunk]} Example: -@schemeblock[ +@racketblock[ (with-check-info* (list (make-check-info 'time (current-seconds))) (lambda () (check = 1 2))) @@ -191,14 +191,14 @@ check failure. @defform[(with-check-info ((name val) ...) body ...)]{ -The @scheme[with-check-info] macro stores the given +The @racket[with-check-info] macro stores the given information in the check information stack for the duration -of the execution of the body expressions. @scheme[Name] is -a quoted symbol and @scheme[val] is any value.} +of the execution of the body expressions. @racket[Name] is +a quoted symbol and @racket[val] is any value.} Example: -@schemeblock[ +@racketblock[ (for-each (lambda (elt) (with-check-info @@ -218,7 +218,7 @@ check failure. @section{Custom Checks} -Custom checks can be defined using @scheme[define-check] and +Custom checks can be defined using @racket[define-check] and its variants. To effectively use these macros it is useful to understand a few details about a check's evaluation model. @@ -229,17 +229,17 @@ always evaluate their arguments exactly once before executing any expressions in the body of the checks. Hence if you wish to write checks that evalute user defined code that code must be wrapped in a thunk (a function of no -arguments) by the user. The predefined @scheme[check-exn] +arguments) by the user. The predefined @racket[check-exn] is an example of this type of check. It is also useful to understand how the check information stack operates. The stack is stored in a parameter and the -@scheme[with-check-info] forms evaluate to calls to -@scheme[parameterize]. Hence check information has lexical +@racket[with-check-info] forms evaluate to calls to +@racket[parameterize]. Hence check information has lexical scope. For this reason simple checks (see below) cannot -usefully contain calls to @scheme[with-check-info] to report +usefully contain calls to @racket[with-check-info] to report additional information. All checks created using -@scheme[define-simple-check] or @scheme[define-check] grab +@racket[define-simple-check] or @racket[define-check] grab some information by default: the name of the checks and the values of the parameters. Additionally the macro forms of checks grab location information and the expressions passed @@ -247,26 +247,26 @@ as parameters. @defform[(define-simple-check (name param ...) expr ...)]{ -The @scheme[define-simple-check] macro constructs a check -called @scheme[name] that takes the params and an optional -message as arguments and evaluates the @scheme[expr]s. The -check fails if the result of the @scheme[expr]s is -@scheme[#f]. Otherwise the check succeeds. Note that +The @racket[define-simple-check] macro constructs a check +called @racket[name] that takes the params and an optional +message as arguments and evaluates the @racket[expr]s. The +check fails if the result of the @racket[expr]s is +@racket[#f]. Otherwise the check succeeds. Note that simple checks cannot report extra information using -@scheme[with-check-info].} +@racket[with-check-info].} Example: -To define a check @scheme[check-odd?] +To define a check @racket[check-odd?] -@schemeblock[ +@racketblock[ (define-simple-check (check-odd? number) (odd? number)) ] We can use these checks in the usual way: -@schemeblock[ +@racketblock[ (check-odd? 3) (code:comment "Success") (check-odd? 2) (code:comment "Failure") ] @@ -274,12 +274,12 @@ We can use these checks in the usual way: @defform*[[(define-binary-check (name pred actual expected)) (define-binary-check (name actual expected) expr ...)]]{ -The @scheme[define-binary-check] macro constructs a check +The @racket[define-binary-check] macro constructs a check that tests a binary predicate. It's benefit over -@scheme[define-simple-check] is in better reporting on check +@racket[define-simple-check] is in better reporting on check failure. The first form of the macro accepts a binary predicate and tests if the predicate holds for the given -values. The second form tests if @scheme[expr] non-false. +values. The second form tests if @racket[expr] non-false. } Examples: @@ -287,13 +287,13 @@ Examples: Here's the first form, where we use a predefined predicate to construct a binary check: -@schemeblock[ +@racketblock[ (define-binary-check (check-char=? char=? actual expected)) ] In use: -@schemeblock[ +@racketblock[ (check-char=? (read-char a-port) #\a) ] @@ -301,7 +301,7 @@ If the expression is more complicated the second form should be used. For example, below we define a binary check that tests a number if within 0.01 of the expected value: -@schemeblock[ +@racketblock[ (define-binary-check (check-in-tolerance actual expected) (< (abs (- actual expected)) 0.01)) ] @@ -309,22 +309,22 @@ tests a number if within 0.01 of the expected value: @defform[(define-check (name param ...) expr ...)]{ -The @scheme[define-check] macro acts in exactly the same way -as @scheme[define-simple-check], except the check only fails -if the macro @scheme[fail-check] is called in the body of +The @racket[define-check] macro acts in exactly the same way +as @racket[define-simple-check], except the check only fails +if the macro @racket[fail-check] is called in the body of the check. This allows more flexible checks, and in particular more flexible reporting options.} -@defform[(fail-check)]{The @scheme[fail-check] macro raises an @scheme[exn:test:check] with +@defform[(fail-check)]{The @racket[fail-check] macro raises an @racket[exn:test:check] with the contents of the check information stack.} @section{The Check Evaluation Context} The semantics of checks are determined by the parameters -@scheme[current-check-around] and -@scheme[current-check-handler]. Other testing form such as -@scheme[test-begin] and @scheme[test-suite] change the value +@racket[current-check-around] and +@racket[current-check-handler]. Other testing form such as +@racket[test-begin] and @racket[test-suite] change the value of these parameters. @defparam[current-check-handler handler (-> any/c any/c)]{ @@ -338,8 +338,8 @@ trace. } Parameter containing the function that handles the execution of checks. The default value wraps the evaluation of -@scheme[thunk] in a @scheme[with-handlers] call that calls -@scheme[current-check-handler] if an exception is raised and then +@racket[thunk] in a @racket[with-handlers] call that calls +@racket[current-check-handler] if an exception is raised and then (when an exception is not raised) discards the result, returning -@scheme[(void)]. +@racket[(void)]. } diff --git a/collects/schemeunit/scribblings/compound-testing.scrbl b/collects/rktunit/scribblings/compound-testing.scrbl similarity index 74% rename from collects/schemeunit/scribblings/compound-testing.scrbl rename to collects/rktunit/scribblings/compound-testing.scrbl index 74011e4..1879fe7 100644 --- a/collects/schemeunit/scribblings/compound-testing.scrbl +++ b/collects/rktunit/scribblings/compound-testing.scrbl @@ -1,5 +1,5 @@ #lang scribble/doc -@(require "base.ss") +@(require "base.rkt") @title{Compound Testing Forms} @@ -15,14 +15,14 @@ will not be evaluated. @defform[(test-begin expr ...)]{ -A @scheme[test-begin] form groups the @scheme[expr]s into a -single unit. If any @scheme[expr] fails the following ones +A @racket[test-begin] form groups the @racket[expr]s into a +single unit. If any @racket[expr] fails the following ones are not evaluated. } For example, in the following code the world is not destroyed as the preceding check fails: -@schemeblock[ +@racketblock[ (test-begin (check-eq? 'a 'b) (code:comment "This line won't be run") @@ -31,14 +31,14 @@ destroyed as the preceding check fails: @defform[(test-case name expr ...)]{ -Like a @scheme[test-begin] except a name is associated with -the group of @scheme[expr]s. The name will be reported if +Like a @racket[test-begin] except a name is associated with +the group of @racket[expr]s. The name will be reported if the test fails. } -Here's the above example rewritten to use @scheme[test-case] +Here's the above example rewritten to use @racket[test-case] so the test can be named. -@schemeblock[ +@racketblock[ (test-case "Example test" (check-eq? 'a 'b) @@ -48,7 +48,7 @@ so the test can be named. @defproc[(test-case? (obj any)) boolean?]{ - True if @scheme[obj] is a test case, and false otherwise + True if @racket[obj] is a test case, and false otherwise } @@ -69,10 +69,10 @@ run. Instead use one of the functions described in #:contracts ([name-expr string?])]{ Constructs a test suite with the given name and tests. The -tests may be test cases, constructed using @scheme[test-begin] or -@scheme[test-case], or other test suites. +tests may be test cases, constructed using @racket[test-begin] or +@racket[test-case], or other test suites. -The @scheme[before-thunk] and @scheme[after-thunk] are +The @racket[before-thunk] and @racket[after-thunk] are optional thunks (functions with no argument). They are run before and after the tests are run, respectively. @@ -84,7 +84,7 @@ For example, here is a test suite that displays @tt{Before} before any tests are run, and @tt{After} when the tests have finished. -@schemeblock[ +@racketblock[ (test-suite "An example suite" #:before (lambda () (display "Before")) @@ -103,13 +103,13 @@ finished. [#:after after-thunk (-> any) void]) test-suite?]{ -Constructs a test suite with the given @scheme[name] containing the -given @scheme[tests]. Unlike the @scheme[test-suite] form, the tests +Constructs a test suite with the given @racket[name] containing the +given @racket[tests]. Unlike the @racket[test-suite] form, the tests are represented as a list of test values. } @defproc[(test-suite? (obj any)) boolean?]{ True if -@scheme[obj] is a test suite, and false otherwise} +@racket[obj] is a test suite, and false otherwise} @@ -119,25 +119,25 @@ There are some macros that simplify the common cases of defining test suites: @defform[(define-test-suite name test ...)]{ The -@scheme[define-test-suite] form creates a test suite with +@racket[define-test-suite] form creates a test suite with the given name (converted to a string) and tests, and binds it to the same name.} For example, this code creates a binding for the name -@scheme[example-suite] as well as creating a test suite with -the name @scheme["example-suite"]: +@racket[example-suite] as well as creating a test suite with +the name @racket["example-suite"]: -@schemeblock[ +@racketblock[ (define-test-suite example-suite (check = 1 1)) ] @defform[(define/provide-test-suite name test ...)]{ This -for is just like @scheme[define-test-suite], and in addition -it @scheme[provide]s the test suite.} +for is just like @racket[define-test-suite], and in addition +it @racket[provide]s the test suite.} @;{ -Finally, there is the @scheme[test-suite*] macro, which +Finally, there is the @racket[test-suite*] macro, which defines a test suite and test cases using a shorthand syntax: @@ -147,7 +147,7 @@ creates test cases within the suite, with the given names and body expressions. As far I know no-one uses this macro, so it might disappear -in future versions of SchemeUnit.} +in future versions of RktUnit.} } @@ -159,8 +159,8 @@ control the semantics of compound testing forms. @defparam[current-test-name name (or/c string? false/c)]{ This parameter stores the name of the current test case. A -value of @scheme[#f] indicates a test case with no name, -such as one constructed by @scheme[test-begin]. } +value of @racket[#f] indicates a test case with no name, +such as one constructed by @racket[test-begin]. } @defparam[current-test-case-around handler (-> (-> any/c) any/c)]{ @@ -168,20 +168,20 @@ This parameter handles evaluation of test cases. The value of the parameter is a function that is passed a thunk (a function of no arguments). The function, when applied, evaluates the expressions within a test case. The default -value of the @scheme[current-test-case-around] parameters +value of the @racket[current-test-case-around] parameters evaluates the thunk in a context that catches exceptions and prints an appropriate message indicating test case failure.} @defproc[(test-suite-test-case-around [thunk (-> any/c)]) any/c]{ -The @scheme[current-test-case-around] parameter is +The @racket[current-test-case-around] parameter is parameterized to this value within the scope of a -@scheme[test-suite]. This function creates a test case +@racket[test-suite]. This function creates a test case structure instead of immediately evaluating the thunk.} @defproc[(test-suite-check-around [thunk (-> any/c)]) any/c]{ -The @scheme[current-check-around] parameter is parameterized -to this value within the scope of a @scheme[test-suite]. +The @racket[current-check-around] parameter is parameterized +to this value within the scope of a @racket[test-suite]. This function creates a test case structure instead of immediately evaluating a check.} diff --git a/collects/schemeunit/scribblings/control-flow.scrbl b/collects/rktunit/scribblings/control-flow.scrbl similarity index 60% rename from collects/schemeunit/scribblings/control-flow.scrbl rename to collects/rktunit/scribblings/control-flow.scrbl index 08a6506..68f64ca 100644 --- a/collects/schemeunit/scribblings/control-flow.scrbl +++ b/collects/rktunit/scribblings/control-flow.scrbl @@ -1,28 +1,28 @@ #lang scribble/doc -@(require "base.ss") +@(require "base.rkt") @title{Test Control Flow} -The @scheme[before], @scheme[after], and @scheme[around] +The @racket[before], @racket[after], and @racket[around] macros allow you to specify code that is always run before, after, or around expressions in a test case. @defform[(before before-expr expr1 expr2 ...)]{ -Whenever control enters the scope execute the @scheme[before-expr] -before executing @scheme[expr-1], and @scheme[expr-2 ...]} +Whenever control enters the scope execute the @racket[before-expr] +before executing @racket[expr-1], and @racket[expr-2 ...]} @defform[(after expr-1 expr-2 ... after-expr)]{ -Whenever control exits the scope execute the @scheme[after-expr] -after executing @scheme[expr-1], and @scheme[expr-2 ...] The @scheme[after-expr] is +Whenever control exits the scope execute the @racket[after-expr] +after executing @racket[expr-1], and @racket[expr-2 ...] The @racket[after-expr] is executed even if control exits via an exception or other means.} @defform[(around before-expr expr-1 expr-2 ... after-expr)]{ Whenever control enters the scope execute the -@scheme[before-expr] before executing @scheme[expr-1 expr-2 -...], and execute @scheme[after-expr] whenever control +@racket[before-expr] before executing @racket[expr-1 expr-2 +...], and execute @racket[after-expr] whenever control leaves the scope.} Example: @@ -31,7 +31,7 @@ The test below checks that the file @tt{test.dat} contains the string @tt{"foo"}. The before action writes to this file. The after action deletes it. -@schemeblock[ +@racketblock[ (around (with-output-to-file "test.dat" (lambda () @@ -46,7 +46,7 @@ file. The after action deletes it. @defform[(delay-test test1 test2 ...)]{ This somewhat curious macro evaluates the given tests in a -context where @scheme[current-test-case-around] is -parameterized to @scheme[test-suite-test-case-around]. This -has been useful in testing SchemeUnit. It might be useful +context where @racket[current-test-case-around] is +parameterized to @racket[test-suite-test-case-around]. This +has been useful in testing RktUnit. It might be useful for you if you create test cases that create test cases.} diff --git a/collects/schemeunit/scribblings/file-test.scm b/collects/rktunit/scribblings/file-test.rkt similarity index 90% rename from collects/schemeunit/scribblings/file-test.scm rename to collects/rktunit/scribblings/file-test.rkt index f67ef48..1841364 100644 --- a/collects/schemeunit/scribblings/file-test.scm +++ b/collects/rktunit/scribblings/file-test.rkt @@ -1,7 +1,7 @@ #lang scheme/base -(require schemeunit - "file.scm") +(require rktunit + "file.rkt") (check-equal? (my-+ 1 1) 2) (check-equal? (my-* 1 2) 2) diff --git a/collects/schemeunit/scribblings/file.scm b/collects/rktunit/scribblings/file.rkt similarity index 100% rename from collects/schemeunit/scribblings/file.scm rename to collects/rktunit/scribblings/file.rkt diff --git a/collects/rktunit/scribblings/misc.scrbl b/collects/rktunit/scribblings/misc.scrbl new file mode 100644 index 0000000..264abdf --- /dev/null +++ b/collects/rktunit/scribblings/misc.scrbl @@ -0,0 +1,21 @@ +#lang scribble/doc +@(require "base.rkt") + +@title{Miscellaneous Utilities} + +The @racket[require/expose] macro allows you to access +bindings that a module does not provide. It is useful for +testing the private functions of modules. + +@defform[(require/expose module (id ...))]{ +Requires @racket[id] from @racket[module] into the current module. It doesn't matter if the source module provides the bindings or not; @racket[require/expose] can still get at them. + +Note that @racket[require/expose] can be a bit fragile, +especially when mixed with compiled code. Use at your own risk! +} + +This example gets @racket[make-failure-test], which is defined in a RktUnit test: + +@racketblock[ +(require/expose rktunit/private/check-test (make-failure-test)) +] diff --git a/collects/schemeunit/scribblings/overview.scrbl b/collects/rktunit/scribblings/overview.scrbl similarity index 78% rename from collects/schemeunit/scribblings/overview.scrbl rename to collects/rktunit/scribblings/overview.scrbl index 0cf7555..3d1efa6 100644 --- a/collects/schemeunit/scribblings/overview.scrbl +++ b/collects/rktunit/scribblings/overview.scrbl @@ -1,9 +1,9 @@ #lang scribble/doc -@(require "base.ss") +@(require "base.rkt") -@title{Overview of SchemeUnit} +@title{Overview of RktUnit} -There are three basic data types in SchemeUnit: +There are three basic data types in RktUnit: @itemize[ diff --git a/collects/schemeunit/scribblings/philosophy.scrbl b/collects/rktunit/scribblings/philosophy.scrbl similarity index 76% rename from collects/schemeunit/scribblings/philosophy.scrbl rename to collects/rktunit/scribblings/philosophy.scrbl index 9095c90..359e90e 100644 --- a/collects/schemeunit/scribblings/philosophy.scrbl +++ b/collects/rktunit/scribblings/philosophy.scrbl @@ -1,10 +1,10 @@ #lang scribble/doc -@(require "base.ss") +@(require "base.rkt") -@title[#:tag "philosophy"]{The Philosophy of SchemeUnit} +@title[#:tag "philosophy"]{The Philosophy of RktUnit} -SchemeUnit is designed to allow tests to evolve in step with -the evolution of the program under testing. SchemeUnit +RktUnit is designed to allow tests to evolve in step with +the evolution of the program under testing. RktUnit scales from the unstructed checks suitable for simple programs to the complex structure necessary for large projects. @@ -19,23 +19,23 @@ For example, a HtDP student may be writing simple list functions such as length, and the properties they are checking are of the form: -@schemeblock[ +@racketblock[ (equal? (length null) 0) (equal? (length '(a)) 1) (equal? (length '(a b)) 2) ] -SchemeUnit directly supports this style of testing. A check +RktUnit directly supports this style of testing. A check on its own is a valid test. So the above examples may be -written in SchemeUnit as: +written in RktUnit as: -@schemeblock[ +@racketblock[ (check-equal? (length null) 0) (check-equal? (length '(a)) 1) (check-equal? (length '(a b)) 2) ] -Simple programs now get all the benefits of SchemeUnit with +Simple programs now get all the benefits of RktUnit with very little overhead. There are limitations to this style of testing that more @@ -45,31 +45,31 @@ it does not make sense to evaluate some expressions if earlier ones have failed. This type of program needs a way to group expressions so that a failure in one group causes evaluation of that group to stop and immediately proceed to -the next group. In SchemeUnit all that is required is to -wrap a @scheme[test-begin] expression around a group of +the next group. In RktUnit all that is required is to +wrap a @racket[test-begin] expression around a group of expressions: -@schemeblock[ +@racketblock[ (test-begin (setup-some-state!) (check-equal? (foo! 1) 'expected-value-1) (check-equal? (foo! 2) 'expected-value-2)) ] -Now if any expression within the @scheme[test-begin] +Now if any expression within the @racket[test-begin] expression fails no further expressions in that group will be evaluated. Notice that all the previous tests written in the simple style are still valid. Introducing grouping is a local -change only. This is a key feature of SchemeUnit's support +change only. This is a key feature of RktUnit's support for the evolution of the program. The programmer may wish to name a group of tests. This is -done using the @scheme[test-case] expression, a simple +done using the @racket[test-case] expression, a simple variant on test-begin: -@schemeblock[ +@racketblock[ (test-case "The name" ... test expressions ...) @@ -79,7 +79,7 @@ Most programs will stick with this style. However, programmers writing very complex programs may wish to maintain separate groups of tests for different parts of the program, or run their tests in different ways to the normal -SchemeUnit manner (for example, test results may be logged +RktUnit manner (for example, test results may be logged for the purpose of improving software quality, or they may be displayed on a website to indicate service quality). For these programmers it is necessary to delay the execution of @@ -87,7 +87,7 @@ tests so they can processed in the programmer's chosen manner. To do this, the programmer simply wraps a test-suite around their tests: -@schemeblock[ +@racketblock[ (test-suite "Suite name" (check ...) @@ -104,15 +104,15 @@ outside the suite continue to evaluate as before. @section{Historical Context} Most testing frameworks, including earlier versions of -SchemeUnit, support only the final form of testing. This is +RktUnit, support only the final form of testing. This is likely due to the influence of the SUnit testing framework, -which is the ancestor of SchemeUnit and the most widely used +which is the ancestor of RktUnit and the most widely used frameworks in Java, .Net, Python, and Ruby, and many other languages. That this is insufficient for all users is apparent if one considers the proliferation of ``simpler'' -testing frameworks in Scheme such as SRFI-78, or the +testing frameworks in Racket such as SRFI-78, or the practice of beginner programmers. Unfortunately these simpler methods are inadequate for testing larger -systems. To the best of my knowledge SchemeUnit is the only +systems. To the best of my knowledge RktUnit is the only testing framework that makes a conscious effort to support the testing style of all levels of programmer. diff --git a/collects/schemeunit/scribblings/quick-start.scrbl b/collects/rktunit/scribblings/quick-start.scrbl similarity index 67% rename from collects/schemeunit/scribblings/quick-start.scrbl rename to collects/rktunit/scribblings/quick-start.scrbl index 61f8de1..2e0bea8 100644 --- a/collects/schemeunit/scribblings/quick-start.scrbl +++ b/collects/rktunit/scribblings/quick-start.scrbl @@ -1,14 +1,14 @@ #lang scribble/doc -@(require "base.ss") +@(require "base.rkt") -@title[#:tag "quick-start"]{Quick Start Guide for SchemeUnit} +@title[#:tag "quick-start"]{Quick Start Guide for RktUnit} -Suppose we have code contained in @tt{file.scm}, which -implements buggy versions of @scheme[+] and @scheme[-] -called @scheme[my-+] and @scheme[my--]: +Suppose we have code contained in @tt{file.rkt}, which +implements buggy versions of @racket[+] and @racket[-] +called @racket[my-+] and @racket[my--]: -@schememod[ -scheme/base +@racketmod[ +racket/base (define (my-+ a b) (if (zero? a) @@ -24,26 +24,26 @@ scheme/base my-*) ] -We want to test this code with SchemeUnit. We start by -creating a file called @tt{file-test.scm} to contain our -tests. At the top of @tt{file-test.scm} we import -SchemeUnit and @tt{file.scm}: +We want to test this code with RktUnit. We start by +creating a file called @tt{file-test.rkt} to contain our +tests. At the top of @tt{file-test.rkt} we import +RktUnit and @tt{file.rkt}: -@schememod[ -scheme/base +@racketmod[ +racket/base -(require schemeunit - "file.scm") +(require rktunit + "file.rkt") ] Now we add some tests to check our library: -@schemeblock[ +@racketblock[ (check-equal? (my-+ 1 1) 2 "Simple addition") (check-equal? (my-* 1 2) 2 "Simple multiplication") ] -This is all it takes to define tests in SchemeUnit. Now +This is all it takes to define tests in RktUnit. Now evaluate this file and see if the library is correct. Here's the result I get: @@ -52,7 +52,7 @@ Here's the result I get: -------------------- FAILURE name: check-equal? -location: (file-test.scm 7 0 117 27) +location: (file-test.rkt 7 0 117 27) expression: (check-equal? (my-* 1 2) 2) params: (4 2) actual: 4 @@ -60,21 +60,21 @@ expected: 2 --------------------} -The first @scheme[#t] indicates the first test passed. The +The first @racket[#t] indicates the first test passed. The second test failed, as shown by the message. -Requiring SchemeUnit and writing checks is all you need to +Requiring RktUnit and writing checks is all you need to get started testing, but let's take a little bit more time to look at some features beyond the essentials. Let's say we want to check that a number of properties hold. How do we do this? So far we've only seen checks of a -single expression. In SchemeUnit a check is always a single +single expression. In RktUnit a check is always a single expression, but we can group checks into units called test cases. Here's a simple test case written using the -@scheme[test-begin] form: +@racket[test-begin] form: -@schemeblock[ +@racketblock[ (test-begin (let ((lst (list 2 4 6 9))) (check = (length lst) 4) @@ -91,24 +91,24 @@ Evalute this and you should see an error message like: A test ... has a FAILURE name: check-pred -location: (# 14 6 252 22) +location: (# 14 6 252 22) expression: (check-pred even? elt) params: (# 9) -------------------- } -This tells us that the expression @scheme[(check-pred even? +This tells us that the expression @racket[(check-pred even? elt)] failed. The arguments of this check were -@scheme[even?] and @scheme[9], and as 9 is not even the +@racket[even?] and @racket[9], and as 9 is not even the check failed. A test case fails as soon as any check within it fails, and no further checks are evaluated once this takes place. Naming our test cases if useful as it helps remind us what we're testing. We can give a test case a name with the -@scheme[test-case] form: +@racket[test-case] form: -@schemeblock[ +@racketblock[ (test-case "List has length 4 and all elements even" (let ((lst (list 2 4 6 9))) @@ -122,10 +122,10 @@ we're testing. We can give a test case a name with the Now if we want to structure our tests are bit more we can group them into a test suite: -@schemeblock[ +@racketblock[ (define file-tests (test-suite - "Tests for file.scm" + "Tests for file.rkt" (check-equal? (my-+ 1 1) 2 "Simple addition") @@ -147,13 +147,13 @@ tests, allowing you to choose how you run your tests. You might, for example, print the results to the screen or log them to a file. -Let's run our tests, using SchemeUnit's simple textual user +Let's run our tests, using RktUnit's simple textual user interface (there are fancier interfaces available but this -will do for our example). In @tt{file-test.scm} add the +will do for our example). In @tt{file-test.rkt} add the following lines: -@schemeblock[ - (require schemeunit/text-ui) +@racketblock[ + (require rktunit/text-ui) (run-tests file-tests) ] @@ -161,6 +161,6 @@ following lines: Now evaluate the file and you should see similar output again. -These are the basics of SchemeUnit. Refer to the +These are the basics of RktUnit. Refer to the documentation below for more advanced topics, such as defining your own checks. Have fun! diff --git a/collects/schemeunit/scribblings/release-notes.scrbl b/collects/rktunit/scribblings/release-notes.scrbl similarity index 87% rename from collects/schemeunit/scribblings/release-notes.scrbl rename to collects/rktunit/scribblings/release-notes.scrbl index 2c70f43..af5b2d5 100644 --- a/collects/schemeunit/scribblings/release-notes.scrbl +++ b/collects/rktunit/scribblings/release-notes.scrbl @@ -1,5 +1,5 @@ #lang scribble/doc -@(require "base.ss") +@(require "base.rkt") @title{Release Notes} @@ -12,7 +12,7 @@ There are also miscellaneous Scribble fixes. @section{Version 3} -This version of SchemeUnit is largely backwards compatible +This version of RktUnit is largely backwards compatible with version 2 but there are significant changes to the underlying model, justifying incrementing the major version number. These changes are best explained in @@ -24,9 +24,9 @@ hopefully be corrected in later minor version releases: @itemize[ @item{There is no graphical UI, and in particular no -integration with DrScheme.} +integration with DrRacket.} -@item{The semantics of @scheme[test-suite] are not the +@item{The semantics of @racket[test-suite] are not the desired ones. In particular, only checks and test cases have their evaluation delayed by a test suite; other expressions will be evaluated before the suite is diff --git a/collects/schemeunit/scribblings/schemeunit.scrbl b/collects/rktunit/scribblings/rktunit.scrbl similarity index 67% rename from collects/schemeunit/scribblings/schemeunit.scrbl rename to collects/rktunit/scribblings/rktunit.scrbl index 59686a1..0bb06f1 100644 --- a/collects/schemeunit/scribblings/schemeunit.scrbl +++ b/collects/rktunit/scribblings/rktunit.scrbl @@ -1,13 +1,13 @@ #lang scribble/doc -@(require "base.ss") +@(require "base.rkt") -@title{@bold{SchemeUnit}: Unit Testing for Scheme} +@title{@bold{RktUnit}: Unit Testing for Racket} @author[(author+email "Noel Welsh" "noelwelsh@gmail.com") (author+email "Ryan Culpepper" "ryan_sml@yahoo.com")] -SchemeUnit is a unit-testing framework for PLT Scheme. It -is designed to handle the needs of all Scheme programmers, +RktUnit is a unit-testing framework for Racket. It +is designed to handle the needs of all Racket programmers, from novices to experts. @table-of-contents[] diff --git a/collects/schemeunit/scribblings/ui.scrbl b/collects/rktunit/scribblings/ui.scrbl similarity index 51% rename from collects/schemeunit/scribblings/ui.scrbl rename to collects/rktunit/scribblings/ui.scrbl index 3b80a25..e070e66 100644 --- a/collects/schemeunit/scribblings/ui.scrbl +++ b/collects/rktunit/scribblings/ui.scrbl @@ -1,47 +1,47 @@ #lang scribble/doc -@(require "base.ss") +@(require "base.rkt") @title[#:tag "ui"]{User Interfaces} -SchemeUnit provides a textual and a graphical user interface +RktUnit provides a textual and a graphical user interface @section{Textual User Interface} -@defmodule[schemeunit/text-ui] +@defmodule[rktunit/text-ui] -The textual UI is in the @schememodname[schemeunit/text-ui] module. -It is run via the @scheme[run-tests] function. +The textual UI is in the @racketmodname[rktunit/text-ui] module. +It is run via the @racket[run-tests] function. @defproc[(run-tests (test (or/c test-case? test-suite?)) (verbosity (symbols 'quiet 'normal 'verbose) 'normal)) natural-number/c]{ -The given @scheme[test] is run and the result of running it -output to the @scheme[current-output-port]. The output is +The given @racket[test] is run and the result of running it +output to the @racket[current-output-port]. The output is compatable with the (X)Emacs next-error command (as used, for example, by (X)Emacs's compile function) -The optional @scheme[verbosity] is one of @scheme['quiet], -@scheme['normal], or @scheme['verbose]. Quiet output +The optional @racket[verbosity] is one of @racket['quiet], +@racket['normal], or @racket['verbose]. Quiet output displays only the number of successes, failures, and errors. Normal reporting suppresses some extraneous check information (such as the expression). Verbose reports all information. -@scheme[run-tests] returns the number of unsuccessful tests.} +@racket[run-tests] returns the number of unsuccessful tests.} @section{Graphical User Interface} -@defmodule[schemeunit/gui] +@defmodule[rktunit/gui] -SchemeUnit also provides a GUI test runner, available from the -@schememodname[schemeunit/gui] module. +RktUnit also provides a GUI test runner, available from the +@racketmodname[rktunit/gui] module. @defproc[(test/gui [test (or/c test-case? test-suite?)] ...) any]{ -Creates a new SchemeUnit GUI window and runs each @scheme[test]. The +Creates a new RktUnit GUI window and runs each @racket[test]. The GUI is updated as tests complete. } @@ -49,7 +49,7 @@ GUI is updated as tests complete. @defproc[(make-gui-runner) (-> (or/c test-case? test-suite?) ... any)]{ -Creates a new SchemeUnit GUI window and returns a procedure that, when +Creates a new RktUnit GUI window and returns a procedure that, when applied, runs the given tests and displays the results in the GUI. } diff --git a/collects/schemeunit/text-ui.ss b/collects/rktunit/text-ui.rkt similarity index 94% rename from collects/schemeunit/text-ui.ss rename to collects/rktunit/text-ui.rkt index 0115b01..4952b7a 100644 --- a/collects/schemeunit/text-ui.ss +++ b/collects/rktunit/text-ui.rkt @@ -26,23 +26,23 @@ ;; ;; Commentary: -#lang scheme/base +#lang racket/base -(require scheme/match - scheme/pretty +(require racket/match + racket/pretty srfi/13 srfi/26 - "main.ss" - "private/base.ss" - "private/counter.ss" - "private/format.ss" - "private/location.ss" - "private/result.ss" - "private/check-info.ss" - "private/monad.ss" - "private/hash-monad.ss" - "private/name-collector.ss" - "private/text-ui-util.ss") + "main.rkt" + "private/base.rkt" + "private/counter.rkt" + "private/format.rkt" + "private/location.rkt" + "private/result.rkt" + "private/check-info.rkt" + "private/monad.rkt" + "private/hash-monad.rkt" + "private/name-collector.rkt" + "private/text-ui-util.rkt") (provide run-tests display-context diff --git a/collects/schemeunit/tool.ss b/collects/rktunit/tool.rkt similarity index 86% rename from collects/schemeunit/tool.ss rename to collects/rktunit/tool.rkt index 5b1c2ea..a48f637 100644 --- a/collects/schemeunit/tool.ss +++ b/collects/rktunit/tool.rkt @@ -1,19 +1,19 @@ -#lang scheme/base -(require scheme/class - scheme/gui +#lang racket/base +(require racket/class + racket/gui framework drscheme/tool - scheme/unit - (prefix-in drlink: "private/gui/drscheme-link.ss")) + racket/unit + (prefix-in drlink: "private/gui/drracket-link.rkt")) (provide tool@) ;; CONSTANTS (define BACKTRACE-NO-MESSAGE "No message.") -(define LINK-MODULE-SPEC 'schemeunit/private/gui/drscheme-link) +(define LINK-MODULE-SPEC 'rktunit/private/gui/drracket-link) -(define-namespace-anchor drscheme-ns-anchor) +(define-namespace-anchor drracket-ns-anchor) ;; ---- @@ -71,7 +71,7 @@ show-backtrace show-source)) - (define drscheme-ns (namespace-anchor->namespace drscheme-ns-anchor)) + (define drracket-ns (namespace-anchor->namespace drracket-ns-anchor)) (define interactions-text-mixin (mixin ((class->interface drscheme:rep:text%)) () @@ -79,7 +79,7 @@ (super-new) (define/private (setup-helper-module) - (namespace-attach-module drscheme-ns + (namespace-attach-module drracket-ns LINK-MODULE-SPEC (get-user-namespace))) diff --git a/collects/schemeunit/gui.rkt b/collects/schemeunit/gui.rkt new file mode 100644 index 0000000..5b3a672 --- /dev/null +++ b/collects/schemeunit/gui.rkt @@ -0,0 +1,3 @@ +#lang racket +(require rktunit/gui) +(provide (all-from-out rktunit/gui)) \ No newline at end of file diff --git a/collects/schemeunit/text-ui.rkt b/collects/schemeunit/text-ui.rkt new file mode 100644 index 0000000..1ede14a --- /dev/null +++ b/collects/schemeunit/text-ui.rkt @@ -0,0 +1,3 @@ +#lang racket +(require rktunit/text-ui) +(provide (all-from-out rktunit/text-ui)) \ No newline at end of file diff --git a/collects/tests/schemeunit/all-schemeunit-tests.ss b/collects/tests/rktunit/all-rktunit-tests.rkt similarity index 57% rename from collects/tests/schemeunit/all-schemeunit-tests.ss rename to collects/tests/rktunit/all-rktunit-tests.rkt index d943eaf..baf8d3c 100644 --- a/collects/tests/schemeunit/all-schemeunit-tests.ss +++ b/collects/tests/rktunit/all-rktunit-tests.rkt @@ -1,28 +1,28 @@ -#lang scheme/base +#lang racket/base -(require schemeunit - "check-test.ss" - "check-info-test.ss" - "format-test.ss" - "test-case-test.ss" - "test-suite-test.ss" - "base-test.ss" - "location-test.ss" - "result-test.ss" - "test-test.ss" - "util-test.ss" - "text-ui-test.ss" - "monad-test.ss" - "hash-monad-test.ss" - "counter-test.ss" - "text-ui-util-test.ss") +(require rktunit + "check-test.rkt" + "check-info-test.rkt" + "format-test.rkt" + "test-case-test.rkt" + "test-suite-test.rkt" + "base-test.rkt" + "location-test.rkt" + "result-test.rkt" + "test-test.rkt" + "util-test.rkt" + "text-ui-test.rkt" + "monad-test.rkt" + "hash-monad-test.rkt" + "counter-test.rkt" + "text-ui-util-test.rkt") -(provide all-schemeunit-tests +(provide all-rktunit-tests failure-tests) -(define all-schemeunit-tests +(define all-rktunit-tests (test-suite - "All SchemeUnit Tests" + "All RktUnit Tests" check-tests base-tests check-info-tests diff --git a/collects/tests/schemeunit/base-test.ss b/collects/tests/rktunit/base-test.rkt similarity index 78% rename from collects/tests/schemeunit/base-test.ss rename to collects/tests/rktunit/base-test.rkt index 8f3e9ff..3c81db7 100644 --- a/collects/tests/schemeunit/base-test.ss +++ b/collects/tests/rktunit/base-test.rkt @@ -26,10 +26,10 @@ ;; ;; Commentary: -#lang scheme/base +#lang racket/base -(require schemeunit - schemeunit/private/base) +(require rktunit + rktunit/private/base) (provide base-tests) @@ -37,45 +37,45 @@ (test-suite "All tests for base" (test-case - "schemeunit-test-case structure has a contract on name" + "rktunit-test-case structure has a contract on name" (check-exn exn:fail? (lambda () - (make-schemeunit-test-case + (make-rktunit-test-case 'foo (lambda () #t))))) (test-case - "schemeunit-test-case structure has a contract on action" + "rktunit-test-case structure has a contract on action" (check-exn exn:fail? (lambda () - (make-schemeunit-test-case + (make-rktunit-test-case "Name" #f)))) (test-case - "schemeunit-test-suite has a contract on its fields" + "rktunit-test-suite has a contract on its fields" (check-exn exn:fail? (lambda () - (make-schemeunit-test-suite + (make-rktunit-test-suite #f (list) (lambda () 3) (lambda () 2)))) (check-exn exn:fail? (lambda () - (make-schemeunit-test-suite + (make-rktunit-test-suite "Name" #f (lambda () 3) (lambda () 2)))) (check-exn exn:fail? (lambda () - (make-schemeunit-test-suite + (make-rktunit-test-suite "Name" (list) #f (lambda () 2)))) (check-exn exn:fail? (lambda () - (make-schemeunit-test-suite + (make-rktunit-test-suite "Name" (list) (lambda () 3) diff --git a/collects/tests/schemeunit/check-info-test.ss b/collects/tests/rktunit/check-info-test.rkt similarity index 88% rename from collects/tests/schemeunit/check-info-test.ss rename to collects/tests/rktunit/check-info-test.rkt index 9d2b9f8..6cb5a6d 100644 --- a/collects/tests/schemeunit/check-info-test.ss +++ b/collects/tests/rktunit/check-info-test.rkt @@ -1,23 +1,23 @@ ;;; -;;; ---- Tests for check-util +;;; ---- Tests for check-util ;;; Time-stamp: <2009-06-11 17:03:21 noel> ;;; ;;; Copyright (C) 2003 by Noel Welsh. ;;; -;;; This file is part of SchemeUnit. +;;; This file is part of RktUnit. -;;; SchemeUnit is free software; you can redistribute it and/or +;;; RktUnit is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU Lesser General Public ;;; License as published by the Free Software Foundation; either ;;; version 2.1 of the License, or (at your option) any later version. -;;; SchemeUnitis distributed in the hope that it will be useful, +;;; RktUnitis distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; Lesser General Public License for more details. ;;; You should have received a copy of the GNU Lesser General Public -;;; License along with SchemeUnit; if not, write to the Free Software +;;; License along with RktUnit; if not, write to the Free Software ;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;;; Author: Noel Welsh @@ -25,10 +25,10 @@ ;; ;; Commentary: -#lang scheme/base +#lang racket/base -(require schemeunit - schemeunit/private/check-info) +(require rktunit + rktunit/private/check-info) (provide check-info-tests) diff --git a/collects/tests/schemeunit/check-test.ss b/collects/tests/rktunit/check-test.rkt similarity index 97% rename from collects/tests/schemeunit/check-test.ss rename to collects/tests/rktunit/check-test.rkt index 0e3b8a0..fd2029c 100644 --- a/collects/tests/schemeunit/check-test.ss +++ b/collects/tests/rktunit/check-test.rkt @@ -26,14 +26,14 @@ ;; ;; Commentary: -#lang scheme/base +#lang racket/base -(require scheme/runtime-path +(require racket/runtime-path srfi/1 - schemeunit - schemeunit/private/check - schemeunit/private/result - schemeunit/private/test-suite) + rktunit + rktunit/private/check + rktunit/private/result + rktunit/private/test-suite) (provide check-tests) @@ -287,8 +287,8 @@ (let ((destns (make-base-namespace)) (cns (current-namespace))) (parameterize ((current-namespace destns)) - (namespace-require '(for-syntax scheme/base)) - (namespace-require 'schemeunit/private/check) + (namespace-require '(for-syntax racket/base)) + (namespace-require 'rktunit/private/check) ;; First check that the right check macro got ;; used: ie that it didn't just compile the thing ;; as an application. diff --git a/collects/tests/schemeunit/counter-test.ss b/collects/tests/rktunit/counter-test.rkt similarity index 90% rename from collects/tests/schemeunit/counter-test.ss rename to collects/tests/rktunit/counter-test.rkt index 6ab8fbe..516a391 100644 --- a/collects/tests/schemeunit/counter-test.ss +++ b/collects/tests/rktunit/counter-test.rkt @@ -25,13 +25,13 @@ ;; ;; ;; Commentary: -#lang scheme/base +#lang racket/base -(require scheme/match - schemeunit - schemeunit/private/counter - schemeunit/private/monad - schemeunit/private/hash-monad) +(require racket/match + rktunit + rktunit/private/counter + rktunit/private/monad + rktunit/private/hash-monad) (provide counter-tests) diff --git a/collects/tests/schemeunit/format-test.ss b/collects/tests/rktunit/format-test.rkt similarity index 83% rename from collects/tests/schemeunit/format-test.ss rename to collects/tests/rktunit/format-test.rkt index 47b9da6..9ac98b1 100644 --- a/collects/tests/schemeunit/format-test.ss +++ b/collects/tests/rktunit/format-test.rkt @@ -1,8 +1,8 @@ -#lang scheme/base +#lang racket/base -(require schemeunit - schemeunit/private/check-info - schemeunit/private/format) +(require rktunit + rktunit/private/check-info + rktunit/private/format) (provide format-tests) diff --git a/collects/tests/schemeunit/hash-monad-test.ss b/collects/tests/rktunit/hash-monad-test.rkt similarity index 94% rename from collects/tests/schemeunit/hash-monad-test.ss rename to collects/tests/rktunit/hash-monad-test.rkt index fd42b81..cb9eecc 100644 --- a/collects/tests/schemeunit/hash-monad-test.ss +++ b/collects/tests/rktunit/hash-monad-test.rkt @@ -26,11 +26,11 @@ ;; ;; Commentary: -#lang scheme/base +#lang racket/base -(require schemeunit - schemeunit/private/monad - schemeunit/private/hash-monad) +(require rktunit + rktunit/private/monad + rktunit/private/hash-monad) (provide hash-monad-tests) diff --git a/collects/tests/schemeunit/location-test.ss b/collects/tests/rktunit/location-test.rkt similarity index 77% rename from collects/tests/schemeunit/location-test.ss rename to collects/tests/rktunit/location-test.rkt index 52a1881..22ebbc2 100644 --- a/collects/tests/schemeunit/location-test.ss +++ b/collects/tests/rktunit/location-test.rkt @@ -25,10 +25,10 @@ ;; ;; ;; Commentary: -#lang scheme/base +#lang racket/base -(require schemeunit - schemeunit/private/location) +(require rktunit + rktunit/private/location) (provide location-tests) @@ -43,10 +43,10 @@ (test-case "syntax->location ok" (around - (with-output-to-file "test-file.ss" - (lambda () (display "#lang scheme\n'foo\n"))) - (let* ([stx (read-syntax/lang (string->path "test-file.ss") - (open-input-file "test-file.ss"))] + (with-output-to-file "test-file.rkt" + (lambda () (display "#lang racket\n'foo\n"))) + (let* ([stx (read-syntax/lang (string->path "test-file.rkt") + (open-input-file "test-file.rkt"))] [rep (syntax->location stx)]) (check-equal? (location-source rep) (syntax-source stx)) @@ -54,7 +54,7 @@ (syntax-position stx)) (check-equal? (location-span rep) (syntax-span stx))) - (delete-file "test-file.ss"))) + (delete-file "test-file.rkt"))) (test-case "Emacs compatible location strings" @@ -63,15 +63,15 @@ (syntax->location (datum->syntax #f #f - (list "file.ss" 42 38 1240 2)))) - "file.ss:42:38") + (list "file.rkt" 42 38 1240 2)))) + "file.rkt:42:38") (check string=? (location->string (syntax->location (datum->syntax #f #f - (list (string->path "file.ss") 42 38 1240 2)))) - "file.ss:42:38") + (list (string->path "file.rkt") 42 38 1240 2)))) + "file.rkt:42:38") (check string=? (location->string (syntax->location @@ -84,14 +84,14 @@ (syntax->location (datum->syntax #f #f - (list 'foo.ss 42 38 1240 2)))) - "foo.ss:42:38") + (list 'foo.rkt 42 38 1240 2)))) + "foo.rkt:42:38") (check string=? (location->string (syntax->location (datum->syntax #f #f - (list "foo.ss" #f #f #f #f)))) - "foo.ss:?:?")) + (list "foo.rkt" #f #f #f #f)))) + "foo.rkt:?:?")) )) diff --git a/collects/tests/schemeunit/monad-test.ss b/collects/tests/rktunit/monad-test.rkt similarity index 98% rename from collects/tests/schemeunit/monad-test.ss rename to collects/tests/rktunit/monad-test.rkt index 92c089f..7aeaa5b 100644 --- a/collects/tests/schemeunit/monad-test.ss +++ b/collects/tests/rktunit/monad-test.rkt @@ -27,10 +27,10 @@ ;; Commentary: -#lang scheme/base +#lang racket/base -(require schemeunit - schemeunit/private/monad) +(require rktunit + rktunit/private/monad) (provide monad-tests) diff --git a/collects/tests/schemeunit/result-test.ss b/collects/tests/rktunit/result-test.rkt similarity index 92% rename from collects/tests/schemeunit/result-test.ss rename to collects/tests/rktunit/result-test.rkt index fd0ae97..a8534c1 100644 --- a/collects/tests/schemeunit/result-test.ss +++ b/collects/tests/rktunit/result-test.rkt @@ -1,7 +1,7 @@ -#lang scheme/base +#lang racket/base -(require schemeunit - schemeunit/private/result) +(require rktunit + rktunit/private/result) (provide result-tests) diff --git a/collects/tests/schemeunit/run-tests.ss b/collects/tests/rktunit/run-tests.rkt similarity index 68% rename from collects/tests/schemeunit/run-tests.ss rename to collects/tests/rktunit/run-tests.rkt index 3852cb9..66f89fd 100644 --- a/collects/tests/schemeunit/run-tests.ss +++ b/collects/tests/rktunit/run-tests.rkt @@ -1,10 +1,10 @@ -#lang scheme/base +#lang racket/base -(require schemeunit - schemeunit/text-ui - "all-schemeunit-tests.ss") +(require rktunit + rktunit/text-ui + "all-rktunit-tests.rkt") -(run-tests all-schemeunit-tests) +(run-tests all-rktunit-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 (parameterize ([current-error-port (current-output-port)] diff --git a/collects/tests/schemeunit/standalone-check-test.ss b/collects/tests/rktunit/standalone-check-test.rkt similarity index 96% rename from collects/tests/schemeunit/standalone-check-test.ss rename to collects/tests/rktunit/standalone-check-test.rkt index 91d1daa..9c6615a 100644 --- a/collects/tests/schemeunit/standalone-check-test.ss +++ b/collects/tests/rktunit/standalone-check-test.rkt @@ -29,9 +29,9 @@ ;; part of the standard test suite and must be run ;; separately. -#lang scheme/base +#lang racket/base -(require schemeunit/private/check) +(require rktunit/private/check) ;; This check should succeed (check = 1 1 0.0) diff --git a/collects/tests/schemeunit/standalone-test-case-test.ss b/collects/tests/rktunit/standalone-test-case-test.rkt similarity index 83% rename from collects/tests/schemeunit/standalone-test-case-test.ss rename to collects/tests/rktunit/standalone-test-case-test.rkt index 742bb03..816f082 100644 --- a/collects/tests/schemeunit/standalone-test-case-test.ss +++ b/collects/tests/rktunit/standalone-test-case-test.rkt @@ -2,10 +2,10 @@ ;; semantics of checks. These tests are not part of the ;; standard test suite and must be run separately. -#lang scheme/base +#lang racket/base -(require schemeunit/private/check - schemeunit/private/test-case) +(require rktunit/private/check + rktunit/private/test-case) ;; These tests should succeeds (test-begin (check-eq? 1 1)) diff --git a/collects/tests/schemeunit/test-case-test.ss b/collects/tests/rktunit/test-case-test.rkt similarity index 83% rename from collects/tests/schemeunit/test-case-test.ss rename to collects/tests/rktunit/test-case-test.rkt index 0f3ceac..66fed4c 100644 --- a/collects/tests/schemeunit/test-case-test.ss +++ b/collects/tests/rktunit/test-case-test.rkt @@ -1,10 +1,10 @@ -#lang scheme/base +#lang racket/base -(require schemeunit/private/base - schemeunit/private/check - schemeunit/private/test-case - schemeunit/private/test-suite - schemeunit/private/result) +(require rktunit/private/base + rktunit/private/check + rktunit/private/test-case + rktunit/private/test-suite + rktunit/private/result) (provide test-case-tests) diff --git a/collects/tests/schemeunit/test-suite-test.ss b/collects/tests/rktunit/test-suite-test.rkt similarity index 95% rename from collects/tests/schemeunit/test-suite-test.ss rename to collects/tests/rktunit/test-suite-test.rkt index f8e4a19..de7dd55 100644 --- a/collects/tests/schemeunit/test-suite-test.ss +++ b/collects/tests/rktunit/test-suite-test.rkt @@ -1,7 +1,7 @@ -#lang scheme/base +#lang racket/base -(require schemeunit - schemeunit/private/check) +(require rktunit + rktunit/private/check) (define run? #f) diff --git a/collects/tests/schemeunit/test-test.ss b/collects/tests/rktunit/test-test.rkt similarity index 96% rename from collects/tests/schemeunit/test-test.ss rename to collects/tests/rktunit/test-test.rkt index cd3f237..f83dd15 100644 --- a/collects/tests/schemeunit/test-test.ss +++ b/collects/tests/rktunit/test-test.rkt @@ -1,12 +1,12 @@ -#lang scheme/base +#lang racket/base -(require (for-syntax scheme/base) - scheme/runtime-path +(require (for-syntax racket/base) + racket/runtime-path srfi/1 srfi/13 - schemeunit - schemeunit/private/util - schemeunit/private/location) + rktunit + rktunit/private/util + rktunit/private/location) (provide test-tests) @@ -43,7 +43,7 @@ (let ((destns (make-base-namespace)) (cns (current-namespace))) (parameterize ((current-namespace destns)) - (namespace-require 'schemeunit) + (namespace-require 'rktunit) (check-exn (lambda (e) (check-pred exn:fail:syntax? e) (check string-contains (exn-message e) msg)) @@ -260,7 +260,7 @@ (test-failure-result failure))] [loc (check-info-value (car (filter check-location? stack)))]) - (check-regexp-match #rx"test-test\\.ss" (location->string loc))))) + (check-regexp-match #rx"test-test\\.rkt" (location->string loc))))) (test-case "Shortcuts capture location" @@ -273,7 +273,7 @@ (test-failure-result failure))) (loc (check-info-value (car (filter check-location? stack))))) - (check-regexp-match #rx"test-test\\.ss" (location->string loc))))) + (check-regexp-match #rx"test-test\\.rkt" (location->string loc))))) (test-case "All names that should be exported are exported" diff --git a/collects/tests/schemeunit/text-ui-test.ss b/collects/tests/rktunit/text-ui-test.rkt similarity index 93% rename from collects/tests/schemeunit/text-ui-test.ss rename to collects/tests/rktunit/text-ui-test.rkt index c5daf75..1d9a0d9 100644 --- a/collects/tests/schemeunit/text-ui-test.ss +++ b/collects/tests/rktunit/text-ui-test.rkt @@ -26,15 +26,15 @@ ;; ;; Commentary: -#lang scheme/base +#lang racket/base -(require scheme/runtime-path - scheme/pretty - scheme/port +(require racket/runtime-path + racket/pretty + racket/port srfi/1 srfi/13 - schemeunit - schemeunit/text-ui) + rktunit + rktunit/text-ui) (provide text-ui-tests) @@ -119,9 +119,9 @@ (with-all-output-to-string (failing-binary-test/complex-params)))]) (check string-contains op - "((0 1 2 3 4 5 6 7 8 9 10 11 12 13 14) - (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14) - (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14))"))) + "(`(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14) + `(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14) + `(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14))"))) (test-case "Non-binary check output is pretty printed" @@ -129,9 +129,9 @@ (with-all-output-to-string (failing-test/complex-params)))]) (check string-contains op - "((0 1 2 3 4 5 6 7 8 9 10 11 12 13 14) - (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14) - (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14))"))) + "(`(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14) + `(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14) + `(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14))"))) (test-case "Location trimmed when file is under current directory" @@ -139,7 +139,7 @@ (let ((op (with-all-output-to-string (failing-test)))) (check string-contains op - "location: text-ui-test.ss")))) + "location: text-ui-test.rkt")))) (test-case "Name and location displayed before actual/expected" diff --git a/collects/tests/schemeunit/text-ui-util-test.ss b/collects/tests/rktunit/text-ui-util-test.rkt similarity index 85% rename from collects/tests/schemeunit/text-ui-util-test.ss rename to collects/tests/rktunit/text-ui-util-test.rkt index bb4948d..2cb1362 100644 --- a/collects/tests/schemeunit/text-ui-util-test.ss +++ b/collects/tests/rktunit/text-ui-util-test.rkt @@ -25,10 +25,10 @@ ;; ;; ;; Commentary: -#lang scheme/base +#lang racket/base -(require schemeunit - schemeunit/private/text-ui-util) +(require rktunit + rktunit/private/text-ui-util) (provide text-ui-util-tests) @@ -44,12 +44,12 @@ (test-equal? "trim-current-directory strips directory from files in current directory" (trim-current-directory - (path->string (build-path (current-directory) "foo.ss"))) - "foo.ss") + (path->string (build-path (current-directory) "foo.rkt"))) + "foo.rkt") (test-equal? "trim-current-directory leaves subdirectories alone" (trim-current-directory - (path->string (build-path (current-directory) "foo" "bar.ss"))) - "foo/bar.ss") + (path->string (build-path (current-directory) "foo" "bar.rkt"))) + "foo/bar.rkt") )) diff --git a/collects/tests/schemeunit/util-test.ss b/collects/tests/rktunit/util-test.rkt similarity index 84% rename from collects/tests/schemeunit/util-test.ss rename to collects/tests/rktunit/util-test.rkt index 36b90a5..b1c5345 100644 --- a/collects/tests/schemeunit/util-test.ss +++ b/collects/tests/rktunit/util-test.rkt @@ -1,7 +1,7 @@ -#lang scheme/base +#lang racket/base -(require schemeunit - schemeunit/private/util) +(require rktunit + rktunit/private/util) (provide util-tests) @@ -10,18 +10,18 @@ ;; prevents the tests from loading. ;; 2 - For whatever reason, it *does* fail when loaded via PLaneT. ;; Still waiting for resolution on a bug report. -(require/expose "check-test.ss" (make-failure-test)) +(require/expose "check-test.rkt" (make-failure-test)) (define util-tests (test-suite "Util tests" (test-case - "make-failure-test required from check-test.ss" + "make-failure-test required from check-test.rkt" (begin (check-true (procedure? make-failure-test)) (check-equal? (make-arity-at-least 2) (procedure-arity make-failure-test)) - (check-pred schemeunit-test-case? + (check-pred rktunit-test-case? (delay-test (make-failure-test "foo" string?))))) (test-case