Fix bb compat, fixes #549

This commit is contained in:
Michiel Borkent 2024-10-29 17:04:29 +01:00
parent b271a898f5
commit 362818530a
3 changed files with 42 additions and 2 deletions

29
.github/workflows/test-bb.yml vendored Normal file
View file

@ -0,0 +1,29 @@
name: Pull Request
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Clojure CLI
uses: DeLaGuardo/setup-clojure@master
with:
cli: '1.12.0.1479'
bb: latest
- name: Cache All The Things
uses: actions/cache@v4
with:
path: |
~/.m2/repository
~/.gitlibs
~/.clojure
~/.cpcache
key: ${{ runner.os }}-${{ hashFiles('**/deps.edn', '**/bb.edn') }}
- name: Run Tests
run: bb test

9
bb.edn Normal file
View file

@ -0,0 +1,9 @@
{:paths ["src"]
:tasks
{test
{:extra-paths ["test"]
:extra-deps {io.github.cognitect-labs/test-runner
{:git/tag "v0.5.1" :git/sha "dfb30dd"}
org.clojure/core.cache {:mvn/version "RELEASE"}}
:task (exec 'cognitect.test-runner.api/test)
:exec-args {:patterns ["^(?!honey.cache).*-test$"]}}}}

View file

@ -419,7 +419,8 @@
(defn- format-simple-var (defn- format-simple-var
([x] ([x]
(let [c (if (keyword? x) (let [c (if (keyword? x)
#?(:clj (str (.sym ^clojure.lang.Keyword x)) ;; Omits leading colon #?(:bb (str (symbol x))
:clj (str (.sym ^clojure.lang.Keyword x)) ;; Omits leading colon
:default (subs (str x) 1)) :default (subs (str x) 1))
(str x))] (str x))]
(format-simple-var x c {}))) (format-simple-var x c {})))
@ -437,7 +438,8 @@
;; for multiple / in the %fun.call case so that ;; for multiple / in the %fun.call case so that
;; qualified column names can be used: ;; qualified column names can be used:
(let [c (if (keyword? x) (let [c (if (keyword? x)
#?(:clj (str (.sym ^clojure.lang.Keyword x)) ;; Omits leading colon #?(:bb (str (symbol x))
:clj (str (.sym ^clojure.lang.Keyword x)) ;; Omits leading colon
:default (subs (str x) 1)) :default (subs (str x) 1))
(str x))] (str x))]
(cond (str/starts-with? c "%") (cond (str/starts-with? c "%")