Adding tests

svn: r15269
This commit is contained in:
Jay McCarthy 2009-06-25 18:57:21 +00:00
parent 04566b2fcf
commit cc7bd5597b
3 changed files with 34 additions and 1 deletions

View File

@ -1,6 +1,6 @@
#lang setup/infotab #lang setup/infotab
(define compile-omit-paths '("demos")) (define compile-omit-paths '("demos" "tests"))
(define scribblings '(("frtime.scrbl" () (experimental)))) (define scribblings '(("frtime.scrbl" () (experimental))))
(define tools '("frtime-tool.ss")) (define tools '("frtime-tool.ss"))

View File

@ -0,0 +1,6 @@
#lang scheme
(require frtime/erl)
(define t (spawn/name 'test (receive [#f (error 'test "Got an #f")])))
(! t #t)

View File

@ -0,0 +1,27 @@
#lang scheme
(require frtime/heap)
(define f (make-heap > eq?))
(heap-insert f 99)
(printf "A ~S~n" f)
(heap-remove-pos f 1)
(printf "B ~S~n" f)
(for-each (lambda (x) (heap-insert f x)) '(1 2 3 4 5 6 7 8 9 10 11 12 13 14))
(printf "C ~S~n" f)
(heap-remove f 10) (printf "~S~n" f)
(heap-remove f 5) (printf "~S~n" f)
(heap-remove f 8) (printf "~S~n" f)
(heap-remove f 13) (printf "~S~n" f)
(printf "~S~n" (heap-contains f 11))
(printf "~S~n" (heap-contains f 123))
(heap-pop f)
(heap-pop f)
(heap-pop f)
(heap-pop f) (printf "~S~n" f)
(printf "~S~n" (heap-contains f 11))
(printf "~S~n" (heap-contains f 4))
(printf "~S~n" f)
(heap-remove f 2)
(printf "~S~n" f)
(heap-remove f 3)
(printf "~S~n" f)