Created
November 23, 2009 06:24
-
-
Save krukow/240927 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(comment test | |
(def #^{:private true}s (wrap (constantly 42))) | |
(def #^{:private true}f (wrap (fn [_] (assert nil)))) | |
(dotimes [i 10] | |
(s)) | |
(assert (= (ClosedState default-policy 0) @state)) | |
(dotimes [i 5] | |
(try (f) (catch Exception e))) | |
(assert (= (ClosedState default-policy 5) @state)) | |
(try (f) (catch Exception e)) | |
(assert (= (class (OpenState default-policy 0)) (class @state))) | |
(Thread/sleep 5000) | |
(s) | |
(assert (= (ClosedState default-policy 0) @state)) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment