Skip to content

Commit 6c7ece9

Browse files
committed
Add indentation tests for fn, def, and bound-fn
These :defn-style forms had indent specs but no dedicated tests verifying body indentation. Includes fn with name, multi-arity fn, and def with metadata.
1 parent 21e229b commit 6c7ece9

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

test/clojure-mode-indentation-test.el

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,36 @@ DESCRIPTION is a string with the description of the spec."
617617
:some-option true
618618
:another false)")
619619

620+
(when-indenting-it "should handle fn"
621+
"
622+
(fn [x]
623+
(inc x))"
624+
625+
"
626+
(fn my-fn [x]
627+
(inc x))"
628+
629+
"
630+
(fn
631+
([x]
632+
(inc x))
633+
([x y]
634+
(+ x y)))")
635+
636+
(when-indenting-it "should handle def"
637+
"
638+
(def x
639+
(+ 1 2))"
640+
641+
"
642+
(def ^:dynamic *x*
643+
42)")
644+
645+
(when-indenting-it "should handle bound-fn"
646+
"
647+
(bound-fn [x]
648+
(inc x))")
649+
620650
(when-indenting-it "should handle reader conditionals"
621651
"#?@ (:clj []
622652
:cljs [])")

0 commit comments

Comments
 (0)