This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-29
Channels
- # announcements (7)
- # babashka (105)
- # beginners (67)
- # braveandtrue (11)
- # cider (8)
- # clojure (62)
- # clojure-conj (4)
- # clojure-poland (1)
- # clojure-spec (9)
- # clojure-uk (8)
- # clojurescript (49)
- # core-typed (11)
- # cursive (4)
- # emacs (1)
- # fulcro (1)
- # graalvm (24)
- # hoplon (10)
- # hyperfiddle (1)
- # off-topic (32)
- # re-frame (7)
- # reitit (1)
- # sql (1)
trying to think about how to include tests in the same script in an unobtrusive way, though
Yes, Iโve already said earlier this week that I want to port clojure.test, but that will take some time
@nate_clojurians Added a test library for babashka: https://github.com/borkdude/spartan.test
@borkdude, maybe you should change your tagline to โwe are borkdude, we create awesome toolsโ because I canโt imagine there is only one of you!
Made the output more like normal clojure.test:
FAIL in project.test/foo-test
expected: (= 2 (project/foo))
actual: (not (= 2 1))
Now I can finally test this giant babashka script... https://github.com/borkdude/deps.clj
should the installer for https://github.com/borkdude/deps.clj install it as deps.exe on macos?
deps.clj is just a text file that you can run with either clojure or babashka whereas deps.exe is a binary file
I'm trying to make a babashka-focused project for more clojurish filesystem manipulation (since I keep copy/pasting the same stuff from script to script)
I rather like this project but I don't think babashka supports everything in there https://github.com/Raynes/fs/blob/master/src/me/raynes/fs.clj
cool, can you make an issue for it? (adding more to it as you discover more, is fine)
bonus feature of the testing lib:
WARNING: no assertions were made in test borkdude.deps-test/describe-test
(require '[ :as io])
(defmacro ^:private predicate [s path]
`(if ~path
(. ~path ~s)
false))
(defn absolute?
"Return true if `path` is absolute."
[path]
(predicate isAbsolute (io/file path)))
(prn (absolute? "README.md"))
$ clj
false
$ bb
Don't know how to create ISeq from: clojure.lang.Symbol [at /Users/nsutton/Code/fs/test.bb, line 11, column 3]
@nate_clojurians This works:
(require '[ :as io])
(defmacro ^:private predicate [s path]
`(if ~path
(~(symbol (str "." s)) ~path)
false))
(defn absolute?
"Return true if `path` is absolute."
[path]
(predicate isAbsolute (io/file path)))
(prn (absolute? "README.md"))
Kind of meta: deps.clj / deps.exe now uses itself in the tests to build the classpath with a testing library on it and then invokes clojure or babashka to run them
there are some zip-related classes in bb: https://github.com/borkdude/babashka/blob/0a35971acac25e84cfb2a6fbbd8e8193345b76b2/src/babashka/impl/classes.clj#L78
this was added for clj-http-lite, because it needs to handle gzip compression I think
this is the bit that makes me want to nope out of this: https://github.com/clj-commons/fs/blob/master/src/me/raynes/fs/compression.clj#L6-L9
feel free to post more issues just in case I forgot. reify I'm not sure if I can make that work, haven't thought about it
this is the list I have so far
Add:
* .FilenameFilter
* java.nio.file.LinkOption
* java.nio.file.CopyOption
* java.nio.file.attribute.FileAttribute
* java.lang.IllegalArgumentException (needs fully qualified name in babashka whereas in clj you can just use IllegalArgumentException)
* reify
* clojure.java.shell/with-sh-dir