Fork me on GitHub
Cora (she/her)03:12:41

having a test library for babashka might be nice

Cora (she/her)03:12:11

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


@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!

😂 16

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...


@borkdude Wow, it's amazing how much babashka can do!

Cora (she/her)21:12:23

should the installer for install it as deps.exe on macos?

Cora (she/her)21:12:08

sure looks like it

Cora (she/her)21:12:35

probably should fix the examples in the readme, then


@corasaurus-hex Where do you see a mistake in the README?


I called it deps.exe to distuingish it from the deps.clj script

Cora (she/her)21:12:23

it says to use the "deps.clj" script

Cora (she/her)21:12:31

huh, I'm confused then


yes, there is a deps.exe executable AND a deps.clj babashka script


you can use the latter if you already have babashka


deps.clj is just a text file that you can run with either clojure or babashka whereas deps.exe is a binary file


they do the same

Cora (she/her)21:12:59

does deps.exe require java?


yes, both require java to invoke tools.deps

Cora (she/her)21:12:38

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)

Cora (she/her)21:12:01

I rather like this project but I don't think babashka supports everything in there

Cora (she/her)21:12:41

and I was going to test that out now


Yeah, just let me know what you need and it'll be added if it makes sense


This project is developed mostly on a by need basis


Lazy evaluation 😉

Cora (she/her)21:12:57

it definitely makes sense 🙂

Cora (she/her)21:12:17

there are some things I don't like about that library, though

Cora (she/her)21:12:30

and handling zips isn't really something I commonly need

Cora (she/her)21:12:49

and it generally returns File objects instead of path as strings

Cora (she/her)21:12:09

but maybe that's a better choice?

Cora (she/her)21:12:40

I kind of want to always be dealing with one thing

Cora (she/her)21:12:19

and sometimes this returns strings and sometimes it returns files


yeah, it depends. don't really know the answer

Cora (she/her)21:12:46

I think I'll avoid the lisp curse and just get this working 🙂

Cora (she/her)21:12:49

first one:

Unable to resolve classname: .FilenameFilter

Cora (she/her)21:12:31

it uses it for globbing when filtering lists of files


cool, can you make an issue for it? (adding more to it as you discover more, is fine)

Cora (she/her)21:12:52

Total results: 665, showing 1 - 24

Cora (she/her)21:12:00

maybe I should focus on using something like the clj-commons fs

Cora (she/her)21:12:23

oh, that's the same thing. ha!

Cora (she/her)21:12:43

File system utilities for Clojure. (forked from Raynes/fs)


Added io/resource to master now


bonus feature of the testing lib:

WARNING: no assertions were made in test borkdude.deps-test/describe-test

Cora (she/her)22:12:09

I just found an issue

Cora (she/her)22:12:20

(require '[ :as io])

(defmacro ^:private predicate [s path]
  `(if ~path
     (. ~path ~s)

(defn absolute?
  "Return true if `path` is absolute."
  (predicate isAbsolute (io/file path)))

(prn (absolute? ""))

Cora (she/her)22:12:35

$ clj 
$ bb 
Don't know how to create ISeq from: clojure.lang.Symbol [at /Users/nsutton/Code/fs/, line 11, column 3]

Cora (she/her)22:12:56

some kind of macro issue, it seems


can you test the macro with clojure first?


@corasaurus-hex This works:

(require '[ :as io])
(defmacro ^:private predicate [s path]
  `(if ~path
     (~(symbol (str "." s)) ~path)
(defn absolute?
  "Return true if `path` is absolute."
  (predicate isAbsolute (io/file path)))
(prn (absolute? ""))


I'll look at the error tomorrow


if you can file an issue as a reminder, that would be cool


released 54 with io/resource now


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

Cora (she/her)23:12:58

gah, the fs stuff relies on some apache stuff for zip so uhhh

Cora (she/her)23:12:06

I think I'll need to make my own fs lib


is this for working with zip files?

Cora (she/her)23:12:38

no, that's the thing

Cora (she/her)23:12:17

it has facilities for it but it feels orthogonal to the lib

Cora (she/her)23:12:36

or at least complementary but separate


this was added for clj-http-lite, because it needs to handle gzip compression I think

Cora (she/her)23:12:42

this bit is tricky, too

Cora (she/her)23:12:55

it fails to run the script because it can't resolve those classes

Cora (she/her)23:12:03

but in clojure those seem to be resolved at runtime

Cora (she/her)23:12:17

or at least that code implies it

Cora (she/her)23:12:36

it seems like bb is checking that before it actually executes


hmm, yes, too early probably

Cora (she/her)23:12:07

and IllegalArgumentException isn't resolvable on its own like in clojure


I've never seen import be used like that before 🙂

Cora (she/her)23:12:14

you need java.lang in front of it

Cora (she/her)23:12:22

it's all a little nope


ok, that's an easy fix



Cora (she/her)23:12:42

reify is missing


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

Cora (she/her)23:12:16

this is the list I have so far


* .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


sounds good

Cora (she/her)23:12:41

filed issues 200 and 199