mirror of
https://github.com/tiennm99/serena.git
synced 2026-08-19 16:24:01 +00:00
Add clojure test repo
This commit is contained in:
@@ -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))
|
||||
Reference in New Issue
Block a user