Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
FROM eclipse-temurin:25-jdk AS java

FROM hexletbasics/base-image:latest

ENV PATH="/exercises-clojure/bin:$PATH"
COPY --from=java /opt/java/openjdk /opt/java/openjdk
ENV JAVA_HOME=/opt/java/openjdk
ENV PATH="/opt/java/openjdk/bin:/exercises-clojure/bin:$PATH"

RUN apt-get update && apt-get install -y --no-install-recommends \
openjdk-21-jdk \
rlwrap \
RUN apt-get update && apt-get install -y --no-install-recommends rlwrap \
&& rm -rf /var/lib/apt/lists/*

RUN curl -fsSL https://download.clojure.org/install/linux-install-1.12.0.1530.sh -o /tmp/clojure-install.sh && \
chmod +x /tmp/clojure-install.sh && \
/tmp/clojure-install.sh && \
rm -f /tmp/clojure-install.sh && \
curl -fsSL https://raw.githubusercontent.com/babashka/babashka/master/install -o /tmp/babashka-install && \
chmod +x /tmp/babashka-install && \
/tmp/babashka-install --version 1.3.185 && \
rm -f /tmp/babashka-install
ARG CLOJURE_VERSION=1.12.6.1673
ARG BABASHKA_VERSION=1.13.229
RUN curl -fsSL "https://download.clojure.org/install/linux-install-${CLOJURE_VERSION}.sh" -o /tmp/clojure-install.sh \
&& bash /tmp/clojure-install.sh \
&& rm -f /tmp/clojure-install.sh \
&& curl -fsSL "https://raw.githubusercontent.com/babashka/babashka/v${BABASHKA_VERSION}/install" -o /tmp/babashka-install \
&& bash /tmp/babashka-install --version "${BABASHKA_VERSION}" \
&& rm -f /tmp/babashka-install

WORKDIR /exercises-clojure

Expand Down
7 changes: 4 additions & 3 deletions src/test-helper.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@
(defn ^:export assert-output [expected]
(deftest output-test
(let [out (s/trim (with-out-str (load-file "index.clj")))]
(is (= out expected))))
(is (= expected out))))
(run-test))

(defn ^:export assert-solution [samples expected solution]
(let [combined (map vector samples expected)]
(deftest solution-test
(doseq [[sample result] combined]
(is (= (apply solution sample) result)))))
(is (= result (apply solution sample))
(str "Arguments: " (pr-str sample))))))
(run-test))

(defn ^:export check-eq [val expected]
(deftest value-assert-test
(is (= val expected)))
(is (= expected val)))
(run-test))

Loading