Clojure

UNIX/Windows line endings - clojure.pprint tests cause failure in Windows build

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Duplicate
  • Affects Version/s: Release 1.5
  • Fix Version/s: None
  • Component/s: None
  • Environment:
    Windows 7, Maven 3.0.4

Description

I ran a test build of the latest Clojure 1.5 master (372f03e) on Windows and found a number of failures in the "clojure.test-clojure.pprint" tests. All of these seem to be caused by incorrect assumptions about line endings. Example:

[java] {:clojure.test/vars (ns-macro-test),
[java] :thread/name "main",
[java] :pid 1528,
[java] :thread 1,
[java] :type :assert/fail,
[java] :level :warn,
[java] :test/actual
[java] (not
[java] (clojure.core/=
[java] "(ns slam.hound.stitch\r\n (:use [slam.hound.prettify :only [prettify]]))\r\n"
[java] "(ns slam.hound.stitch\n (:use [slam.hound.prettify :only [prettify]]))\n")),
[java] :test/expected
[java] (clojure.core/=
[java] (clojure.core/with-out-str
[java] (clojure.pprint/with-pprint-dispatch
[java] clojure.pprint/code-dispatch
[java] (clojure.pprint/pprint
[java] (clojure.core/read-string
[java] "(ns slam.hound.stitch\n (:use [slam.hound.prettify :only [prettify]]))"))))
[java] (clojure.core/str
[java] "(ns slam.hound.stitch\n (:use [slam.hound.prettify :only [prettify]]))"
[java] "\n")),
[java] :line 173,
[java] :tstamp 1355113319212,
[java] :file "test_pretty.clj"}

It isn't totally clear what the right behaviour should be: should pprint be producing platform specific line endings or not? Either way, the test should confirm the expected behaviour.

Activity

Hide
Andy Fingerhut added a comment -

Most likely this should be closed as a duplicate of CLJ-1076. The symptoms sound the same, and CLJ-1076 has a patch for it that should fix the problem.

Show
Andy Fingerhut added a comment - Most likely this should be closed as a duplicate of CLJ-1076. The symptoms sound the same, and CLJ-1076 has a patch for it that should fix the problem.
Hide
Mike Anderson added a comment -

Hi Andy - yes this looks like a duplicate, thanks for spotting. Should be closed.

Show
Mike Anderson added a comment - Hi Andy - yes this looks like a duplicate, thanks for spotting. Should be closed.
Hide
Andy Fingerhut added a comment -

Duplicate of CLJ-1076

Show
Andy Fingerhut added a comment - Duplicate of CLJ-1076

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: