Add clojure test repo

This commit is contained in:
Miguel de Benito Delgado
2025-06-28 08:37:41 +00:00
parent fd3c633703
commit b8436c5c4a
3 changed files with 45 additions and 0 deletions
@@ -0,0 +1,5 @@
{:paths ["src"]
:deps {org.clojure/clojure {:mvn/version "1.11.1"}}
:aliases
{:test {:extra-paths ["test"]
:extra-deps {org.clojure/test.check {:mvn/version "1.1.1"}}}}}
@@ -0,0 +1,23 @@
(ns test-app.core)
(defn greet
"A simple greeting function"
[name]
(str "Hello, " name "!"))
(defn add
"Adds two numbers"
[a b]
(+ a b))
(defn multiply
"Multiplies two numbers"
[a b]
(* a b))
(defn -main
"Main entry point"
[& args]
(println (greet "World"))
(println "2 + 3 =" (add 2 3))
(println "4 * 5 =" (multiply 4 5)))
@@ -0,0 +1,17 @@
(ns test-app.utils
(:require [test-app.core :as core]))
(defn calculate-area
"Calculates the area of a rectangle"
[width height]
(core/multiply width height))
(defn format-greeting
"Formats a greeting message"
[name]
(str "Welcome, " (core/greet name)))
(defn sum-list
"Sums a list of numbers"
[numbers]
(reduce core/add 0 numbers))