Closed aengelberg closed 9 years ago
Now that clojure 1.7 is released I think a .cljc
file is a better approach than a duplicate source tree.
I didn't move the tests to .cljc
though, and I think most of that work is present in this branch. If you can port it to the new .cljc
file I'd be happy to merge.
Are the related leiningen issues resolved? That was my reservation for using a cljc test file.
I've successfully used leiningen with .cljc tests by making a lein alias that explicitly lists the relevant namespaces. I'm not sure what other issues there were.
I have moved the test case to cljc, but please keep in mind:
lein test
does not work for me on Leiningen 2.5.1, and neither does the aliasing strategy (I tried :aliases {"test" ["test" ":only" "com.gfredericks.seventy-one-test"]}
).lein test
DOES work for me on the latest and greatest Leiningen 2.5.2-SNAPSHOT.Were you thinking of a different command to alias? I'm willing to explore that path further if you got it working.
I think you just need to drop the :only
: https://github.com/gfredericks/exact/blob/master/project.clj#L8-10
Thanks, that did it. I've updated the PR and I believe it's ready to merge now.
Works great, thanks!
(Resolves #11 )
Porting the source was indeed as easy as changing the extension to .cljc. However, adding ClojureScript test cases took some more thought.
I added a new clojurescript test file; I would have turned the existing clj into cljc as well, except leiningen does not yet recognize cljc's during "lein test". Added lein-cljsbuild plugin and build settings (all in the
dev
profile of course), and an HTML file you can open in your browser to run the compiled JS. To run the cljs test cases, runlein cljsbuild once
(orauto
), then openresources/private/html/unit-test.html
in your browser.