Skip to content

Commit

Permalink
Add tests for indentation of forms with metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
kommen committed Oct 28, 2024
1 parent f450591 commit 1a73e93
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
30 changes: 29 additions & 1 deletion test/clojure-ts-mode-indentation-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,32 @@ DESCRIPTION is a string with the description of the spec."
"
{\"1\" 2
*3 4}")
)

(when-indenting-it "should have no indentation at top level lists with metadata"
"
^{:foo true}
(def b 2)")

(when-indenting-it "should have no indentation at top level vectors with metadata"
"
^{:foo true}
[1 2]")

(when-indenting-it "should have no indentation at top level maps with metadata"
"
^{:foo true}
{:a 1}")

(when-indenting-it "should have no indentation with metadata inside comment"
"
(comment
^{:a 1}
(def a 2))")

(when-indenting-it "should have params, docstring and body correctly indented in presence of metadata"
"
^{:foo true}
(defn c
\"hello\"
[_foo]
(+ 1 1))"))
2 changes: 1 addition & 1 deletion test/samples/indentation.clj
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,4 @@
(defn c
"hello"
[_foo]
(+ 1 1))
(+ 1 1))

0 comments on commit 1a73e93

Please sign in to comment.