diff --git a/scribblings/cs019.scrbl b/scribblings/cs019.scrbl index 0983a49..c94adca 100644 --- a/scribblings/cs019.scrbl +++ b/scribblings/cs019.scrbl @@ -33,6 +33,7 @@ current-output-port lambda true false + check-expect ...))) @(define-runtime-path whalesong-path "..") @@ -678,6 +679,17 @@ can accept the event as an argument. @defstruct[event ([kvpairs (listof (list symbol (or/c string number)))])]{} +You can construct events for testing purposes by using @racket[make-event]. +@codeblock|{ +#lang planet dyoo/whalesong/cs019 +;; Synthesizing a location event +(define my-event (make-event '((latitude 41) + (longitude -71)))) +(check-expect (event-ref my-event "latitude") 41) +(check-expect (event-ref my-event "longitude") -71) +}| + + @defthing[Event$ sig]{The signature for an event.} @defproc[(event-ref [evt event?] [name (or/c symbol string)]) value]{