Skip to content

Commit

Permalink
added failed-agent test for pprint
Browse files Browse the repository at this point in the history
Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
  • Loading branch information
stuarthalloway committed May 21, 2010
1 parent d1e39b1 commit 65ae492
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/clojure/test_clojure/pprint/test_pretty.clj
Expand Up @@ -209,21 +209,28 @@ 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)))
(force delay-forced)
(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>"
(tst-pprint 20 promise-filled) #"#<Promise@[0-9a-f]+: \n \(first\n second\n third\)>"
;; 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\)>"
Expand Down

0 comments on commit 65ae492

Please sign in to comment.