Skip to content

Commit

Permalink
fix minor 1.3 issues, add integration poms for 1.3 + 1.4-SNAPSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
cemerick committed Feb 9, 2012
1 parent f1ba703 commit a38756b
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/integration/clojure-1.3.0/pom.xml
Expand Up @@ -10,7 +10,7 @@
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure</artifactId>
<version>1.3.0-master-SNAPSHOT</version>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>@project.groupId@</groupId>
Expand All @@ -24,7 +24,7 @@
<plugin>
<groupId>com.theoryinpractise</groupId>
<artifactId>clojure-maven-plugin</artifactId>
<version>1.3.7</version>
<version>1.3.8</version>
<configuration>
<baseTestSourceDirectory>@basedir@/src/test/clojure</baseTestSourceDirectory>
<vmargs>-Dnrepl.basedir=@basedir@</vmargs>
Expand Down
44 changes: 44 additions & 0 deletions src/integration/clojure-1.4.0/pom.xml
@@ -0,0 +1,44 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>clojure.tools</groupId>
<version>0.0.2-SNAPSHOT</version>
<artifactId>nrepl-test-clojure-1.4.0</artifactId>
<name>nREPL (Clojure 1.4.0 tests)</name>

<dependencies>
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure</artifactId>
<version>1.4.0-master-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.theoryinpractise</groupId>
<artifactId>clojure-maven-plugin</artifactId>
<version>1.3.8</version>
<configuration>
<baseTestSourceDirectory>@basedir@/src/test/clojure</baseTestSourceDirectory>
<vmargs>-Dnrepl.basedir=@basedir@</vmargs>
</configuration>
<executions>
<execution>
<id>test-clojure</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
15 changes: 9 additions & 6 deletions src/test/clojure/clojure/tools/nrepl/sanity_test.clj
Expand Up @@ -22,15 +22,18 @@
(let [[local remote] (piped-transports)
out (java.io.StringWriter.)
err (java.io.StringWriter.)
expr (if (string? expr) expr (pr-str expr))
expr (if (string? expr)
expr
(binding [*print-meta* true]
(pr-str expr)))
msg (merge {:code expr :transport remote}
(when ns {:ns ns}))
resp-fn (if ns
(juxt :ns :value)
:value)]
(handlers/evaluate {#'*out* (java.io.PrintWriter. out)
#'*err* (java.io.PrintWriter. err)}
msg)
#'*err* (java.io.PrintWriter. err)}
msg)
(->> (repl/response-seq local 0)
(map resp-fn)
(cons (str out))
Expand Down Expand Up @@ -78,9 +81,9 @@
["5 6 7 \n 8 9 10\n" nil] '(println 5 6 7 \newline 8 9 10)
["user/foo\n" "" nil] '(binding [*out* *err*]
(prn 'user/foo)))
(is (re-seq #"java.lang.Exception: No such var: user/foo \(.*\)\n" (-> '(prn user/foo)
internal-eval
first))))
(is (re-seq #"Exception: No such var: user/foo" (-> '(prn user/foo)
internal-eval
first))))

(deftest repl-out-writer
(let [[local remote] (piped-transports)
Expand Down
4 changes: 2 additions & 2 deletions src/test/clojure/clojure/tools/nrepl_test.clj
Expand Up @@ -112,7 +112,7 @@

(def-repl-test exceptions
(let [{:keys [status err value]} (combine-responses (repl-eval session "(throw (Exception. \"bad, bad code\"))"))]
(is (= #{"error" "done"} status))
(is (= #{"eval-error" "done"} status))
(is (nil? value))
(is (.contains err "bad, bad code"))
(is (= [true] (repl-values session "(.contains (str *e) \"bad, bad code\")")))))
Expand All @@ -123,7 +123,7 @@
(def-repl-test return-on-incomplete-expr
(let [{:keys [out status value]} (combine-responses (repl-eval session "(missing paren"))]
(is (nil? value))
(is (= #{"done" "error"} status))
(is (= #{"done" "eval-error"} status))
(is (re-seq #"EOF while reading" (first (repl-values session "(.getMessage *e)"))))))

(def-repl-test switch-ns
Expand Down

0 comments on commit a38756b

Please sign in to comment.