diff --git a/collects/teachpack/htdp/Docs/mkdocs b/collects/teachpack/htdp/Docs/mkdocs index c331b2f544..2d0f9f4ead 100755 --- a/collects/teachpack/htdp/Docs/mkdocs +++ b/collects/teachpack/htdp/Docs/mkdocs @@ -16,6 +16,7 @@ fi (define libraries* '(#"Images" #"Animated Images, Simulating Worlds" + #"Testing" #"Convert" #"Guess" #"Mastermind" diff --git a/collects/teachpack/htdp/Docs/testing.thtml b/collects/teachpack/htdp/Docs/testing.thtml new file mode 100644 index 0000000000..8c2c8c284e --- /dev/null +++ b/collects/teachpack/htdp/Docs/testing.thtml @@ -0,0 +1,80 @@ +{ (define LIBNAME "Testing") + (include "head.tinc") } + +
+ This teachpack provides four constructs for testing programs: +
++ The first three forms create tests: +
+ You should place them below the relevant function + definitions in the Definitions Window. Eventually you should place + all tests, such as these, at the bottom of the window. + + +
+ Finally, generate-report
is a function that displays
+ statistics of running tests:
+
+
+(check-expect (+ 1 1) 2)
+(check-expect (+ 1 1) 3)
+
+(check-within (+ 1 1) 2.1 .001)
+(check-within (+ 1 1) 2.1 .1)
+
+(check-error (+ 1 1) "3")
+(check-error (/ 1 0) "/: division by zero")
+
+(generate-report)
+
+
+ Before you do so, try to figure out which of these tests succeed and which
+ fail. After clicking run, you see a separate frame that records how many
+ succeeded and failed and detail information about the failures, including
+ links for highlighting the source.
+