superlint/test/linters/clojure/clojure_good_1.clj

35 lines
483 B
Clojure
Raw Permalink Normal View History

2020-06-19 14:30:28 -04:00
(ns foo
(:require
2020-11-06 17:18:48 -05:00
[clojure.string :as str]))
2020-06-19 14:30:28 -04:00
(butlast [1 2 3])
(str/join "" "")
(defn foo-fn [x]
(let [y (fn [] (inc x))]
2020-06-19 14:30:28 -04:00
(y)))
(letfn
2020-11-06 17:18:48 -05:00
[(f [g] (h g))
(h [i] (f i))])
2020-06-19 14:30:28 -04:00
(defn foo [] 1)
(inc (foo))
(Thread/sleep 1000 1)
;; Here we switch to another namespace and require the previous:
(ns bar (:require [foo :as f]))
(f/foo-fn 1)
{:a 1 :b 2}
#{1 2}
{:a 1 :b 2}
(ns bar-test (:require [clojure.test :as t]))
(t/deftest my-tests
2020-11-06 17:18:48 -05:00
(t/is (odd? (inc 1))))