Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

Commit

Permalink
Added test for limits.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpapp committed Jul 4, 2011
1 parent c99c7c7 commit 7ba3ae5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/statistics.lisp
Expand Up @@ -122,9 +122,14 @@


(addtest (statistics-tests) (addtest (statistics-tests)
(let+ ((end 5) (let+ ((end 5)
(index 0) ; to make sure we have 1 of each
(pairs (filled-array 100 (pairs (filled-array 100
(lambda () (lambda ()
(@ (random 100d0) (random end))))) (prog1 (@ (random 100d0)
(if (< index end)
index
(random end)))
(incf index)))))
(acc #'mean-sse-accumulator) (acc #'mean-sse-accumulator)
(result (sweep (sparse-accumulator-array 1 acc) pairs)) (result (sweep (sparse-accumulator-array 1 acc) pairs))
(*lift-equality-test* #'==) (*lift-equality-test* #'==)
Expand All @@ -136,6 +141,7 @@
pairs) pairs)
(when (plusp (tally accumulator)) (when (plusp (tally accumulator))
accumulator)))) accumulator))))
(ensure-same (limits result) (vector `(0 . ,end)))
(loop for i below end do (loop for i below end do
(ensure-same (ref result i) (sparse-acc pairs (funcall acc) i))))) (ensure-same (ref result i) (sparse-acc pairs (funcall acc) i)))))


Expand Down

0 comments on commit 7ba3ae5

Please sign in to comment.