Skip to content

Commit

Permalink
add tests for lists and attrsets
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Coltharp committed Sep 26, 2024
1 parent c55ceef commit afe8c93
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/nix-ts-mode-indent-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,15 @@ output is identical to the given expression."
(lambda ()
(nix-ts-mode)
(indent-region (point-min) (point-max)))))

(ert-deftest nix-list ()
(ert-test-erts-file (ert-resource-file "indent-list.erts")
(lambda ()
(nix-ts-mode)
(indent-region (point-min) (point-max)))))

(ert-deftest nix-attrset ()
(ert-test-erts-file (ert-resource-file "indent-attrset.erts")
(lambda ()
(nix-ts-mode)
(indent-region (point-min) (point-max)))))
25 changes: 25 additions & 0 deletions test/resources/indent-attrset.erts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Name: simple-attrset

=-=
{
hello =
world;

yes =
"no";

pi =
3;
}
=-=
{
hello =
world;

yes =
"no";

pi =
3;
}
=-=-=
15 changes: 15 additions & 0 deletions test/resources/indent-list.erts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Name: simple-list

=-=
[
foo
"bar"
42
]
=-=
[
foo
"bar"
42
]
=-=-=

0 comments on commit afe8c93

Please sign in to comment.