Added screenshot of the RackUnit GUI, fixed typo.

This commit is contained in:
Georges Dupéron 2017-05-18 23:29:16 +02:00
parent 19a87ffe13
commit 71c164e9f0
3 changed files with 24 additions and 1 deletions

View File

@ -7,7 +7,7 @@ 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 ...)]{
@defform[(before before-expr expr-1 expr-2 ...)]{
Whenever control enters the scope execute the @racket[before-expr]
before executing @racket[expr-1], and @racket[expr-2 ...]}

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -47,6 +47,29 @@ GUI is updated as tests complete.
When @racket[wait?] is true, @racket[test/gui] does not return until
the test runner window has been closed.
Given the following program, the RackUnit GUI will look as shown below:
@racketblock[
#,(hash-lang) racket
(require rackunit rackunit/gui)
(test/gui
(test-suite
"all tests"
(test-suite
"math tests"
(test-case "addition" (check-equal? (+ 1 1) 2))
(test-case "subtraction" (check-equal? (- 0 0) 0))
(test-case "multiplication" (check-equal? (* 2 2) 5)))
(test-suite
"string tests"
(test-case "append" (check-equal? (string-append "a" "b") "ab"))
(test-case "ref" (check-equal? (string-ref "abc" 1) #\b)))))]
@image["scribblings/rackunit-screen-shot.png"]{Screenshot of the RackUnit
window. It features a tree representing the nested test suites (with test
cases as leaves) on the left pane, and information about the selected test
failure in the right pane.}
}
@defproc[(make-gui-runner)