diff options
author | Stuart Halloway <stu@thinkrelevance.com> | 2010-05-19 17:15:26 -0400 |
---|---|---|
committer | Stuart Halloway <stu@thinkrelevance.com> | 2010-05-20 21:26:56 -0400 |
commit | 65ae4928119a50e892bc33e8cbb47a82ebef98ee (patch) | |
tree | b8cbf16886b708d07d180959f47b7b78b7d09e9a | |
parent | d1e39b1ec7fc65907b13458d7ec70b0839f3f85e (diff) |
added failed-agent test for pprint
Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
-rw-r--r-- | test/clojure/test_clojure/pprint/test_pretty.clj | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/clojure/test_clojure/pprint/test_pretty.clj b/test/clojure/test_clojure/pprint/test_pretty.clj index 74513fe1..ee328fbc 100644 --- a/test/clojure/test_clojure/pprint/test_pretty.clj +++ b/test/clojure/test_clojure/pprint/test_pretty.clj @@ -209,6 +209,13 @@ Usage: *hello* (deliver promise-filled '(first second third)) (def promise-unfilled (promise)) (def basic-agent (agent '(first second third))) +(defn failed-agent + "must be a fn because you cannot await agents during load" + [] + (let [a (agent "foo")] + (send a +) + (try (await-for 100 failed-agent) (catch RuntimeException re)) + a)) (def basic-atom (atom '(first second third))) (def basic-ref (ref '(first second third))) (def delay-forced (delay '(first second third))) @@ -216,7 +223,6 @@ Usage: *hello* (def delay-unforced (delay '(first second third))) (defrecord pprint-test-rec [a b c]) - (simple-tests pprint-datastructures-tests (tst-pprint 20 future-filled) #"#<Future@[0-9a-f]+: \n 100>" (tst-pprint 20 future-unfilled) #"#<Future@[0-9a-f]+: \n :pending>" @@ -224,6 +230,7 @@ Usage: *hello* ;; This hangs currently, cause we can't figure out whether a promise is filled ;;(tst-pprint 20 promise-unfilled) #"#<Promise@[0-9a-f]+: \n :pending>" (tst-pprint 20 basic-agent) #"#<Agent@[0-9a-f]+: \n \(first\n second\n third\)>" + (tst-pprint 20 (failed-agent)) #"#<Agent@[0-9a-f]+ FAILED: \n \"foo\">" (tst-pprint 20 basic-atom) #"#<Atom@[0-9a-f]+: \n \(first\n second\n third\)>" (tst-pprint 20 basic-ref) #"#<Ref@[0-9a-f]+: \n \(first\n second\n third\)>" (tst-pprint 20 delay-forced) #"#<Delay@[0-9a-f]+: \n \(first\n second\n third\)>" |