Adding tests
svn: r15269
This commit is contained in:
parent
04566b2fcf
commit
cc7bd5597b
|
@ -1,6 +1,6 @@
|
|||
#lang setup/infotab
|
||||
|
||||
(define compile-omit-paths '("demos"))
|
||||
(define compile-omit-paths '("demos" "tests"))
|
||||
|
||||
(define scribblings '(("frtime.scrbl" () (experimental))))
|
||||
(define tools '("frtime-tool.ss"))
|
||||
|
|
6
collects/frtime/tests/erl.ss
Normal file
6
collects/frtime/tests/erl.ss
Normal file
|
@ -0,0 +1,6 @@
|
|||
#lang scheme
|
||||
(require frtime/erl)
|
||||
|
||||
(define t (spawn/name 'test (receive [#f (error 'test "Got an #f")])))
|
||||
|
||||
(! t #t)
|
27
collects/frtime/tests/heap.ss
Normal file
27
collects/frtime/tests/heap.ss
Normal 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)
|
Loading…
Reference in New Issue
Block a user