Browse files

now that messages on the same transport are no longer serialized, tweak

tests so that messages that *need* to be serialized are all put on the
same session
  • Loading branch information...
1 parent 2f12262 commit 6f6197b12d03d0c86de98a13f820ec1d1f317821 @cemerick cemerick committed Oct 4, 2012
View
12 src/test/clojure/clojure/tools/nrepl/helpers_test.clj
@@ -23,30 +23,30 @@
;; bizarrely, the path of the test script generated by clojure-maven-plugin
;; ends up being in the :file metadata here on Clojure 1.3.0+, but
;; passes in 1.2.0...
- #_(repl-eval client "\n\n\n(defn function [])")
+ #_(repl-eval session "\n\n\n(defn function [])")
#_(is (= [{:file "NO_SOURCE_PATH" :line 4}]
- (repl-values client "(-> #'function meta (select-keys [:file :line]))")))
+ (repl-values session "(-> #'function meta (select-keys [:file :line]))")))
- (repl-eval client
+ (repl-eval session
(helpers/load-file-command
"\n\n\n\n\n\n\n\n\n(defn dfunction [])"
"path/from/source/root.clj"
"root.clj"))
(is (= [{:file "path/from/source/root.clj" :line 10}]
- (repl-values client
+ (repl-values session
(nrepl/code
(-> #'dfunction
meta
(select-keys [:file :line])))))))
(def-repl-test load-file-with-debug-info
- (repl-eval client
+ (repl-eval session
(helpers/load-file-command
(File. project-base-dir "load-file-test/clojure/tools/nrepl/load_file_sample.clj")
(File. project-base-dir "load-file-test")))
(is (= [{:file "clojure/tools/nrepl/load_file_sample.clj" :line 5}]
- (repl-values client
+ (repl-values session
(nrepl/code
(-> #'clojure.tools.nrepl.load-file-sample/dfunction
meta
View
28 src/test/clojure/clojure/tools/nrepl/load_file_test.clj
@@ -10,36 +10,38 @@
(use-fixtures :once repl-server-fixture)
(def-repl-test load-code-with-debug-info
- (nrepl/message timeout-client {:op "load-file" :file "\n\n\n(defn function [])"})
+ (doall (nrepl/message timeout-session
+ {:op "load-file" :file "\n\n\n(defn function [])"}))
(is (contains?
; different versions of Clojure use different default :file metadata
#{[{:file "NO_SOURCE_PATH" :line 4}]
[{:file "NO_SOURCE_FILE" :line 4}]}
- (repl-values timeout-client
+ (repl-values timeout-session
(nrepl/code
(-> #'function
meta
(select-keys [:file :line]))))))
- (nrepl/message timeout-client {:op "load-file"
- :file "\n\n\n\n\n\n\n\n\n(defn afunction [])"
- :file-path "path/from/source/root.clj"
- :file-name "root.clj"})
+ (doall (nrepl/message timeout-session {:op "load-file"
+ :file "\n\n\n\n\n\n\n\n\n(defn afunction [])"
+ :file-path "path/from/source/root.clj"
+ :file-name "root.clj"}))
(is (= [{:file "path/from/source/root.clj" :line 10}]
- (repl-values timeout-client
+ (repl-values timeout-session
(nrepl/code
(-> #'afunction
meta
(select-keys [:file :line])))))))
(def-repl-test load-file-with-debug-info
- (nrepl/message timeout-client
- {:op "load-file"
- :file (slurp (File. project-base-dir "load-file-test/clojure/tools/nrepl/load_file_sample.clj"))
- :file-path "clojure/tools/nrepl/load_file_sample.clj"
- :file-name "load_file_sample.clj"})
+ (doall
+ (nrepl/message timeout-session
+ {:op "load-file"
+ :file (slurp (File. project-base-dir "load-file-test/clojure/tools/nrepl/load_file_sample.clj"))
+ :file-path "clojure/tools/nrepl/load_file_sample.clj"
+ :file-name "load_file_sample.clj"}))
(is (= [{:file "clojure/tools/nrepl/load_file_sample.clj" :line 5}]
- (repl-values timeout-client
+ (repl-values timeout-session
(nrepl/code
(-> #'clojure.tools.nrepl.load-file-sample/dfunction
meta

0 comments on commit 6f6197b

Please sign in to comment.