            (doseq [event events]
              (s event))
            (is (= 6 (deref i)))))
+
 (deftest within-test
+(logging/suppress ["riemann.streams"]
          (let [output (ref [])
                r (within [1 2]
                          (fn [e] (dosync (alter output conj e))))

           (em 12 200)))

(deftest changed-test
         (let [output (atom [])
               r (changed :state (append output))
               r2 (changed :state {:init :ok}
                           (append output))
               states [:ok :bad :bad :ok :ok :ok :evil :bad]]

           ; Apply states
           (doseq [state states]
             (r {:state state}))

           ; Check output
           (is (= [:ok :bad :ok :evil :bad]
                  (vec (map (fn [s] (:state s)) (deref output)))))

           ; Test with init
           (reset! output [])
           (doseq [state states]
             (r2 {:state state}))

           (is (= [:bad :ok :evil :bad]
                  (vec (map (fn [s] (:state s)) (deref output)))))))

(deftest changed-with-previous-test
         (let [output (atom [])

               expect [0.5 1]]
           
           (doseq [m metrics] (r {:metric m}))
           (is (= expect (vec (map (fn [s] (:metric s)) (deref output))))))))

(deftest ewma-timeless-test
         (test-stream (ewma-timeless 0)
